-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathutilit
94 lines (94 loc) · 1.42 KB
/
utilit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
.PAG 'UTILITIES'
;WRITE ADR FROM TMPO STORES
WROA LDX #1
WROA1 LDA TMP0-1,X
PHA
LDA TMP0,X
JSR WROB
PLA
;WRITE BYTE --- A = BYTE
;UNPACK BYTE DATA INTO TWO ASCII
;CHARACTERS. A=BYTE; X,A=CHARS
WROB PHA
LSR A
LSR A
LSR A
LSR A
JSR ASCII ;CONVERT TO ASCII
TAX
PLA
AND #$0F
JSR ASCII
;WRITE 2 CHARS--X,A=CHARS
WRTWO PHA
TXA
JSR KBSOUT
PLA
JMP KBSOUT
ASCII CLC
ADC #$F6
BCC ASC1
ADC #$06
ASC1 ADC #$3A
RTS
T2T2 LDX #2
T2T21 LDA TMP0-1,X
PHA
LDA TMP2-1,X
STA TMP0-1,X
PLA
STA TMP2-1,X
DEX
BNE T2T21
RTS
;READ HEX ADR,RETURN HI IN TMP0,
;LO IN TMPO+1,AND CY=1
;IF SP CY=0
RDOA JSR RDOB ;READ 2-CHAR BYTE
BCC RDOA2 ;SPACE
STA TMP0+1
RDOA2 JSR RDOB
BCC RDEXIT ;SP
STA TMP0
RDEXIT RTS
;READ HEX BYTE AND RETURN IN A
;AND CY=1 IF SP CY=0
RDOB LDA #0 ;SPACE
STA BAD ;READ NEXT CHAR
JSR RDOC
RDOB1 CMP #'
BNE RDOB2
JSR RDOC ;READ NEXT CHAR
CMP #'
BNE RDOB3
CLC ;CY=0
RTS
RDOB2 JSR HEXIT ;TO HEX
ASL A
ASL A
ASL A
ASL A
STA BAD
JSR RDOC ;2ND CHAR ASSUMED HEX
RDOB3 JSR HEXIT
ORA BAD
SEC ;CY=1
RTS
HEXIT CMP #$3A
PHP ;SAVE FLAGS
AND #$0F
PLP
BCC HEX09 ;0-9
ADC #8 ;ALPHA ADD 8+CY=9
HEX09 RTS
RDOC JSR KBASIN ;READ CHAR
CMP #$0D ;IS IT A CR
BNE HEX09 ;NO,RTS
PLA
PLA ;YES, CLEAN STACK,EXIT
; JMP STRT
JMP LFD54
ERROPR LDA #$3F
JSR KBSOUT
JMP STRT
.FIL OB1SRC