1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-07-23 02:29:02 +00:00

Fix CS destination jump

This commit is contained in:
Dave Schmenk 2018-03-27 22:13:58 -07:00
parent 7cd9c00706
commit 5e049ebe8e
2 changed files with 8 additions and 10 deletions

View File

@ -90,7 +90,7 @@ def compiler(defptr)#0
// Multi-byte operands
//
is $2E // CS
i = i + ^(bytecode+i+1) + 1
i = i + ^(bytecode+i+1)// + 1
break
//
// Double byte operands
@ -393,9 +393,9 @@ def compiler(defptr)#0
is $2E // CS
i++
j = ^(bytecode+i)
dest = i + j + 1
dest = codeptr + 10 + j
//puts("CS "); //puts(bytecode+i); //puts("-->"); puti(dest)
if isule(codeptr + 10 + j, codemax)
if isule(dest, codemax)
if A_IS_TOSL & TOSL_DIRTY
*codeptr = $D095+(VX<<8) // STA ESTKL,X
codeptr = codeptr + 2
@ -405,14 +405,12 @@ def compiler(defptr)#0
codeptr=>2 = $C095+(VX<<8) // STA ESTKH,X
codeptr=>4 = $A9+((codeptr+9)<<8) // LDA #<STRING
codeptr->6 = $4C // JMP abs
codeptr=>7 = addrxlate=>[dest]
if not (codeptr->8 & $80) // Unresolved address list
addrxlate=>[dest] = codeptr + 7 - *jitcodeptr
fin
dest = codeptr + 10 + j
codeptr=>7 = dest
strcpy(codeptr + 9, bytecode + i)
i = i + j
fin
codeptr = codeptr + 10 + j
codeptr = dest
A_IS_TOSL = TOSL_DIRTY // STA ESTKL,X
break
is $32 // DROP2
@ -421,7 +419,7 @@ def compiler(defptr)#0
is $30 // DROP
//puts("DROP")
VX++ // INX
A_IS_TOSL = FALSE
A_IS_TOSL = FALSE
break
is $34 // DUP
//puts("DUP")

View File

@ -325,7 +325,7 @@ def nextln
scanptr++
scan
else
if token <> EOL_TKN and token <> EOF_TKN; puti(token&$7F); puts("Extraneous characters\n"); exit_err(0); fin
if token <> EOL_TKN and token <> EOF_TKN; putc(token&$7F); puts("Extraneous characters\n"); exit_err(0); fin
scanptr = inbuff
^instr = fileio:read(refnum, inbuff, 127)
if ^instr