~euhmeuh/ferale

109d81dfbd7a6acac7421e7b0f671c2d6c033c70 — Zoé Martin 9 months ago 1aea1a1
emu: teste l'interruption logicielle (SWI)
1 files changed, 14 insertions(+), 1 deletions(-)

M emu/louve.fs
M emu/louve.fs => emu/louve.fs +14 -1
@@ 217,7 217,7 @@ defer mem!  ( val vaddr -- )
: (DMC)   ( -- )  ;
: (HALT)  ( -- )  true to STOPPED ;
: (RTI)   ( -- )  ISP @ SP !  ISR @ SR !  IPC @ PC ! ;
: (SWI)   ( -- )  A IR !  true to INTLINE ;
: (SWI)   ( -- )  B IR !  true to INTLINE ;
: (INCB)  ( -- )  bank 1+ $F and 8 lshift  SR @ $F0FF and  or SR ! ;
: (DECB)  ( -- )  bank 1- $F and 8 lshift  SR @ $F0FF and  or SR ! ;



@@ 581,6 581,19 @@ RUN
$1234 $FFFF ASSERT-MEM


TEST: ( software interrupt )
$0F08 ,, $0006 ,,  \ MOV $0006,R0
$E200 ,,           \ SWI R0
$0F18 ,, $AAAA ,,  \ MOV $AAAA,R1
$E000 ,,
\ interrupt proc
$0F08 ,, $BBBB ,,  \ MOV $BBBB,R0
$E100 ,,           \ RTI
RUN
0 $BBBB ASSERT-REG
1 $AAAA ASSERT-REG


cpu-reset

." *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*" cr