.word FBLANK,SKIP ; -- sep c-addr
FORTHtoASM ; -- sep c-addr
MOV #0,S ; -- sep c-addr reset ASMTYPE
- MOV &DDP,T ; -- sep c-addr HERE --> OPCODEADR (opcode is preset to its address !)
+ MOV &DDP,T ; -- sep c-addr T=OPCODEADR (opcode is preset to its address !)
ADD #2,&DDP ; -- sep c-addr cell allot for opcode
MOV.B @TOS,W ; -- sep c-addr W=first char of instruction code
MOV @PSP+,TOS ; -- sep W=c-addr
; case of all others "#xxxx," ; -- xxxx
PARAM1000 MOV #0030h,S ; -- xxxx add immediate code type : @PC+,
+; case of all others "#xxxx," ; -- xxxx
; case of "&xxxx," ; <== PARAM110
; case of ",&xxxx" ; <== PARAM20
-StoreArg MOV &DDP,X ; -- xxxx
+StoreArg MOV &DDP,X ; -- xxxx don't use T=OPCODEADR
ADD #2,&DDP ; cell allot for arg
StoreTOS ; <== TYPE1DOES
- MOV TOS,0(X) ; compile arg
+ MOV TOS,0(X) ; compile arg
; endcase of all "&xxxx" ;
; endcase of all "#xxxx" ; <== PARAM101,102,104,108,10M1
; endcase of all "REG"|"@REG"|"@REG+" ; <== PARAM124
; case of "xxxx(REG)," ; -- 0R00 (src REG typeI or dst REG typeII)
; case of "@REG," ; -- 0R00 (src REG typeI)
; case of "REG," ; -- 0R00 (src REG typeI or dst REG typeII)
-
-
-
; case of ",REG" ; -- 000R <== PARAM21 (dst REG typeI)
; case of ",xxxx(REG)" ; -- 000R <== PARAM210 (dst REG typeI)
PARAM124 ADD TOS,S ; -- 0R00|000R
- JMP PARAMENDOF
+ JMP PARAMENDOF ;
; ------------------------------------------
; case of "REG,"|"xxxx(REG)," ; first, searg REG of "REG,"
; DTCforthMSP430FR5xxx ASSEMBLER : INTERPRET 2th OPERAND
; ----------------------------------------------------------------------
+INITPARAM2 ; for OPCODES TYPE III
+ MOV #0,S ; init ASMTYPE=0
+ MOV &DDP,T ; T=OPCODEADR
+ ADD #2,&DDP ; make room for opcode
+
; PARAM2 -- ; parse input buffer until BL and compute this 2th operand
PARAM2 mDOCOL ;
.word FBLANK,SKIP ; skip space(s) between "arg1," and "arg2" if any; use not S,T.
FORTHtoASM ; -- PFADOES
MAKEOPCODE MOV @TOS,TOS ; -- opcode part of instruction
BIS S,TOS ; -- opcode opcode is complete
- MOV T,X ; -- opcode X= OPCODEADR to compile opcode
+ MOV T,X ; -- opcode X=T= OPCODEADR to compile opcode
JMP StoreTOS ; then EXIT
asmword "MOV"
TYPE3DOES ; -- PFADOES
.word FBLANK,SKIP ; skip spaces if any
FORTHtoASM ; -- PFADOES c-addr
- MOV #0,S ; init ASMTYPE=0
- MOV &DDP,T ; init OPCODEADR=DP
- ADD #2,&DDP ; make room for opcode
ADD #1,&TOIN ; skip "#"
MOV #',',TOS ; -- PFADOES ","
- PUSHM #2,S ; PUSHM S,T
ASMtoFORTH
.word WORDD,QNUMBER
- .word QFBRAN,NotFound ; ABORT
- FORTHtoASM
- POPM #2,S ; POPM T,S
- ASMtoFORTH
- .word PARAM2 ; -- PFADOES 0x000N S=ASMTYPE = 0x000R
+ .word QFBRAN,NotFound ; ABORT
+ .word INITPARAM2 ; -- PFADOES 0x000N S=ASMTYPE = 0x000R
FORTHtoASM
MOV TOS,W ; -- PFADOES n W = n
MOV @PSP+,TOS ; -- PFADOES