prog8/examples/test.p8

91 lines
1.8 KiB
Plaintext
Raw Normal View History

2019-08-07 00:02:34 +00:00
%import c64lib
2019-08-10 12:20:42 +00:00
%import c64utils
%import c64flt
2019-08-17 23:39:48 +00:00
%zeropage basicsafe
2019-08-09 00:15:31 +00:00
2019-08-07 00:02:34 +00:00
main {
2019-08-19 20:28:41 +00:00
str str1 = "irmen"
str str2 = "test"
str_s strs1 = "irmen"
str_s strs2 = "test"
sub start() {
2019-08-20 22:09:44 +00:00
str str1x = "irmen"
str str2x = "test"
str_s strs1x = "irmen"
str_s strs2x = "test"
2019-08-17 13:28:06 +00:00
2019-08-20 22:09:44 +00:00
c64scr.print(str1)
c64.CHROUT('\n')
c64scr.print(str2)
c64.CHROUT('\n')
c64scr.print(str1x)
c64.CHROUT('\n')
c64scr.print(str2x)
c64.CHROUT('\n')
2019-08-19 20:28:41 +00:00
2019-08-20 22:09:44 +00:00
str1[0]='a'
str2[0]='a'
str1x[0]='a'
str2x[0]='a'
strs1x[0]='a'
strs2x[0]='a'
strs1[0]='a'
strs2[0]='a'
2019-08-19 20:28:41 +00:00
2019-08-20 22:09:44 +00:00
c64scr.print(str1)
c64.CHROUT('\n')
c64scr.print(str2)
c64.CHROUT('\n')
c64scr.print(str1x)
c64.CHROUT('\n')
c64scr.print(str2x)
c64.CHROUT('\n')
byte[] barr = [1,2,3]
word[] warr = [1000,2000,3000]
float[] farr = [1.1, 2.2, 3.3]
byte bb
word ww
float ff
for bb in barr {
c64scr.print_b(bb)
c64.CHROUT(',')
}
c64.CHROUT('\n')
for ww in warr {
c64scr.print_w(ww)
c64.CHROUT(',')
}
c64.CHROUT('\n')
for bb in 0 to len(farr)-1 {
c64flt.print_f(farr[bb])
c64.CHROUT(',')
}
c64.CHROUT('\n')
barr[0] = 99
warr[0] = 99
farr[0] = 99.9
for bb in barr {
c64scr.print_b(bb)
c64.CHROUT(',')
}
c64.CHROUT('\n')
for ww in warr {
c64scr.print_w(ww)
c64.CHROUT(',')
}
c64.CHROUT('\n')
for bb in 0 to len(farr)-1 {
c64flt.print_f(farr[bb])
c64.CHROUT(',')
}
}
}