initial
[fpgammix.git] / workloads / dyncodegen.mms
blob6298a25c4a233ad49b0998278dc43663c5575d15
1 * This is really just to test that we can execute code from SRAM, but
2 * it's also self-modifying code (SMC).
4 C       GREG
5 SRAM    GREG
6 IOSPACE GREG
7 tmp     GREG
9         LOC     #100
10 Main    SETH    IOSPACE,1
11         SETH    SRAM,0
13 * Write SETL C,#1729  (e3fe1729)
15         SETL    tmp,#1729
16         INCML   tmp,#e3ff
17         STTU    tmp,SRAM,0
19 * Write POP 0,0  (f8000000)
21         SETML   tmp,#f800
22         STTU    tmp,SRAM,4
24         PUSHGO  $0,SRAM
26         SETL    tmp,#1729
27         CMP     tmp,tmp,$255
28         BNZ     tmp,1F
30         SETL    C,'Y'; PUSHJ $0,Putch
31         SETL    C,'E'; PUSHJ $0,Putch
32         SETL    C,'S'; PUSHJ $0,Putch
33         SETL    C,'!'; PUSHJ $0,Putch
34         SETL    C,13;  PUSHJ $0,Putch
35         SETL    C,10;  PUSHJ $0,Putch
36         JMP     Main
38 1H      SETL    C,'N'; PUSHJ $0,Putch
39         SETL    C,'O'; PUSHJ $0,Putch
40         SETL    C,'!'; PUSHJ $0,Putch
41         SETL    C,'!'; PUSHJ $0,Putch
42         SETL    C,13;  PUSHJ $0,Putch
43         SETL    C,10;  PUSHJ $0,Putch
44         JMP     Main
47 Putch   LDO     tmp,IOSPACE
48         PBOD    tmp,Putch
49         STBU    C,IOSPACE
50         POP     0,0