This commit is contained in:
Irmen de Jong 2020-03-26 01:20:04 +01:00
parent b734dc44fd
commit 5f3a9e189a
3 changed files with 72 additions and 9 deletions

View File

@ -2,7 +2,7 @@
TODO
====
- fix the invalid assembly generation problem (invalid_assembly.p8)
- fix the invalid assembly generation problem for several direct memory operations (invalid_assembly.p8 / todo.p8)
- implement the asm for bitshift on arrays (last missing assembly code generation)

View File

@ -58,7 +58,7 @@ main {
sub plot(uword px, ubyte py, ubyte color) {
uword addr = 320
A=@(addr) ; TODO invalid assemlby generated lda (addr),y something to do with zeropage allocation????
A=@(addr) ; TODO invalid assemlby generated lda (addr),y something to do with zeropage allocation???? or simply direct memory write/read wrong translations?
@(addr) = A
}

View File

@ -4,21 +4,84 @@
main {
uword[2] array1 = 1
sub start() {
uword addr = $c000
&uword addr2 = $c100
&ubyte addr2 = $c100
; not sure if these are okay:
uword border = $d020
&ubyte borderptr = $d020
; @($d020) = 0
; @(border) = 1
; borderptr=2
; @($d020)+=9
; @($d020)-=9
@(border)+=9 ; TODO fix wrong assembly code
@(border)-=9 ; TODO fix wrong assembly code
; borderptr+=9
; borderptr-=9
@($c000) |= 8 ; ok?
addr2 |= 8 ; ok?
@(addr) |= 8 ; ok?
; TODO Verify memory augmented assignment operations.
addr2 = 0
addr2 |= 128
addr2 |= 8
addr2 |= 2
addr2 |= 2
c64scr.print_ub(addr2)
c64.CHROUT('\n')
if(addr2 != 10) {
c64scr.print("error1\n")
}
addr2 += 1
addr2 *=10
c64scr.print_ub(addr2)
c64.CHROUT('\n')
if(addr2 != 110) {
c64scr.print("error2\n")
}
@($c000) = 0
@($c000) |= 8 ; TODO FIX result of memory-OR/XOR and probably AND as well
@($c000) |= 2 ; TODO FIX result of memory-OR/XOR and probably AND as well
@($c000) |= 2 ; TODO FIX result of memory-OR/XOR and probably AND as well
c64scr.print_ub( @($c000) )
c64.CHROUT('\n')
if(@($c000) != 10) {
c64scr.print("error3\n")
}
@($c000) += 1 ; TODO fix result of memory += 1
@($c000) *=10
c64scr.print_ub( @($c000) )
c64.CHROUT('\n')
if(@($c000) != 110) {
c64scr.print("error4\n")
}
@(addr) = 0
@(addr) |= 128 ; TODO FIX result of memory-OR/XOR and probably AND as well
@(addr) |= 8 ; TODO FIX result of memory-OR/XOR and probably AND as well
@(addr) |= 2 ; TODO FIX result of memory-OR/XOR and probably AND as well
@(addr) |= 2 ; TODO FIX result of memory-OR/XOR and probably AND as well
c64scr.print_ub( @(addr) )
c64.CHROUT('\n')
if(@(addr) != 10) {
c64scr.print("error5\n")
}
@(addr) += 1 ; TODO fix result of memory += 1
@(addr) *= 10
c64scr.print_ub( @(addr) )
c64.CHROUT('\n')
if(@(addr) != 110) {
c64scr.print("error6\n")
}
}
}