help/figures/fig0511.pep
raw| 1 | ;File: fig0511.pep |
| 2 | ;Computer Systems, Fourth Edition |
| 3 | ;Figure 5.11 |
| 4 | ; |
| 5 | BR 0x0005 ;Branch around data |
| 6 | .BLOCK 2 ;Storage for one integer |
| 7 | ; |
| 8 | DECI 0x0003,d ;Get the number |
| 9 | DECO 0x0003,d ;and output it |
| 10 | CHARO ' ',i ;Output " + 1 = " |
| 11 | CHARO '+',i |
| 12 | CHARO ' ',i |
| 13 | CHARO '1',i |
| 14 | CHARO ' ',i |
| 15 | CHARO '=',i |
| 16 | CHARO ' ',i |
| 17 | LDA 0x0003,d ;A <- the number |
| 18 | ADDA 1,i ;Add one to it |
| 19 | STA 0x0003,d ;Store the sum |
| 20 | DECO 0x0003,d ;Output the sum |
| 21 | STOP |
| 22 | .END |