examples/lib/oneof.xyw
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
; Checks if char in a is one of chars in s2
; a s2 -> f
.label oneof
POPyw
POPxw
.label oneof.loop
; if at end of string, then no char is matching
LDByw $00 EQU oneof.fail JCNw
; if char matches, ok
LDBxyw EQU oneof.ok JCNw
INCyw oneof.loop JMPw
.label oneof.fail
$00 RTS
.label oneof.ok
$01 RTS
|