2023-03-22 21:00:21 +00:00
|
|
|
|
%import textio
|
2023-05-08 01:30:14 +00:00
|
|
|
|
%import string
|
2023-04-29 15:14:50 +00:00
|
|
|
|
%zeropage basicsafe
|
2023-04-10 14:59:08 +00:00
|
|
|
|
|
2022-10-22 11:33:35 +00:00
|
|
|
|
main {
|
2023-05-07 21:49:02 +00:00
|
|
|
|
|
2023-05-07 23:03:54 +00:00
|
|
|
|
sub start() {
|
2023-05-08 20:26:22 +00:00
|
|
|
|
str output_filename = "12345678\x00abcdefghij"
|
|
|
|
|
void myprint2("hallo", &output_filename+string.length(output_filename))
|
|
|
|
|
; ubyte length = string.length(output_filename)
|
|
|
|
|
; txt.print_ub(length)
|
|
|
|
|
; txt.nl()
|
|
|
|
|
; txt.print_uw(&output_filename)
|
|
|
|
|
; txt.nl()
|
|
|
|
|
; output_filename[2]='!'
|
|
|
|
|
; txt.print(output_filename)
|
|
|
|
|
; txt.nl()
|
|
|
|
|
;
|
|
|
|
|
; void string_copy(".prg", &output_filename + string.length(output_filename))
|
|
|
|
|
; txt.print(output_filename)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sub myprint2(str source1, str source2) {
|
|
|
|
|
txt.print(source1)
|
|
|
|
|
txt.nl()
|
|
|
|
|
txt.print(source2)
|
|
|
|
|
txt.nl()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sub string_copy(str source, str target) -> ubyte {
|
|
|
|
|
; Copy a string to another, overwriting that one.
|
|
|
|
|
; Returns the length of the string that was copied.
|
|
|
|
|
; Often you don’t have to call this explicitly and can just write string1 = string2
|
|
|
|
|
; but this function is useful if you’re dealing with addresses for instance.
|
|
|
|
|
txt.print("src=")
|
|
|
|
|
txt.print(source)
|
|
|
|
|
txt.nl()
|
|
|
|
|
txt.print("target=")
|
|
|
|
|
txt.print(target)
|
|
|
|
|
txt.nl()
|
|
|
|
|
ubyte ix
|
|
|
|
|
repeat 5 {
|
|
|
|
|
ubyte qq=source[ix]
|
|
|
|
|
txt.print_ub(qq)
|
|
|
|
|
target[ix]=qq
|
|
|
|
|
txt.spc()
|
|
|
|
|
if qq==0 {
|
|
|
|
|
txt.nl()
|
|
|
|
|
return ix
|
|
|
|
|
}
|
|
|
|
|
ix++
|
|
|
|
|
}
|
2023-03-18 23:24:05 +00:00
|
|
|
|
}
|
2022-12-04 15:02:58 +00:00
|
|
|
|
}
|
2023-04-29 15:14:50 +00:00
|
|
|
|
|