initial
[fpgammix.git] / workloads / loader.mms
blob076762c28872245981fdf5913e293fb80494f609
1 * Boot loader
2 * XXXXXXXX:     set the address
3 * XXXXXXXX      store datum at address & advance address
4 * XXXXXXXXG     Start executing
6 * Basically
8 * readvalue -> (value, {,G,:} )
10 * main
11 *   ptr = 0
12 *   loop
13 *     (value, cmd) <- readvalue
14 *     if cmd == ':' then
15 *       ptr = value
16 *     else if cmd == 'G' then
17 *       call value
18 *     else
19 *       *ptr++ = value
20 *   repeat loop
22 IOSPACE GREG
23 C       GREG
24 tmp     GREG
26         LOC     #100
27 Main    SETH    IOSPACE,1
29 1H      PUSHJ   $0,Getch
30         SETL    $2,'<'; PUSHJ $1,Putch
31         ADD     $2,$0,0; PUSHJ  $1,Putch
32         SETL    $2,'>'; PUSHJ $1,Putch
33         JMP     1B
35 Putch   LDTU    tmp,IOSPACE,4
36         PBOD    tmp,Putch
37         STBU    $0,IOSPACE,7
38         POP     1,0
40 Getch   LDTU    $0,IOSPACE,12
41         PBN     $0,Getch
42         POP     1,0
44 Readvalue
45         SETL