1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-03-22 01:30:45 +00:00

fix opcode skip for CS in branch detection

This commit is contained in:
David Schmenk 2018-04-04 13:25:13 -07:00
parent 9a82e3b5fb
commit 8b649b0d48
4 changed files with 6 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@ -29,7 +29,7 @@ const codemax = $BEE0
const indirectentry = $03DC
const directentry = $03D0
//
//
// Copy bytecode DEF to main memory
//
def defcpy(dst, defptr)#0
*$003C = defptr=>bytecodeaddr

View File

@ -56,12 +56,13 @@ def compiler(defptr)#0
i = 0
while i <= defptr->bytecodesize
if not ^(isdata+i)
when (^(bytecode+i) & $FE)
when ^(bytecode+i) & $FE
//
// Multi-byte operands
//
is $2E // CS
i = i + ^(bytecode+i+1)// + 1
i++
i = i + ^(bytecode+i)
break
//
// Double byte operands
@ -824,7 +825,7 @@ def compiler(defptr)#0
fin
VX-- // DEX
if opcode == $68
//puts("LAB $"); puth(*(bytecode+i))
//puts("LAB $"); puth(dest)
if VY <> 0
*codeptr = $00A0 // LDY #$00
codeptr = codeptr + 2
@ -834,7 +835,7 @@ def compiler(defptr)#0
codeptr = codeptr + 2
else
//puts("LAW $"); puth(dest)
codeptr->0 = $AD // LDA abs
codeptr->0 = $AD // LDA abs+1
codeptr=>1 = dest+1
codeptr=>3 = $C095+(VX<<8) // STA ESTKH,X
codeptr = codeptr + 5