8086: implement stack overflow error condition

Also, remove RSP underflow check from next for the same reason as
in the previous commit in z80.
This commit is contained in:
Virgil Dupras 2020-08-08 10:18:43 -04:00
parent 5adbf88591
commit c4db9d4420
3 changed files with 11 additions and 9 deletions

View File

@ -2,7 +2,8 @@ H@ ORG ! ( STABLE ABI )
0 JP, ( 00, main ) NOP, ( unused ) NOP, NOP, ( 04, BOOT )
NOP, NOP, ( 06, uflw ) NOP, NOP, ( 08, LATEST ) NOP, ( unused )
0 A, 0 JP, ( 0b, EXIT ) NOP, ( unused )
0 JP, ( RST 10 ) NOP, NOP, NOP, NOP, NOP, NOP, NOP, ( unused )
0 JP, ( RST 10 ) NOP, NOP, ( 13, oflw )
NOP, NOP, NOP, NOP, NOP, ( unused )
0 JP, ( 1a, next ) NOP, NOP, NOP, ( unused )
0 JP, ( RST 20 ) 0 A, 0 JP, ( 23, (n) ) NOP, ( unused )
0 JP, ( RST 28 ) 0 A, 0 JP, ( 2b, (s) ) NOP, ( unused )

View File

@ -2,10 +2,10 @@ VARIABLE lblexec VARIABLE lblnext
H@ ORG !
JMPn, 0 A,, ( 00, main ) 0 A, ( 03, boot driveno )
0 A,, ( 04, BOOT )
0 A,, ( 06, uflw ) 0 A,, ( 08, LATEST ) 0 A, ( unused )
0 A, JMPn, 0 A,, ( unused )
0 A,, ( unused ) JMPn, 0 A,, ( unused )
JMPn, 0 A,, ( unused ) 0 A, 0 A,, ( unused )
0 A,, ( 06, uflw ) 0 A,, ( 08, LATEST ) 0 A,, ( unused )
JMPn, 0 A,, ( 0b, EXIT )
0 A,, 0 A,, ( unused ) 0 A,, ( 13, oflw )
0 A,, 0 A,, 0 A, ( unused )
JMPn, 0 A,, ( 1a, next ) 0 A,, 0 A,, 0 A,, ( unused )
0 A, JMPn, 0 A,, ( 23, (n) )
0 A,, 0 A,, ( unused )

View File

@ -1,8 +1,9 @@
lblnext BSET PC 0x1d - ORG @ 0x1b + ! ( next )
( RSP check )
AX RS_ADDR MOVxI, BP AX CMPxx,
IFC, ( BP < RS_ADDR )
DI 0x06 MOVxm, JMPs, L1 FWRs ( execute )
( ovfl check )
BP SP CMPxx,
IFNC, ( BP >= SP )
SP PS_ADDR MOVxI, BP RS_ADDR MOVxI,
DI 0x13 ( oflw ) MOVxm, JMPs, L1 FWRs ( execute )
THEN,
DI DX MOVxx, ( <-- IP ) DX INCx, DX INCx,
DI [DI] MOVx[], ( wordref )