remove stack error comments

This commit is contained in:
Irmen de Jong 2020-03-13 00:50:50 +01:00
parent 7fbe486dff
commit 2af86a10b2
12 changed files with 19 additions and 49 deletions

View File

@ -4,8 +4,7 @@ TODO
- option to load library files from a directory instead of the embedded ones
- exit('message', returncode) function to immediately exit the program with this message (restores stack)
- fix stack clobbering issue in postincr decr (see the arithmetic example of this)
- vector inc/dec/add/sub/lsl/asl/mul/div
- vector inc/dec/add/sub/lsl/asl/mul/div...?
Memory Block Operations integrated in language?

View File

@ -36,7 +36,7 @@ main {
}
sub start() {
; TODO unimplemented()
; TODO call this too: unimplemented()
lsr(A)
lsl(A)

View File

@ -9,27 +9,23 @@ main {
div_ubyte(0, 1, 0)
div_ubyte(100, 6, 16)
div_ubyte(255, 2, 127)
check_eval_stack()
div_byte(0, 1, 0)
div_byte(100, -6, -16)
div_byte(127, -2, -63)
check_eval_stack()
div_uword(0,1,0)
div_uword(40000,500,80)
div_uword(43211,2,21605)
check_eval_stack() ; TODO fix stack error (caused by print_uw)
div_word(0,1,0)
div_word(-20000,500,-40)
div_word(-2222,2,-1111)
check_eval_stack() ; TODO fix stack error (caused by print_w)
div_float(0,1,0)
div_float(999.9,111.0,9.008108108108107)
check_eval_stack() ; TODO should no longer give error once the above is fixed
check_eval_stack()
}
sub div_ubyte(ubyte a1, ubyte a2, ubyte c) {
@ -69,7 +65,7 @@ main {
else
c64scr.print("err! ")
c64scr.print("uword ")
c64scr.print_uw(a1) ; TODO print_uw causes X stack error
c64scr.print_uw(a1)
c64scr.print(" / ")
c64scr.print_uw(a2)
c64scr.print(" = ")
@ -84,7 +80,7 @@ main {
else
c64scr.print("err! ")
c64scr.print("word ")
c64scr.print_w(a1) ; TODO print_w causes X stack error
c64scr.print_w(a1)
c64scr.print(" / ")
c64scr.print_w(a2)
c64scr.print(" = ")

View File

@ -10,20 +10,17 @@ main {
minus_ubyte(200, 0, 200)
minus_ubyte(200, 100, 100)
minus_ubyte(100, 200, 156)
check_eval_stack()
minus_byte(0, 0, 0)
minus_byte(100, 100, 0)
minus_byte(50, -50, 100)
minus_byte(0, -30, 30)
minus_byte(-30, 0, -30)
check_eval_stack()
minus_uword(0,0,0)
minus_uword(50000,0, 50000)
minus_uword(50000,20000,30000)
minus_uword(20000,50000,35536)
check_eval_stack() ; TODO fix stack error
minus_word(0,0,0)
minus_word(1000,1000,0)
@ -31,13 +28,12 @@ main {
minus_word(1000,500,500)
minus_word(0,-3333,3333)
minus_word(-3333,0,-3333)
check_eval_stack() ; TODO fix stack error
minus_float(0,0,0)
minus_float(2.5,1.5,1.0)
minus_float(-1.5,3.5,-5.0)
check_eval_stack() ; TODO fix stack error
check_eval_stack()
}
sub minus_ubyte(ubyte a1, ubyte a2, ubyte c) {

View File

@ -9,29 +9,25 @@ main {
mul_ubyte(0, 0, 0)
mul_ubyte(20, 1, 20)
mul_ubyte(20, 10, 200)
check_eval_stack()
mul_byte(0, 0, 0)
mul_byte(10, 10, 100)
mul_byte(5, -5, -25)
mul_byte(0, -30, 0)
check_eval_stack()
mul_uword(0,0,0)
mul_uword(50000,1, 50000)
mul_uword(500,100,50000)
check_eval_stack() ; TODO fix stack error
mul_word(0,0,0)
mul_word(-10,1000,-10000)
mul_word(1,-3333,-3333)
check_eval_stack() ; TODO fix stack error
mul_float(0,0,0)
mul_float(2.5,10,25)
mul_float(-1.5,10,-15)
check_eval_stack() ; TODO fix stack error
check_eval_stack()
}
sub mul_ubyte(ubyte a1, ubyte a2, ubyte c) {

View File

@ -10,36 +10,28 @@ main {
plus_ubyte(0, 200, 200)
plus_ubyte(100, 200, 44)
check_eval_stack()
plus_byte(0, 0, 0)
plus_byte(-100, 100, 0)
plus_byte(-50, 100, 50)
plus_byte(0, -30, -30)
plus_byte(-30, 0, -30)
check_eval_stack()
plus_uword(0,0,0)
plus_uword(0,50000,50000)
plus_uword(50000,20000,4464)
check_eval_stack() ; TODO fix stack error caused by print_uw
plus_word(0,0,0)
plus_word(-1000,1000,0)
plus_word(-500,1000,500)
plus_word(0,-3333,-3333)
plus_word(-3333,0,-3333)
check_eval_stack() ; TODO fix stack error caused by print_w
plus_float(0,0,0)
plus_float(1.5,2.5,4.0)
plus_float(-1.5,3.5,2.0)
plus_float(-1.1,3.3,2.2)
check_eval_stack() ; TODO should no longer give error if the above is fixed
check_eval_stack()
}
sub plus_ubyte(ubyte a1, ubyte a2, ubyte c) {
@ -79,7 +71,7 @@ main {
else
c64scr.print("err! ")
c64scr.print("uword ")
c64scr.print_uw(a1) ; TODO causes X stack error
c64scr.print_uw(a1)
c64scr.print(" + ")
c64scr.print_uw(a2)
c64scr.print(" = ")
@ -94,7 +86,7 @@ main {
else
c64scr.print("err! ")
c64scr.print("word ")
c64scr.print_w(a1) ; TODO causes X stack error
c64scr.print_w(a1)
c64scr.print(" + ")
c64scr.print_w(a2)
c64scr.print(" = ")

View File

@ -32,8 +32,6 @@ main {
warr[1]++
flarr[1] ++
check_eval_stack()
check_ub(ub, 201)
Y=100
Y++
@ -53,8 +51,6 @@ main {
check_uw(uwarr[1], 2001)
check_w(warr[1], -999)
check_eval_stack()
c64scr.print("--\n")
ub--
bb--
@ -68,8 +64,6 @@ main {
flarr[1] --
check_ub(ub, 200)
check_eval_stack()
Y=100
Y--
check_ub(Y, 99)
@ -148,11 +142,10 @@ main {
sub check_eval_stack() {
if X!=255 {
c64scr.print("x=")
c64scr.print_ub(X)
if X==255
c64scr.print(" ok\n")
else
c64scr.print(" error!\n")
}
}
}

View File

@ -11,14 +11,12 @@ main {
remainder_ubyte(255, 2, 1)
remainder_ubyte(255, 20, 15)
check_eval_stack()
remainder_uword(0,1,0)
remainder_uword(40000,511,142)
remainder_uword(40000,500,0)
remainder_uword(43211,12,11)
check_eval_stack() ; TODO fix stack error
check_eval_stack()
}
sub remainder_ubyte(ubyte a1, ubyte a2, ubyte c) {

View File

@ -16,7 +16,7 @@ main {
c64.CHROUT('\n')
}
check_eval_stack() ; TODO fix stack error
check_eval_stack()
}
sub fib_setup() {

View File

@ -30,7 +30,7 @@ main {
c64scr.print("reversed\n")
print_arrays()
check_eval_stack() ; TODO fix stack error
check_eval_stack()
return

View File

@ -40,7 +40,7 @@ newgame:
spawnNextBlock()
waitkey:
check_eval_stack() ; TODO fix stack error
check_eval_stack()
if c64.TIME_LO>=(60-4*speedlevel) {
c64.TIME_LO = 0

View File

@ -58,7 +58,7 @@ main {
c64scr.print_w(-0)
c64.CHROUT('\n')
check_eval_stack() ; TODO fix stack error
check_eval_stack()
}