--- gforth/arch/misc/asm.fs 1998/05/02 21:28:57 1.3 +++ gforth/arch/misc/asm.fs 2002/10/02 15:54:57 1.5 @@ -2,6 +2,9 @@ Vocabulary assembler also assembler also definitions forth +\ [IFUNDEF] cross +\ : X ; +\ [THEN] \ sources @@ -22,14 +25,16 @@ $7 Constant *ACCU $C Constant XOR $D Constant OR $E Constant AND $F Constant SHR -$FFFC Constant tx +$FFFC Constant txd +$FFFF Constant rx? +$FFFE Constant rxd \ $FFF0 Constant tx : end-label previous ; Create marks $10 cells allot -: ahere s" here" evaluate 2/ ; +: ahere X here 2/ ; : m ( n -- ) cells marks + ahere 2* swap ! 0 ; : r ( n -- ) cells marks + @ ahere swap s" !" evaluate 0 ; @@ -51,11 +56,18 @@ Create marks $10 cells allot r> $10 /string 0 max rot $10 + -rot REPEAT drop 2drop ; -: sym base @ >r hex - cr ." sym:s/PC=" ahere 4 0.r ." /" bl word count type ." /g" cr - r> base ! ; +\ : sym +\ base @ >r hex +\ cr ." sym:s/PC=" ahere 4 0.r ." /" bl word count type ." /g" cr +\ r> base ! ; +: sym bl word drop ; + +: label + >in @ bl word count X here symentry >in ! + ahere Constant ; -: label ahere Constant ; +: code + -1 ABORT" Need end-code or end-label before a new code definition" ; also forth definitions @@ -65,3 +77,4 @@ also forth definitions : (end-code) previous ; previous previous previous +