; BDOS TEST19 login vector & r/o vector function18,1D
;2012/4/10 test12
;4/16 test19
;9/3
;
ORG $0100
FCALL=$0005
FCB=$005C
;
LD C,18
CALL FCALL
LD A,4C;'L' login vector
CALL ADP
CALL SPDP
CALL HEX4DP
CALL CRLF
LD C,1D
CALL FCALL
LD A,52;'R' R/O vector
CALL ADP
CALL SPDP
CALL HEX4DP
RET
;
;CL & LF
CRLF:LD A,0D
CALL ADP
LD A,0A
JP ADP
;space disp
SPDP:LD A,20
;A disp
ADP:PUSH BC
PUSH HL
LD E,A
LD C,02
CALL FCALL
POP HL
POP BC
RET
;
;binary to hex, 2bytes data to ascii 4charactors,HL to HL,DE
B2HEX4:LD A,H
CALL B2HEX2
EX DE,HL
LD A,E
;binary to hex, 1byte data to ascii 2charactors,A to DE
B2HEX2:PUSH AF
RRCA
RRCA
RRCA
RRCA
CALL B2HEX1
LD D,A
POP AF
CALL B2HEX1
LD E,A
RET
;binary to hex, low 4bit to ascii 1charactor
B2HEX1:AND 0F
ADD A,30
CP 3A
RET C;0-9
ADD A,07;A-F
RET
;hex to binary, ascii 1charactor to low 4bit
HTOB1:CP 30;>="0"?
RET C;no
CP 3A;<="9"?
JP C,HTOB1_2;yes,"0" to "9"
CP 41;>="A" ?
RET C;no
CP 47;<="F"?
JP C,HTOB1_1
CP 61;>="a"?
RET C;no
CP 67;<="f"?
CCF
RET C;no
HTOB1_1:ADD A,09;41 to 46 -> 4A to 4F,or 61 to 67 -> 6A to 6F
HTOB1_2:AND 0F
RET
;HL(bynary 2bytes) to asckii 4bytes & disp
HEX4DP:PUSH BC
PUSH HL
CALL B2HEX4;binary 2 bytes to ascii HEX 4bytes
PUSH DE
EX DE,HL
CALL DEDP
POP DE
CALL DEDP
POP HL
POP BC
RET
;A(binary) to asckii 2bytes HEX & disp
B2HEXDP:PUSH BC
PUSH HL
CALL B2HEX2
CALL DEDP
POP HL
POP BC
RET
;
;DE(asckii 2bytes) disp
DEDP:PUSH DE
LD E,D
LD C,02
CALL FCALL
POP DE
LD C,02
CALL FCALL
RET
;
|