2020-09-20 21:49:36 +00:00
|
|
|
%import textio
|
2020-02-07 19:47:38 +00:00
|
|
|
%zeropage basicsafe
|
|
|
|
|
2023-06-03 17:14:45 +00:00
|
|
|
; Note: this program can be compiled for multiple target systems.
|
2020-02-07 19:47:38 +00:00
|
|
|
|
|
|
|
main {
|
|
|
|
|
|
|
|
sub start() {
|
|
|
|
|
2020-09-19 20:37:24 +00:00
|
|
|
txt.lowercase()
|
2020-02-07 19:47:38 +00:00
|
|
|
|
2022-02-11 20:56:33 +00:00
|
|
|
str s1 = "HELLO hello 1234 @[/]" ; regular strings have default encoding (petscii on c64)
|
|
|
|
str s2 = sc:"HELLO hello 1234 @[/]" ; alternative encoding (screencodes on c64)
|
2020-02-07 19:47:38 +00:00
|
|
|
|
2020-08-27 16:10:22 +00:00
|
|
|
txt.print("\n\n\n\nString output via print:\n")
|
|
|
|
txt.print("petscii-str: ")
|
|
|
|
txt.print(s1)
|
2020-02-07 19:47:38 +00:00
|
|
|
|
2020-08-27 16:10:22 +00:00
|
|
|
txt.print("\n\nThe top two screen lines are set via screencodes.\n")
|
2020-02-07 19:47:38 +00:00
|
|
|
ubyte i
|
2020-02-08 01:21:18 +00:00
|
|
|
for i in 0 to len(s1)-1
|
2020-09-21 23:34:05 +00:00
|
|
|
txt.setchr(i, 0, s1[i])
|
2020-02-08 01:21:18 +00:00
|
|
|
|
|
|
|
for i in 0 to len(s2)-1
|
2020-09-21 23:34:05 +00:00
|
|
|
txt.setchr(i, 1, s2[i])
|
2020-03-10 23:32:50 +00:00
|
|
|
|
2023-12-28 04:17:15 +00:00
|
|
|
const ubyte c1 = 'z'
|
|
|
|
const ubyte c2 = sc:'z'
|
2020-03-10 23:32:50 +00:00
|
|
|
|
2020-08-27 16:10:22 +00:00
|
|
|
txt.print("\npetscii z=")
|
|
|
|
txt.print_ub(c1)
|
|
|
|
txt.print("\nscreencode z=")
|
|
|
|
txt.print_ub(c2)
|
|
|
|
txt.print("\n")
|
2020-02-07 19:47:38 +00:00
|
|
|
}
|
|
|
|
}
|