MetalPizzaCat / BOBO

BOBO is BASIC styled languaged that compiles into assembly for i8080. This project is closer to a shitpost then actual languge for i8080
GNU General Public License v2.0
0 stars 0 forks source link

Addition operation uses wrong mov command #3

Open MetalPizzaCat opened 2 years ago

MetalPizzaCat commented 2 years ago
def main
    var b = 2
    var a = b + 0
end

should produce this asm code

        mvi  a, 02
    sta  0810
    lda  0810
    adi  00
;or with mov a,a
    sta  0811
    hlt

but instead produces this, probably due to wrong offset in byte code

        mvi  a, 02
    sta  0810
    lda  0810
    adi  00
    mov  a, b
    sta  0811
    hlt
MetalPizzaCat commented 2 years ago

Closed by mistake

MetalPizzaCat commented 2 years ago

This is caused by ProcessOperation, because = is treated as oepration where left side uses &a and right side uses &b and during preparation phase it calles mov a,b despite result being in &a