mirror of
https://github.com/dschmenk/PLASMA.git
synced 2024-10-18 07:24:16 +00:00
Seriously broken dividing zero by anything
This commit is contained in:
parent
ff3d3c0b87
commit
10a98d5392
@ -81,8 +81,8 @@ def crunch_seq(seq, pass)
|
|||||||
fin
|
fin
|
||||||
if nextop->opcode == SHL_CODE
|
if nextop->opcode == SHL_CODE
|
||||||
op->opcode = DUP_CODE
|
op->opcode = DUP_CODE
|
||||||
nextop->opcode = ADD_CODE
|
|
||||||
op->opgroup = STACK_GROUP
|
op->opgroup = STACK_GROUP
|
||||||
|
nextop->opcode = ADD_CODE
|
||||||
break
|
break
|
||||||
fin
|
fin
|
||||||
if nextop->opcode == MUL_CODE or nextop->opcode == DIV_CODE
|
if nextop->opcode == MUL_CODE or nextop->opcode == DIV_CODE
|
||||||
@ -270,13 +270,14 @@ def crunch_seq(seq, pass)
|
|||||||
is MUL_CODE
|
is MUL_CODE
|
||||||
if op=>opval == 0
|
if op=>opval == 0
|
||||||
op->opcode = DROP_CODE
|
op->opcode = DROP_CODE
|
||||||
|
op->opgroup = STACK_GROUP
|
||||||
nextop->opcode = CONST_CODE
|
nextop->opcode = CONST_CODE
|
||||||
nextop->opval = 0
|
|
||||||
nextop->opgroup = CONST_GROUP
|
nextop->opgroup = CONST_GROUP
|
||||||
|
nextop=>opval = 0
|
||||||
elsif op=>opval == 2
|
elsif op=>opval == 2
|
||||||
op->opcode = DUP_CODE
|
op->opcode = DUP_CODE
|
||||||
nextop->opcode = ADD_CODE
|
|
||||||
op->opgroup = STACK_GROUP
|
op->opgroup = STACK_GROUP
|
||||||
|
nextop->opcode = ADD_CODE
|
||||||
else
|
else
|
||||||
for shiftcnt = 2 to 15
|
for shiftcnt = 2 to 15
|
||||||
if op=>opval == 1 << shiftcnt
|
if op=>opval == 1 << shiftcnt
|
||||||
|
@ -638,12 +638,12 @@ _DIV STY IPY
|
|||||||
LDY #$11 ; #BITS+1
|
LDY #$11 ; #BITS+1
|
||||||
LDX #$00
|
LDX #$00
|
||||||
LDA NOS+2,S ; WE JSR'ED HERE SO OFFSET ACCORDINGLY
|
LDA NOS+2,S ; WE JSR'ED HERE SO OFFSET ACCORDINGLY
|
||||||
BEQ _DIVEX
|
|
||||||
BPL +
|
BPL +
|
||||||
LDX #$81
|
LDX #$81
|
||||||
EOR #$FFFF
|
EOR #$FFFF
|
||||||
INC
|
INC
|
||||||
+ STA TMP ; NOS,S
|
+ STA TMP ; NOS,S
|
||||||
|
BEQ _DIVEX
|
||||||
LDA TOS+2,S
|
LDA TOS+2,S
|
||||||
BPL +
|
BPL +
|
||||||
INX
|
INX
|
||||||
|
Loading…
Reference in New Issue
Block a user