en:pfw:assemblers_msp430-assembler
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:pfw:assemblers_msp430-assembler [2023-09-04 18:10] – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | en:pfw:assemblers_msp430-assembler [2023-09-05 06:33] (current) – ↷ Links angepasst, weil Seiten im Wiki verschoben wurden 157.90.7.32 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | {{pfw: | ||
| + | ====== Assembler for MSP430 ====== | ||
| + | ===== The idea: ===== | ||
| + | |||
| + | A compact universal MSP430 assembler | ||
| + | |||
| + | ===== Implementation ===== | ||
| + | |||
| + | The example asumes a 16-bit machine and compile actions. Also a Flash environment is assumed, for RAM only systems '' | ||
| + | |||
| + | <code forth> | ||
| + | CHERE ROM! ?ABORT | ||
| + | |||
| + | : CHERE ( -- a ) Leave flash or FRAM address on the stack ; | ||
| + | : {W ( -- ) enable write access to flash or FRAM ; | ||
| + | : W} ( -- ) disable write access to flash or FRAM ; | ||
| + | : ROM! ( x -- ) {W ! W} ; \ Store ' | ||
| + | : ?ABORT ( f -- ) if abort then ; \ Replace noForth style compact error message | ||
| + | </ | ||
| + | |||
| + | **27 instructions (16b, .B = 8b)** | ||
| + | |||
| + | < | ||
| + | ✦ 6 instructions with 1 operand | ||
| + | RRA RRC SWPB SXT PUSH CALL | ||
| + | | ||
| + | ✦ 12 instructions with 2 operands | ||
| + | MOV CMP ADD SUB ADDC SUBC DADD | ||
| + | BIT BIS BIC BIA (AND) BIX (XOR) | ||
| + | | ||
| + | ✦ 8 jump instructions with relative inline addresses | ||
| + | JNZ JZ JNC JC JN JGE JL JMP | ||
| + | | ||
| + | ✦ return from interrupt | ||
| + | RETI | ||
| + | </ | ||
| + | |||
| + | Example of it's use: | ||
| + | |||
| + | <code forth> | ||
| + | code LSHIFT ( x1 n -- x2 ) | ||
| + | tos w mov | ||
| + | sp )+ tos mov | ||
| + | #0 w cmp <>? if, | ||
| + | begin, | ||
| + | tos tos add | ||
| + | #1 w sub | ||
| + | =? until, | ||
| + | then, | ||
| + | next end-code | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | | File name | Commands | Purpose | on Github (external link) | | ||
| + | | [[pfw: | ||
| + | | [[pfw: | ||
| + | |||
| + | ==== Contributions ==== | ||
| + | |||
| + | < | ||
| + | |||
| + | |||
| + | [[en: | ||