On 12/24/25 15:01, Robert Armstrong wrote:
Tom Uban <[email protected]> wrote:
Here is the power-up/interrupt code I use on a board I built: ...
   Thanks!  A couple of questions -

   It looks like this code trashes DE, so I assume the background code just 
can't use those registers?  So there's no way to code a truly transparent ISR?

   I also notice that the 8008 lacks any kind of interrupt enable F-F, nor any 
EI/DI type instructions.  Is that right?  I guess you could always implement 
those with external hardware, at least.

   And the big question - what's your code for restoring these flags when you exit 
the ISR?  The MCS-8 manual says that all ALU instructions always update all flags, 
with the exception of the rotate opcodes which only change carry.  It seems that 
means the ZS&P flags at least would have to be restored together in one 
instruction.

Bob


You can find lots of useful info here:

https://www.jkearney.com/Tiny8demo/Datasheets/8008UM.pdf
https://bytecollector.com/archive/mark_8/My_Mark-8_Info/Software/8008_InstructionSet_CodeSort.PDF

You are correct that there has to be a temporary register pair (I use DE).
On my board, the only interrupt is an 8251 serial controller, which has an internal interrupt enable/disable.

intsav: db 0,0,0,0,0,0 ;interrupt save regs A, flags, B, C, H, L

warm:
        lhli (intsav+5) ;point to RAM location used for saving L register
        lem         ;load E register with saved L
        dcl         ;point to H register save location
        ldm         ;load D register with saved H
        dcl         ;point to C register save location
        lcm         ;restore C register
        dcl         ;point to B register save location
        lbm         ;restore B register
        dcl         ;point to flags byte
        lam         ;pickup flag information
        ada         ;restore all flags
        ret         ;return from interrupt

--tom

Reply via email to