************************************************* * * Dummy Extension for STOS * * Interpreter version * OUTPUT D:\STOS\STOS\DUMMY.EXZ * Jump header bra INIT *********************************************** * * Header * * Start of token list dc.b 128 TOKENS dc.b "some command",128 dc.b "instr name",129 even=instruction, odd=function * The end of the token list dc.b 0 even * Now the jump table JUMPS dc.w 2 in order of token, starting from 128 dc.l dummy pad any 'unused' tokens with dummy dc.l somefun * The welcome mesages in English and French WELCOME dc.b 10,13," The Dummy Extension v0.1",0 dc.b 10,13," le Extension Dummy v0.1",0 even * Some system variables RETURN dc.l 0 SYSTEM dc.l 0 * The routine that is called on start-up INIT lea END,a0 lea COLDST,a1 rts COLDST move.l a0,SYSTEM lea WELCOME,a0 ; vital stuff lea WARMST,a1 lea TOKENS,a2 lea JUMPS,a3 rts * Executed on UNDO in editor WARMST rts ************************* * * Our commands * * somecommand move.l (sp)+,RETURN tst.b d0 bne SYNTAX * do something move.l RETURN,a0 jmp (a0) somefun move.l (sp)+,RETURN cmpi #2,d0 test number of opperands bne SYNTAX movem.l (sp)+,d2-d4 get second operand tst.b d2 d2=type (0=int, $80=string) bne TYPEMIS d3=value (or pointer to string) movem.l (sp)+,d2-d4 get first operand tst.b d2 d2=type (0=int, $80=string) bne TYPEMIS d3=value (or pointer to string) clr.l d2 return value - d2=type add.l global,d3 d3=value clr.l d4 move.l RETURN,a0 jmp (a0) ************************* * * Odds and sods... * dummy move.l (sp)+,RETURN bra NOTDONE SYNTAX moveq #12,d0 move.l SYSTEM,a0 move.l $14(a0),a0 jsr (a0) TYPEMIS moveq #19,d0 move.l SYSTEM,a0 move.l $14(a0),a0 jsr (a0) NOTDONE moveq #0,d0 move.l SYSTEM,a0 move.l $14(a0),a0 jsr (a0) ************************* * * Data space * global ds.l 1 ************************* * * End of code dc.l 0 END