mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-04-05 03:37:43 +00:00
Fix immediate value loads
This commit is contained in:
parent
cb7f86a911
commit
71d17a99e4
@ -353,7 +353,7 @@ def compiler(defptr)#0
|
||||
is $42
|
||||
puts("ISNE")
|
||||
^codeptr = $A0; codeptr++ // LDY #imm
|
||||
^codeptr = $00; codeptr++ // $FF
|
||||
^codeptr = $FF; codeptr++ // $FF
|
||||
^codeptr = $B5; codeptr++ // LDA zp,X
|
||||
^codeptr = $D0+1; codeptr++ // ESTKL+1
|
||||
^codeptr = $D5; codeptr++ // CMP zp,X
|
||||
@ -376,7 +376,7 @@ def compiler(defptr)#0
|
||||
is $44
|
||||
puts("ISGT")
|
||||
^codeptr = $A0; codeptr++ // LDY #imm
|
||||
^codeptr = $00; codeptr++ // $FF
|
||||
^codeptr = $FF; codeptr++ // $FF
|
||||
^codeptr = $B5; codeptr++ // LDA zp,X
|
||||
^codeptr = $D0; codeptr++ // ESTKL
|
||||
^codeptr = $D5; codeptr++ // CMP zp,X
|
||||
@ -401,7 +401,7 @@ def compiler(defptr)#0
|
||||
is $46
|
||||
puts("ISLT")
|
||||
^codeptr = $A0; codeptr++ // LDY #imm
|
||||
^codeptr = $00; codeptr++ // $FF
|
||||
^codeptr = $FF; codeptr++ // $FF
|
||||
^codeptr = $B5; codeptr++ // LDA zp,X
|
||||
^codeptr = $D0+1; codeptr++ // ESTKL+1
|
||||
^codeptr = $D5; codeptr++ // CMP zp,X
|
||||
@ -426,7 +426,7 @@ def compiler(defptr)#0
|
||||
is $48
|
||||
puts("ISGE")
|
||||
^codeptr = $A0; codeptr++ // LDY #imm
|
||||
^codeptr = $00; codeptr++ // $FF
|
||||
^codeptr = $FF; codeptr++ // $FF
|
||||
^codeptr = $B5; codeptr++ // LDA zp,X
|
||||
^codeptr = $D0+1; codeptr++ // ESTKL+1
|
||||
^codeptr = $D5; codeptr++ // CMP zp,X
|
||||
@ -451,7 +451,7 @@ def compiler(defptr)#0
|
||||
is $4A
|
||||
puts("ISLE")
|
||||
^codeptr = $A0; codeptr++ // LDY #imm
|
||||
^codeptr = $00; codeptr++ // $FF
|
||||
^codeptr = $FF; codeptr++ // $FF
|
||||
^codeptr = $B5; codeptr++ // LDA zp,X
|
||||
^codeptr = $D0; codeptr++ // ESTKL
|
||||
^codeptr = $D5; codeptr++ // CMP zp,X
|
||||
@ -671,10 +671,6 @@ def compiler(defptr)#0
|
||||
^codeptr = $C0-1; codeptr++ // ESTKH-1
|
||||
^codeptr = $95; codeptr++ // STA zp,X
|
||||
^codeptr = $D0; codeptr++ // ESTKL
|
||||
^codeptr = $A9; codeptr++ // LDA #imm
|
||||
^codeptr = $00; codeptr++ // $00
|
||||
^codeptr = $95; codeptr++ // STA zp,X
|
||||
^codeptr = $C0; codeptr++ // ESTKH
|
||||
^codeptr = $F6; codeptr++ // INC zp,X
|
||||
^codeptr = $C0-1; codeptr++ // ESTKH-1
|
||||
^codeptr = $D0; codeptr++ // BNE rel
|
||||
@ -697,7 +693,7 @@ def compiler(defptr)#0
|
||||
^codeptr = $95; codeptr++ // STA zp,X
|
||||
^codeptr = $D0; codeptr++ // ESTKL
|
||||
^codeptr = $A9; codeptr++ // LDA #imm
|
||||
^codeptr = $FF; codeptr++ // $00
|
||||
^codeptr = $00; codeptr++ // $00
|
||||
^codeptr = $95; codeptr++ // STA zp,X
|
||||
^codeptr = $C0; codeptr++ // ESTKH
|
||||
break
|
||||
@ -726,7 +722,7 @@ def compiler(defptr)#0
|
||||
^codeptr = $95; codeptr++ // STA zp,X
|
||||
^codeptr = $D0; codeptr++ // ESTKL
|
||||
^codeptr = $A9; codeptr++ // LDA #imm
|
||||
^codeptr = $FF; codeptr++ // $00
|
||||
^codeptr = $00; codeptr++ // $00
|
||||
^codeptr = $95; codeptr++ // STA zp,X
|
||||
^codeptr = $C0; codeptr++ // ESTKH
|
||||
i++
|
||||
@ -1191,13 +1187,13 @@ def compiler(defptr)#0
|
||||
^codeptr = $30; codeptr++ // BMI rel
|
||||
^codeptr = $03; codeptr++ // +3
|
||||
^codeptr = $4C; codeptr++ // JMP abs
|
||||
^codeptr = $E8; codeptr++ // INX
|
||||
^codeptr = $E8; codeptr++ // INX
|
||||
*codeptr = addrxlate=>[dest]
|
||||
if not (*codeptr & $8000) // Unresolved address list
|
||||
addrxlate=>[dest] = codeptr - *jitcodeptr
|
||||
fin
|
||||
codeptr = codeptr + 2
|
||||
^codeptr = $E8; codeptr++ // INX
|
||||
^codeptr = $E8; codeptr++ // INX
|
||||
break
|
||||
is $A6
|
||||
i++
|
||||
@ -1239,13 +1235,13 @@ def compiler(defptr)#0
|
||||
^codeptr = $30; codeptr++ // BMI rel
|
||||
^codeptr = $03; codeptr++ // +3
|
||||
^codeptr = $4C; codeptr++ // JMP abs
|
||||
^codeptr = $E8; codeptr++ // INX
|
||||
^codeptr = $E8; codeptr++ // INX
|
||||
*codeptr = addrxlate=>[dest]
|
||||
if not (*codeptr & $8000) // Unresolved address list
|
||||
addrxlate=>[dest] = codeptr - *jitcodeptr
|
||||
fin
|
||||
codeptr = codeptr + 2
|
||||
^codeptr = $E8; codeptr++ // INX
|
||||
^codeptr = $E8; codeptr++ // INX
|
||||
break
|
||||
is $A8
|
||||
i++
|
||||
@ -1281,13 +1277,13 @@ def compiler(defptr)#0
|
||||
^codeptr = $30; codeptr++ // BMI rel
|
||||
^codeptr = $03; codeptr++ // +3
|
||||
^codeptr = $4C; codeptr++ // JMP abs
|
||||
^codeptr = $E8; codeptr++ // INX
|
||||
^codeptr = $E8; codeptr++ // INX
|
||||
*codeptr = addrxlate=>[dest]
|
||||
if not (*codeptr & $8000) // Unresolved address list
|
||||
addrxlate=>[dest] = codeptr - *jitcodeptr
|
||||
fin
|
||||
codeptr = codeptr + 2
|
||||
^codeptr = $E8; codeptr++ // INX
|
||||
^codeptr = $E8; codeptr++ // INX
|
||||
break
|
||||
is $AA
|
||||
i++
|
||||
@ -1329,13 +1325,13 @@ def compiler(defptr)#0
|
||||
^codeptr = $30; codeptr++ // BMI rel
|
||||
^codeptr = $03; codeptr++ // +3
|
||||
^codeptr = $4C; codeptr++ // JMP abs
|
||||
^codeptr = $E8; codeptr++ // INX
|
||||
^codeptr = $E8; codeptr++ // INX
|
||||
*codeptr = addrxlate=>[dest]
|
||||
if not (*codeptr & $8000) // Unresolved address list
|
||||
addrxlate=>[dest] = codeptr - *jitcodeptr
|
||||
fin
|
||||
codeptr = codeptr + 2
|
||||
^codeptr = $E8; codeptr++ // INX
|
||||
^codeptr = $E8; codeptr++ // INX
|
||||
break
|
||||
is $AC
|
||||
i++
|
||||
@ -1567,11 +1563,11 @@ def compiler(defptr)#0
|
||||
// Free working bufffers
|
||||
//
|
||||
heaprelease(addrxlate)
|
||||
puts("Done compiling\n")
|
||||
getc
|
||||
puts("Done compiling: $"); puth(defptr=>interpaddr); putln
|
||||
//getc
|
||||
return
|
||||
fin
|
||||
getc
|
||||
//getc
|
||||
loop
|
||||
//
|
||||
// If we got here. we ran out of code buffer space. Overwrite interpreter
|
||||
|
Loading…
x
Reference in New Issue
Block a user