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