2020-12-27 01:22:18 +00:00
|
|
|
%import test_stack
|
|
|
|
%import textio
|
2021-01-03 01:45:25 +00:00
|
|
|
%zeropage basicsafe
|
2020-12-08 00:02:38 +00:00
|
|
|
%option no_sysinit
|
|
|
|
|
2020-12-08 21:54:20 +00:00
|
|
|
main {
|
2020-12-21 23:59:07 +00:00
|
|
|
|
2020-12-22 04:43:02 +00:00
|
|
|
sub start () {
|
2021-01-05 22:19:37 +00:00
|
|
|
str[] binstrings = [
|
|
|
|
"",
|
|
|
|
"%",
|
|
|
|
"%0",
|
|
|
|
"$0",
|
|
|
|
"%1",
|
|
|
|
"101",
|
|
|
|
"%11111111",
|
|
|
|
"%1111 ",
|
|
|
|
"% 1111 ",
|
|
|
|
"%1111%",
|
|
|
|
"%1111)",
|
|
|
|
"%1111,",
|
|
|
|
"%1111.",
|
|
|
|
"%1111foo",
|
|
|
|
"%1111000010101010",
|
|
|
|
"%1111000010101010111"
|
|
|
|
]
|
|
|
|
str[] hexstrings = [
|
|
|
|
"",
|
|
|
|
"$",
|
|
|
|
"$0",
|
|
|
|
"%0",
|
|
|
|
"$1",
|
|
|
|
"$9",
|
|
|
|
"9934",
|
|
|
|
"$91",
|
|
|
|
"$91 ",
|
|
|
|
"$ 91 ",
|
|
|
|
"$12ae$",
|
|
|
|
"$12ae)",
|
|
|
|
"$12ae,",
|
|
|
|
"$12ae.",
|
|
|
|
"$12aez00",
|
|
|
|
"$12345"
|
|
|
|
]
|
|
|
|
str[] posdecstrings = [
|
|
|
|
"",
|
|
|
|
"0",
|
|
|
|
"1",
|
|
|
|
"9",
|
|
|
|
"$9",
|
|
|
|
"10",
|
|
|
|
"11",
|
|
|
|
"123",
|
|
|
|
"255",
|
|
|
|
"62221",
|
|
|
|
"42 ",
|
|
|
|
" 42 ",
|
|
|
|
"42$",
|
|
|
|
"42)",
|
|
|
|
"42,",
|
|
|
|
"42.",
|
|
|
|
"42aaaa"
|
|
|
|
]
|
|
|
|
str[] worddecstrings = [
|
|
|
|
"",
|
|
|
|
"0",
|
|
|
|
"1",
|
|
|
|
"9",
|
|
|
|
"$9",
|
|
|
|
"10",
|
|
|
|
"11",
|
|
|
|
"123",
|
|
|
|
"255",
|
|
|
|
"62221",
|
|
|
|
"42 ",
|
|
|
|
" 42 ",
|
|
|
|
"42$",
|
|
|
|
"42)",
|
|
|
|
"42,",
|
|
|
|
"42.",
|
|
|
|
"42aaaa",
|
|
|
|
"-",
|
|
|
|
"-0",
|
|
|
|
"-1",
|
|
|
|
"-9",
|
|
|
|
"$9",
|
|
|
|
"-10",
|
|
|
|
"-11",
|
|
|
|
"-123",
|
|
|
|
"-255",
|
|
|
|
"-62221",
|
|
|
|
"-32221",
|
|
|
|
"-42 ",
|
|
|
|
"- 42 ",
|
|
|
|
"-42-",
|
|
|
|
"-42$",
|
|
|
|
"-42)",
|
|
|
|
"-42,",
|
|
|
|
"-42.",
|
|
|
|
"-42aaaa"
|
|
|
|
]
|
|
|
|
|
|
|
|
uword value
|
|
|
|
word wvalue
|
|
|
|
uword strptr
|
|
|
|
for strptr in binstrings {
|
|
|
|
value = conv.bin2uword(strptr)
|
|
|
|
txt.print(strptr)
|
|
|
|
txt.print(" = ")
|
|
|
|
txt.print_uw(value)
|
|
|
|
txt.print(" = ")
|
|
|
|
txt.print_uwbin(value, true)
|
|
|
|
txt.print(" #")
|
|
|
|
txt.print_uw(cx16.r15) ; number of chars processedc
|
|
|
|
txt.chrout('\n')
|
|
|
|
}
|
|
|
|
|
|
|
|
txt.chrout('\n')
|
|
|
|
for strptr in hexstrings {
|
|
|
|
value = conv.hex2uword(strptr)
|
|
|
|
txt.print(strptr)
|
|
|
|
txt.print(" = ")
|
|
|
|
txt.print_uw(value)
|
|
|
|
txt.print(" = ")
|
|
|
|
txt.print_uwhex(value, true)
|
|
|
|
txt.print(" #")
|
|
|
|
txt.print_uw(cx16.r15) ; number of chars processedc
|
|
|
|
txt.chrout('\n')
|
|
|
|
}
|
|
|
|
|
|
|
|
txt.chrout('\n')
|
|
|
|
for strptr in posdecstrings {
|
|
|
|
value = conv.str2uword(strptr)
|
|
|
|
txt.print(strptr)
|
|
|
|
txt.print(" = ")
|
|
|
|
txt.print_uw(value)
|
|
|
|
txt.print(" #")
|
|
|
|
txt.print_uw(cx16.r15) ; number of chars processedc
|
|
|
|
txt.chrout('\n')
|
|
|
|
}
|
2021-01-05 00:41:32 +00:00
|
|
|
|
2021-01-05 22:19:37 +00:00
|
|
|
txt.chrout('\n')
|
|
|
|
for strptr in worddecstrings {
|
|
|
|
wvalue = conv.str2word(strptr)
|
|
|
|
txt.print(strptr)
|
|
|
|
txt.print(" = ")
|
|
|
|
txt.print_w(wvalue)
|
|
|
|
txt.print(" #")
|
|
|
|
txt.print_uw(cx16.r15) ; number of chars processedc
|
|
|
|
txt.chrout('\n')
|
|
|
|
}
|
2020-12-31 15:46:24 +00:00
|
|
|
|
|
|
|
|
2021-01-02 16:50:08 +00:00
|
|
|
; found = strfind("irmen de jong", ' ')
|
|
|
|
; txt.print_uwhex(found, 1)
|
|
|
|
; txt.chrout('\n')
|
|
|
|
; found = strfind(" irmen-de-jong", ' ')
|
|
|
|
; txt.print_uwhex(found, 1)
|
|
|
|
; txt.chrout('\n')
|
|
|
|
; found = strfind("irmen-de-jong ", ' ')
|
|
|
|
; txt.print_uwhex(found, 1)
|
|
|
|
; txt.chrout('\n')
|
|
|
|
; found = strfind("irmen-de-jong", ' ')
|
|
|
|
; txt.print_uwhex(found, 1)
|
|
|
|
; txt.chrout('\n')
|
|
|
|
|
|
|
|
; found = strfinds("irmen de jong", "de")
|
|
|
|
; txt.print_uwhex(found, 1)
|
|
|
|
; txt.chrout('\n')
|
|
|
|
; found = strfinds("irmen de jong", "irmen")
|
|
|
|
; txt.print_uwhex(found, 1)
|
|
|
|
; txt.chrout('\n')
|
|
|
|
; found = strfinds("irmen de jong", "jong")
|
|
|
|
; txt.print_uwhex(found, 1)
|
|
|
|
; txt.chrout('\n')
|
|
|
|
; found = strfinds("irmen de jong", "de456")
|
|
|
|
; txt.print_uwhex(found, 1)
|
|
|
|
; txt.chrout('\n')
|
2020-12-31 15:46:24 +00:00
|
|
|
}
|
2020-08-27 17:47:50 +00:00
|
|
|
}
|