prog8/compiler/examples/test.p8

87 lines
2.1 KiB
Plaintext
Raw Normal View History

%import c64utils
;%import mathlib
;%option enable_floats
2018-10-16 00:26:35 +00:00
~ main {
2018-11-11 17:19:08 +00:00
;@todo implement the various byte/word division routines.
;c64scr.PLOT(screenx(x), screeny(y)) ; @todo fix argument calculation of parameters ???!!!
sub start() {
2018-12-20 22:28:03 +00:00
c64scr.print(" X=")
c64scr.print_ub(X)
c64.CHROUT('\n')
word w = c64utils.str2word("000")
c64scr.print_w(w)
c64.CHROUT('\n')
w = c64utils.str2word("1")
c64scr.print_w(w)
c64.CHROUT('\n')
w = c64utils.str2word("-15000")
c64scr.print_w(w)
c64.CHROUT('\n')
w = c64utils.str2word("15000")
c64scr.print_w(w)
c64.CHROUT('\n')
c64.CHROUT('\n')
uword uw = c64utils.str2uword("0")
c64scr.print_uw(uw)
c64.CHROUT('\n')
uw = c64utils.str2uword("1")
c64scr.print_uw(uw)
c64.CHROUT('\n')
uw = c64utils.str2uword("15000")
c64scr.print_uw(uw)
c64.CHROUT('\n')
uw = c64utils.str2uword("65522")
c64scr.print_uw(uw)
2018-12-21 22:10:45 +00:00
c64.CHROUT('\n')
c64.CHROUT('\n')
byte b = c64utils.str2byte("0")
c64scr.print_b(b)
c64.CHROUT('\n')
b=c64utils.str2byte("10")
c64scr.print_b(b)
c64.CHROUT('\n')
b=c64utils.str2byte("-10")
c64scr.print_b(b)
c64.CHROUT('\n')
b=c64utils.str2byte("-128")
c64scr.print_b(b)
c64.CHROUT('\n')
b=c64utils.str2byte("127")
c64scr.print_b(b)
2018-12-20 22:28:03 +00:00
c64.CHROUT('\n')
c64.CHROUT('\n')
2018-12-21 22:10:45 +00:00
ubyte ub = c64utils.str2ubyte("0")
c64scr.print_ub(ub)
c64.CHROUT('\n')
ub=c64utils.str2ubyte("10")
c64scr.print_ub(ub)
c64.CHROUT('\n')
ub=c64utils.str2ubyte("10")
c64scr.print_ub(ub)
c64.CHROUT('\n')
ub=c64utils.str2ubyte("128")
c64scr.print_ub(ub)
c64.CHROUT('\n')
ub=c64utils.str2ubyte("255")
c64scr.print_ub(ub)
c64.CHROUT('\n')
2018-12-21 20:43:35 +00:00
c64.CHROUT('\n')
2018-12-18 00:43:04 +00:00
2018-12-21 00:06:01 +00:00
c64scr.print(" X=")
c64scr.print_ub(X)
c64.CHROUT('\n')
2018-12-18 00:43:04 +00:00
}
}
2018-12-12 00:13:13 +00:00