Micropower |
Volume 1 · Number 3 · November 1981 |
Page 16 of 33 |
---|
0DB0 | 5D | 2290 | DONESP | LD E, L | ; FIRST DIGIT |
0DB1 | 7B | 2300 | OUTPUT | LD A, E | ; LOAD EACH DIGIT |
0DB2 | FE0A | 2310 | CP £0A | ; COMPARE WITH TEN | |
0DB4 | D1 | 2320 | POP DE | ; FOLLOWING DIGIT | |
0DB5 | C8 | 2330 | RET Z | ; RETURN TO MAIN PROG. | |
0DB6 | C630 | 2340 | ADD A, £30 | ; DECIMAL TO ASCII | |
0DB8 | F7 | 2350 | RST £30 | ; OUTPUT DIGIT | |
0DB9 | C3B10D | 2360 | JP OUTPUT | ||
2370 | ; DIVIDE SUBROUTINE | ||||
0DBC | E5 | 2380 | DIVIDE | PUSH HL | ; DIVIDE HL BY DE |
0DBD | 6C | 2390 | LD L, H | ; PUTTING RESULT N BC | |
0DBE | 2600 | 2400 | LD H, 0 | ; AND REMAINDER IN HL | |
0DC0 | CDC70D | 2410 | CALL DIVLOP | ||
0DC3 | 41 | 2420 | LD B, C | ||
0DC4 | 7D | 2430 | LD A, L | ||
0DC5 | E1 | 2440 | POP HL | ||
0DC6 | 67 | 2450 | LD H, A | ||
0DC7 | 0EFF | 2460 | DIVLOP | LD C, £FF | |
0DC9 | 0C | 2470 | DIVADD | INC C | |
0DCA | CDD20D | 2480 | CALL DIVSUB | ||
0DCD | D2C90D | 2490 | JP NC, DIVADD | ||
0DD0 | 19 | 2500 | ADD HL, DE | ; ADD TEN IF CARRY | |
0DD1 | C9 | 2510 | RET | ||
0DD2 | 7D | 2520 | DIVSUB | LD A, L | ; LEAST SIG. BYTE |
0DD3 | 93 | 2530 | SUB E | ; SUBTRACT TEN | |
0DD4 | 6F | 2540 | LD L, A | ||
0DD5 | 7C | 2550 | LD A, H | ; MOST SIG. BYTE | |
0DD6 | 9A | 2560 | SBC A, D | ; SUB 0 PLUS CARRY | |
0DD7 | 67 | 2570 | LD H, A | ||
0DD8 | C9 | 2580 | RET | ||
2590 | ; | ||||
2600 | ; CONVERSION TABLE TRS-80 THEN Nascom | ||||
2610 | ; | ||||
0DD9 | 2620 | TABLE | EQU £0DD9 | ||
2630 | ; | ||||
2640 | ; HEX DUMP OF TABLE |
0DD9 | 80 | 80 | 81 | 81 | 82 | 9D | 83 | 9C | 84 | 99 | 87 | 82 | 88 | 83 | 89 | 84 |
0DE9 | 8A | 85 | 8B | 86 | 8C | 87 | 8D | 88 | 8E | 89 | 8F | 8A | 90 | 8B | 91 | 8C |
0DF9 | 92 | 8D | 93 | 8E | 94 | 8F | A0 | 90 | A1 | 91 | B0 | 94 | B1 | 95 | B2 | 9E |
0E09 | B3 | 9F | B4 | A0 | B8 | A1 | B9 | A2 | BA | A3 | BB | A4 | BC | A5 | BD | A6 |
0E19 | BE | A7 | C1 | B9 | C6 | C7 | CA | A9 | CB | AA | CC | AB | CD | AC | CE | AD |
0E29 | CF | AE | D0 | AF | D1 | B0 | D2 | B1 | D3 | B2 | D4 | B3 | D5 | B4 | D6 | B5 |
0E39 | D7 | B6 | D8 | B7 | D9 | B8 | DA | BA | DB | BB | DC | BC | DD | BD | DE | BE |
0E49 | DF | BF | E0 | C0 | E1 | C1 | E2 | C2 | E3 | C3 | E4 | C4 | E5 | C5 | F3 | C8 |
0E59 | F4 | C9 | F5 | CA | F6 | CB | F7 | CC | F8 | CD | F9 | CE | FA | CF | 00 | 00 |
Page 16 of 33 |
---|