We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 00a267b commit 2d47fe5Copy full SHA for 2d47fe5
1 file changed
src/vars.asm
@@ -56,23 +56,16 @@ var_namelen= len
56
; Checks if a character is valid for a variable name
57
.proc check_char
58
cmp #'0'
59
- bcc bad_char
+ bcc ret_sec
60
cmp #'9'+1
61
bcc exit
62
first:
63
cmp #'_'
64
- beq char_ok
65
- cmp #'A'
66
67
- cmp #'Z'+1
+ beq ret_clc
+ sbc #'A'-1
+ cmp #26
68
exit:
69
rts
70
-bad_char:
71
- sec
72
- rts
73
-char_ok:
74
- clc
75
76
.endproc
77
78
; Search the list of variables by name,
@@ -117,6 +110,7 @@ cmp_loop:
117
110
118
111
found:
119
112
lda (var), y
113
+::ret_clc:
120
114
clc
121
115
122
116
@@ -153,7 +147,8 @@ search_start:
153
147
cpx #0
154
148
bne search_loop
155
149
156
-not_found:
150
+ ; Variable name not found, exit with C=1
151
+::ret_sec:
157
152
sec
158
159
0 commit comments