mirror of
https://github.com/elliotnunn/supermario.git
synced 2024-11-28 13:52:37 +00:00
51 lines
1.3 KiB
Plaintext
51 lines
1.3 KiB
Plaintext
|
;EASE$$$ READ ONLY COPY of file “SetProcessorLevel.a”
|
||
|
; 1.1 CCH 11/10/1988 Fixed Header.
|
||
|
; 1.0 CCH 11/ 9/1988 Adding to EASE.
|
||
|
; OLD REVISIONS BELOW
|
||
|
; 1.0 EMT 3/22/88 First time adding Notification Manager sources
|
||
|
; END EASE MODIFICATION HISTORY
|
||
|
;_______________________________________________________________________
|
||
|
; SetProcessorLevel.a
|
||
|
;
|
||
|
; by Ed Tecot
|
||
|
; Copyright 1987 Apple Computer, Inc.
|
||
|
;
|
||
|
; This file contains two short routines which enable the processor state
|
||
|
; modified from C.
|
||
|
;
|
||
|
; Code by Erich Ringewald.
|
||
|
; Color Commentary by Ed Tecot
|
||
|
;_______________________________________________________________________
|
||
|
|
||
|
CASE OBJ
|
||
|
STRING ASIS
|
||
|
|
||
|
; disable()
|
||
|
; Disables all interrupts by setting the processor state to level 7.
|
||
|
; Returns the current level.
|
||
|
disable PROC EXPORT
|
||
|
|
||
|
MOVEQ #0, D0
|
||
|
MOVE SR, D0 ; Get status register
|
||
|
LSR #8, D0 ; Shift priority into low byte
|
||
|
AND #7, D0 ; Mask out trace/supervisor
|
||
|
ORI #$0700, SR ; Force processor to level 7
|
||
|
RTS
|
||
|
|
||
|
ENDPROC
|
||
|
|
||
|
; spl(level)
|
||
|
; Sets the processor level to its argument.
|
||
|
spl PROC EXPORT
|
||
|
|
||
|
MOVE SR, D0 ; Get status register
|
||
|
MOVE 6(SP), D1 ; Get desired level
|
||
|
LSL #8, D1 ; Put it into high byte
|
||
|
AND #$F8FF, D0 ; Mask out level bytes in SR copy
|
||
|
OR D1, D0 ; And put ours in
|
||
|
MOVE D0, SR ; And set the SR
|
||
|
RTS
|
||
|
|
||
|
ENDPROC
|
||
|
END
|