2012/3/15 22:6 ftst7.txt
END=819B
; BDOS TEST7 get IOBYTE & version No.
;2012/3/15
;
ORG $8100
FCALL=$8005
;
;IOBYTE
8100 0E07 LD C,07;get iobyte
8102 CD0580 CALL FCALL
8105 F5 PUSH AF
8106 118881 LD DE,IOBYTE
8109 0E09 LD C,09;string out
810B CD0580 CALL FCALL
810E F1 POP AF
810F CD5081 CALL B2HEXDP
8112 CD2881 CALL CRLF
;version no.
8115 0E0C LD C,0C;version no. get
8117 CD0580 CALL FCALL
811A E5 PUSH HL
811B 119081 LD DE,VERNO
811E 0E09 LD C,09;string out
8120 CD0580 CALL FCALL
8123 E1 POP HL
8124 CD3F81 CALL HEX4DP
8127 C9 RET
;
;CL & LF
8128 3E0D CRLF:LD A,0D
812A CD3481 CALL ADP
812D 3E0A LD A,0A
812F C33481 JP ADP
;space disp
8132 3E20 SPDP:LD A,20
;A disp
8134 C5 ADP:PUSH BC
8135 E5 PUSH HL
8136 5F LD E,A
8137 0E02 LD C,02
8139 CD0580 CALL FCALL
813C E1 POP HL
813D C1 POP BC
813E C9 RET
;HL(bynary 2bytes) to asckii 4bytes & disp
813F C5 HEX4DP:PUSH BC
8140 E5 PUSH HL
8141 CD6981 CALL B2HEX4;binary 2 bytes to ascii HEX 4bytes
8144 D5 PUSH DE
8145 EB EX DE,HL
8146 CD5B81 CALL DEDP
8149 D1 POP DE
814A CD5B81 CALL DEDP
814D E1 POP HL
814E C1 POP BC
814F C9 RET
;A(binary) to asckii 2bytes HEX & disp
8150 C5 B2HEXDP:PUSH BC
8151 E5 PUSH HL
8152 CD6F81 CALL B2HEX2
8155 CD5B81 CALL DEDP
8158 E1 POP HL
8159 C1 POP BC
815A C9 RET
;
;DE(asckii 2bytes) disp
815B D5 DEDP:PUSH DE
815C 5A LD E,D
815D 0E02 LD C,02
815F CD0580 CALL FCALL
8162 D1 POP DE
8163 0E02 LD C,02
8165 CD0580 CALL FCALL
8168 C9 RET
;
;binary to hex, 2bytes data to ascii 4charactors,HL to HL,DE
8169 7C B2HEX4:LD A,H
816A CD6F81 CALL B2HEX2
816D EB EX DE,HL
816E 7B LD A,E
;binary to hex, 1byte data to ascii 2charactors,A to DE
816F F5 B2HEX2:PUSH AF
8170 0F RRCA
8171 0F RRCA
8172 0F RRCA
8173 0F RRCA
8174 CD7E81 CALL B2HEX1
8177 57 LD D,A
8178 F1 POP AF
8179 CD7E81 CALL B2HEX1
817C 5F LD E,A
817D C9 RET
;binary to hex, low 4bit to ascii 1charactor
817E E60F B2HEX1:AND 0F
8180 C630 ADD A,30
8182 FE3A CP 3A
8184 D8 RET C;0-9
8185 C607 ADD A,07;A-F
8187 C9 RET
;
8188 696F6279 IOBYTE:"ioby"
818C 7465 "te"
818E 3D DB 3D;=
818F 24 DB 24;$
8190 76657273 VERNO:"vers"
8194 696F6E20 "ion "
8198 484C "HL"
819A 3D DB 3D
819B 24 DB 24;$
;
ADP =8134 B2HEX1 =817E B2HEX2 =816F
B2HEX4 =8169 B2HEXDP =8150 CRLF =8128
DEDP =815B FCALL =8005 HEX4DP =813F
IOBYTE =8188 SPDP =8132 VERNO =8190
|