Micro­power

  

Volume 1, Number 3 – November 1981











Page 16 of 33











0DB05D2290DONESPLD E, L; FIRST DIGIT
0DB17B2300OUTPUTLD A, E; LOAD EACH DIGIT
0DB2FE0A2310CP £0A; COMPARE WITH TEN
0DB4D12320POP DE; FOLLOWING DIGIT
0DB5C82330RET Z; RETURN TO MAIN PROG.
0DB6C6302340ADD A, £30; DECIMAL TO ASCII
0DB8F72350RST £30; OUTPUT DIGIT
0DB9C3B10D2360JP OUTPUT
2370; DIVIDE SUBROUTINE
0DBCE52380DIVIDEPUSH HL; DIVIDE HL BY DE
0DBD6C2390LD L, H; PUTTING RESULT N BC
0DBE26002400LD H, 0; AND REMAINDER IN HL
0DC0CDC70D2410CALL DIVLOP
0DC3412420LD B, C
0DC47D2430LD A, L
0DC5E12440POP HL
0DC6672450LD H, A
0DC70EFF2460DIVLOPLD C, £FF
0DC90C2470DIVADDINC C
0DCACDD20D2480CALL DIVSUB
0DCDD2C90D2490JP NC, DIVADD
0DD0192500ADD HL, DE; ADD TEN IF CARRY
0DD1C92510RET
0DD27D2520DIVSUBLD A, L; LEAST SIG. BYTE
0DD3932530SUB E; SUBTRACT TEN
0DD46F2540LD L, A
0DD57C2550LD A, H; MOST SIG. BYTE
0DD69A2560SBC A, D; SUB 0 PLUS CARRY
0DD7672570LD H, A
0DD8C92580RET
2590;
2600; CONVERSION TABLE TRS-80 THEN NAS­COM
2610;
0DD92620TABLEEQU £0DD9
2630;
2640; HEX DUMP OF TABLE

0DD980808181829D839C8499878288838984
0DE98A858B868C878D888E898F8A908B918C
0DF9928D938E948FA090A191B094B195B29E
0E09B39FB4A0B8A1B9A2BAA3BBA4BCA5BDA6
0E19BEA7C1B9C6C7CAA9CBAACCABCDACCEAD
0E29CFAED0AFD1B0D2B1D3B2D4B3D5B4D6B5
0E39D7B6D8B7D9B8DABADBBBDCBCDDBDDEBE
0E49DFBFE0C0E1C1E2C2E3C3E4C4E5C5F3C8
0E59F4C9F5CAF6CBF7CCF8CDF9CEFACF0000











Page 16 of 33