-
Notifications
You must be signed in to change notification settings - Fork 1
/
FLASHZ.asm
137 lines (136 loc) · 3.46 KB
/
FLASHZ.asm
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
ORG #8000
TABLEUD EQU #A000
LD HL,FILES
LD (HL),5
SELECT XOR A
LD (TABSF),A
LD (TABSF+5),A
LD A,(TABSF+4)
LD HL,FILES
CP (HL)
JR C,SELFILG
LD A,(HL)
SELFILG LD (F_SELF0),A
SELFILF XOR A
LD IX,TABSF
LD (23560),A
CALL INVER_S
SELFI_ LD IX,TABSF
LD HL,23560
LD A,(HL)
AND A
JR Z,SELFI_
LD (HL),0
CP 10 ;Down Key
JR NZ,CSELF1
SELFID0 LD A,0
F_SELF0 EQU $-1
DEC A
CP (IX)
JR Z,SELFID
CALL INVER_S
INC (IX)
INC (IX+5)
JR SELFILF
SELFID LD A,(FIRSTN)
ADD A,10
CP 0 ;All Files
FILES EQU $-1
JR NC,SELFI_
INC (IX+5)
SUB 9
LD (FIRSTN),A
CSELF11 CALL SEARCH
LD DE,#504
PUSH IX
CALL PFILES
LD A,(FIRSTN)
CALL PUDCODE
POP IX
CALL PLENS
JR SELFI_
CSELF1 CP 11 ;Up Key
JR NZ,CSELF2
LD A,(IX)
AND A
JR Z,SELFIU
CALL INVER_S
DEC (IX)
DEC (IX+5)
JR SELFILF
SELFIU LD A,(FIRSTN)
AND A
JR Z,SELFI_
DEC (IX+5)
DEC A
LD (FIRSTN),A
JP CSELF11
CSELF2 CP 13 ;<ENTER> - Select & Exit
JR NZ,CSELF3
CALL INVER_S
LD A,(IX+5)
RET
CSELF3 CP 14 ;<CS>+<SS> - Break & Exit
JP NZ,CSELF33
CALL INVER_S
LD A,#FF
RET
CSELF33 CP #20 ;Metka
JP NZ,SELFI_
LD C,(IX+5)
LD B,0
LD HL,TABUD
ADD HL,BC
LD A,(HL)
CP 32
LD A,#FB
JR Z,CSELF4
LD A,32
CSELF4 LD (HL),A
LD A,(FIRSTN)
CALL PUDCODE
JP SELFID0
;------------------
INVER_S LD A,(IX+2) ;Print Cursor
ADD A,(IX)
LD L,A
LD H,0
ADD HL,HL
ADD HL,HL
ADD HL,HL
ADD HL,HL
ADD HL,HL
LD A,(IX+1)
ADD A,L
LD L,A
LD BC,#5800
ADD HL,BC
LD A,(HL)
XOR #3F
LD (HL),A
LD D,H
LD E,L
INC DE
LD C,(IX+3)
DEC C
LD B,0
LDIR
RET
PUDCODE ;A-Num File
RET
SEARCH ;A-Num File
RET
PFILES ;IX-Addr FileName
;DE-Koor
RET
PLENS ;IX-Addr FileName
RET
FIRSTN DEFB 0 ;First Name
TABSF DEFB 0 ;Num File Cursor
DEFW #502 ;Koor Cursor
DEFB 5 ;Len Cursor
DEFB 10 ;Lines Select
DEFB 0 ;Num File Select
ORG TABLEUD
TABUD DEFS 256
.RUN #8000