home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HyperLib 1997 Winter - Disc 1
/
HYPERLIB-1997-Winter-CD1.ISO.7z
/
HYPERLIB-1997-Winter-CD1.ISO
/
オンラインウェア
/
UTIL
/
ForcePRAM.sit
/
ForceMode32.a
< prev
next >
Wrap
Text File
|
1994-03-01
|
2KB
|
54 lines
Title 'Force 32-bit addressing to a known state' ;
*
* Module for "Force" shell.
* Ben Cranston March 1, 1994
*
Print Off ; Here be includes
Include 'Traps.a' ;
Print On,NoGen ; Here be includes
Main ; Begin module
*
Sub.L #2,A7 ; Make two bytes on stack
Tst.L D1 ; Did we get a data resource?
BEq.S @999 ; If not then get out
Move.L D1,A0 ; Get handle
Move.L (A0),A0 ; Get pointer
Move.B 1(A0),1(A7) ; Get flag
*
* Get current PRAM contents, decide if we have to reset and reboot.
*
Move.L #$0001008A,D0 ; Byte 8A
Move.L A7,A0 ; Point to stack space
_ReadXPram ; Read current from parameter RAM
BEq.S @010 ; If no error then skip
Clr.L D0 ; Else set no reboot
Bra.S @999 ; Return to driver
*
@010 ;
Move.B #5,D1 ; Get value for 32 bit addressing on
Tst.B 1(A7) ; Did he want it on?
BNE.S @020 ; Yes, skip this
Clr.B D1 ; Else set value for 24 bit addressing
@020 ;
Move.B (A7),D2 ; Get current value
And.B #$0F,D2 ; Get just our bits
Cmp.B D1,D2 ; Is it set correctly?
BEq.S @999 ; Yes, no need to change things
*
* Write desired contents to PRAM and force reboot.
*
Move.B (A7),D2 ; Get current value
And.B #$F0,D2 ; Keep upper bits
Or.B D1,D2 ; Set desired lower bits
Move.B D2,(A7) ; Set desired value
Move.L A7,A0 ; Point to stack space
Move.L #$0001008A,D0 ; Byte 8A
_WriteXPram ; Write back to parameter RAM
Move.L #1,D0 ; Set flat to force reboot
@999 ;
Add.L #2,A7 ; Drop local frame
RTS ; Return to driver
*
EndMain ; Keep MPW happy
End ; ForceMode32.a