|
.title “CONTEXT SAVE/RESTORE on SUBROUTINE or INTERRUPT
CONTEXT_SAVE .macro PSHM AG ;Save 8 guard bits of accA PSHM AH ;Save upper 16 bits of accA PSHM AL ;Save lower 16 bits of accA PSHM BG ;Save 8 guard bits of accB PSHM BH ;Save upper 16 bits of accB PSHM BL ;Save lower 16 bits of accB PSHM TRN ;Save transition register PSHM T ;Save temporary register PSHM AR7 ;Save AR7 PSHM AR6 ;Save AR6 PSHM AR5 ;Save AR5 PSHM AR4 ;Save AR4 PSHM AR3 ;Save AR3 PSHM AR2 ;Save AR2 PSHM AR1 ;Save AR1 PSHM AR0 ;Save AR0 PSHM ST0 ;Save ST0 PSHM ST1 ;Save ST1 PSHM BK ;Save circular size register PSHM IMR ;Save interrupt mask register PSHM BRC ;Save block repeat counter PSHM REA ;Save block repeat end address PSHM RSA ;Save block repeat start address PSHM PMST ;Save PMST register .endm
CONTEXT_RESTORE .macro POPM PMST ;Restore PMST register POPM RSA ;Restore block repeat start address POPM REA ;Restore block repeat end address POPM BRC ;Restore block repeat counter POPM IMR ;Restore interrupt mask register POPM BK ;Restore circular size register POPM ST1 ;Restore ST1 POPM ST0 ;Restore ST0 POPM AR0 ;Restore AR0 POPM AR1 ;Restore AR1 POPM AR2 ;Restore AR2 POPM AR3 ;Restore AR3 POPM AR4 ;Restore AR4 POPM AR5 ;Restore AR5 POPM AR6 ;Restore AR6 POPM AR7 ;Restore AR7 POPM T ;Restore temporary register POPM TRN ;Restore transition register POPM BL ;Restore lower 16 bits of accB POPM BH ;Restore upper 16 bits of accB POPM BG ;Restore 8 guard bits of accB POPM AL ;Restore lower 16 bits of accA POPM AH ;Restore upper 16 bits of accA POPM AG ;Restore 8 guard bits of accA .endm
|