mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-04-07 01:38:18 +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
|
||||
if nextop->opcode == SHL_CODE
|
||||
op->opcode = DUP_CODE
|
||||
nextop->opcode = ADD_CODE
|
||||
op->opgroup = STACK_GROUP
|
||||
nextop->opcode = ADD_CODE
|
||||
break
|
||||
fin
|
||||
if nextop->opcode == MUL_CODE or nextop->opcode == DIV_CODE
|
||||
@ -270,13 +270,14 @@ def crunch_seq(seq, pass)
|
||||
is MUL_CODE
|
||||
if op=>opval == 0
|
||||
op->opcode = DROP_CODE
|
||||
op->opgroup = STACK_GROUP
|
||||
nextop->opcode = CONST_CODE
|
||||
nextop->opval = 0
|
||||
nextop->opgroup = CONST_GROUP
|
||||
nextop=>opval = 0
|
||||
elsif op=>opval == 2
|
||||
op->opcode = DUP_CODE
|
||||
nextop->opcode = ADD_CODE
|
||||
op->opgroup = STACK_GROUP
|
||||
nextop->opcode = ADD_CODE
|
||||
else
|
||||
for shiftcnt = 2 to 15
|
||||
if op=>opval == 1 << shiftcnt
|
||||
|
@ -638,12 +638,12 @@ _DIV STY IPY
|
||||
LDY #$11 ; #BITS+1
|
||||
LDX #$00
|
||||
LDA NOS+2,S ; WE JSR'ED HERE SO OFFSET ACCORDINGLY
|
||||
BEQ _DIVEX
|
||||
BPL +
|
||||
LDX #$81
|
||||
EOR #$FFFF
|
||||
INC
|
||||
+ STA TMP ; NOS,S
|
||||
BEQ _DIVEX
|
||||
LDA TOS+2,S
|
||||
BPL +
|
||||
INX
|
||||
|
Loading…
x
Reference in New Issue
Block a user