Вы находитесь на странице: 1из 106

CSOS201 IDNT 1,0

NOFORMAT
NOPAGE
OPT A,FRL,BRL,MEX,NOMD,MC
*******************************************************************************
* This code was developed by dis-assembly of IBM INSTRUMENTS CSOS executables.
* CSOS20.BIN, various CSOS v2.0 and CSOS v1.13 utilities and portions of the
* CSOS v1.13 ROM code were used as bases for this version of CSOS v2.01.
*
* To make CSOS v2 more compatible with CSOS v1.13 a number of modifications
* were made: .EXE's load high not low, a `HOT' BOOT mode was added, and
* support for SET SM=nn (via HOT BOOT) was added.
*
* The original code is covered by various copyrights held by IBM.
* The modifications are placed in the public domain.
*
* PORTIONS COPYRIGHT (C) IBM INSTRUMENTS 1984
*
*******************************************************************************
* ORIGINAL block limits are $0000E000 to $00012194
NOLIST
BREAKEXIT MACRO
* CMP.B #$FF,$43B0 CTRL-Break Byte
DC.W $0C38,$00FF CMPI.B #$FF,$43B0 CHECK CTRL-Break BYTE
DC.W $43B0
BNE OVER\@
TRAP #0 SYSCALL
DC.W 43 EXIT
OVER\@ EQU *
ENDM
CMDFMTERR EQU $0FC0FDA
BADCOMMAND EQU $0FC1002
*
START EQU *
H_00E000 MOVEM.L D0/D4-D5/A0-A1/A5-A6,-(A7)
SUBA.L #$14,A7 set up MIB on stack
MOVEA.L A7,A6
MOVE.W #$0000,D7
H_00E014 MOVE.B #$00,0(A6,D7.W)
ADDQ.W #1,D7
H_00E01C CMPI.W #+019,D7
BLE.S H_00E014
MOVEQ #7,D4 INQMEM
MOVE.L #'USRM',D5
TRAP #00 $0 SYSCALL
DC.W $0039 MEM_MGR
BRA.L H_00E032
OS2_HERE LEA V2ALREDY(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0013 PrtErMsg*
ADDA.L #$14,A7
BRA.L H_00E108
H_00E032 CMPI.W #$6005,D7 error - pool does not exist
BNE.S OS2_HERE
* INQ_MEM SYSM POOL
MOVEQ #007,D4 INQMEM
MOVE.L #'SYSM',D5
TRAP #00 $0 SYSCALL
DC.W $0039 MEM_MGR
NOP
NOP
MOVE.L 16(A6),D2 SAVE LARGEST FREE CONTINUOUS IN D2
ADDA.L #$014,A7
H_00E04C TRAP #00 $0 SYSCALL
DC.W $0020 SysLev
CMPI.L #$01010019,D0
BEQ.S H_00E066
LEA OLD_ROMS(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0013 PrtErMsg*
BRA.L H_00E108
H_00E066 BSR.L CLSH
LEA CSOS20MS(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
LEA COPYR_MS(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
MOVEA.L #$00ABCDEF,A0 | supmode
TRAP #05 |
SUBA.L #$014,A7
MOVEA.L A7,A6
MOVE.W #$0000,D0
H_00E08E CLR.B 0(A6,D0.W)
ADDQ.W #1,D0
H_00E094 CMPI.W #+019,D0
BLE.S H_00E08E
LEA END_RES_CODE(PC),A0
LEA BEG_RES_CODE(PC),A1
SUBA.L A1,A0
ADDQ.L #2,A0
ADDA.L #4102,A0 reserve space for system stack
MOVE.L A0,D0
MOVE.L D0,4(A6)
MOVE.L D0,D1
ADD.L #$6000,D1 MAKE SURE ENOUGH LEFT FOR NORMAL OPERATIONS
EXG.L D0,D2 LARGEST FREE CONT. IN D0, SAVE D0 IN D2
CMP.L D0,D1
BCS.S ENUF_MEM ENOUGH MEMORY IN SYSM POOL
ADD.L #1023,D1 D1 HAS NUMBER OF BYTES NEEDED, ROUND UP
LSR.L #8,D1 AND CONVERT TO NUMBER OF 1K BLOCKS NEEDED
LSR.L #2,D1
MOVE.L D1,D0
TRAP #0 SYSCALL
DC.W 53 MODSYSM - ADD BLOCKS TO SYSM
ENUF_MEM MOVE.L D2,D0
MOVEQ #005,D4 GETMEM
MOVE.L #'SYSM',D5
TRAP #00 $0 SYSCALL
DC.W $0039 MEM_MGR
NOP
NOP
*
* BRA.L H_00E0F2 NOT ?? why not ??
LIST
H_00E0BE EQU *
CMPI.W #+000,D7
BNE.S H_00E0F2
MOVE.L 012(A6),D6 -- get start/bottom address of new block
ADDI.L #4096,D6 -- offset 4096 for system stack
AND.L #$0FFFFFC,D6 | ON EVEN ADDRESS (& DIVISIBLE BY FOUR)
*
MOVE.L SSTACK-BEG_RES_CODE,A2 COPY STACK TOP VALUE INTO SSTACK
ADDA.L D6,A2 ACCOUNTING FOR RELOCATION
MOVE.L D6,(A2)
*
MOVE.L D6,A1 -- System Stack top in A1
*
ADDQ.L #4,A1 | 4 byte pad between stack top and code
**
* LEA MOVING(PC),A6
* TRAP #00 $0 SYSCALL
* DC.W $0012 PrtMsg*
* have acquired memory - move the resident
*
LEA END_RES_CODE(PC),A0
MOVE.L A0,D1
LEA BEG_RES_CODE(PC),A0 @E21A
MOVE.L A0,D0
AND.L #$0FFFFFE,D0
SUB.L D0,D1
MOVE.L D0,A0
MOVEQ #000,D0 amount moved so far
MOVE.L #$4E714E71,-4(A1)
*
H_00E0DA MOVE.W 0(A0,D0.L),0(A1,D0.L) new code moves 2 bytes/shot
ADDQ.L #2,D0 doesn't zero source
H_00E0E8 CMP.L D1,D0
BLE.S H_00E0DA *-016
**
* LEA REL_COMP(PC),A6
* TRAP #00 $0 SYSCALL
* DC.W $0012 PrtMsg*
*
LEA BLANK_(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
*
JMP 2(A1) all moved - jump to (relocate) BEG_RES_CODE+2
*
* this is `ordinary' exit -- used if CSOS 2 can't be installed for some reason
*H_00E0EE BRA.S H_00E0FA
H_00E0F2 LEA NO_MEMRY(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0013 PrtErMsg*
*H_00E0FA EQU *
ADDA.L #$014,A7
MOVEA.L #$00FEDCBA,A0
*H_00E106 EQU *
TRAP #05 out of supervisor mode
H_00E108 MOVEM.L (A7)+,D0/D4-D5/A0-A1/A5-A6
RTS
*
* THIS is the `sudden death' exit - for unrecoverable errors
H_00E23E LEA DIE_DIE_(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
TRAP #00 $0 SYSCALL
DC.W $000C PrtErr*
* I/O address $00F0000D is PPI2 Port C - hndshk/status INTEL 8255
H_00E24A BTST #01,$00F0000D Wait for key press ...
BEQ.S H_00E24A
* I/O address $00F0000B is PPI2 Port B - Keyboard I/O m1 INTEL 8255
MOVE.B $00F0000B,D7
BOOT TRAP #00 $0 SYSCALL
DC.W $0030 SUP MODE
BRA.L COLDBOOT
DIE_DIE_ DC.B 'UNRECOVERABLE ERROR! HIT ANY KEY TO COLD START',$D
DS.W 0
*
*
CSOS20MS DC.B 'IBM SYSTEM 9000 CSOS Version 2.01 09/18/87',$D
COPYR_MS DC.B 'Copyright (c) IBM Instruments, Inc. 1984,1987'
BLANK_ DC.B $D
*MOVING DC.B 'Relocating Operating System Code',$D
*REL_COMP DC.B 'Relocation completed.',$D
H_00E16A DC.B 'LICENSED MATERIAL - PROPERTY OF IBM INSTRUMENTS, INC'
NO_MEMRY DC.B 'NOT ENOUGH MEMORY TO INSTALL CSOS 2.0',$D
V2ALREDY DC.B 'CSOS 2.0 ALREADY INSTALLED',$D
OLD_ROMS DC.B 'CSOS 2.0 CAN ONLY BE INSTALLED USING THE CSOS'
DC.B ' 1.13 ROM SET',$D
DS.W 0
*
**********************************************************
* NOTHING BEFORE HERE WILL BE COPIED/RELOCATED *
**********************************************************
SUP_STACK EQU * 4096 (or more) BYTES FOR SUPERVISOR STACK after
DC.L 0 relocation, 4 byte pad between stack top and code
*
*
NOP |
NOP | more padding
NOP |
NOP |
*
BEG_RES_CODE EQU * this is called after code is moved (to do initialization)
*
* this is also called by HBOOT after it hacks memory control blocks
*
H_00E21A EQU *
NOP |
NOP | more padding
NOP |
NOP |
*
LEA INIT_MESS(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
LEA INIT_MESS(PC),A6
MOVE.B #'R',(A6)
MOVE.B #'e',1(A6)
*
BSR.L CH_SC_TBL H_00E29C updates System Call table
* and resident command table
*
BSR.L H_0103DE LOTS OF MEMMGR CALLS
CMPI.W #+000,D7 any errors?
*
NOP
NOP
INIT_DIE BNE.L H_00E23E this gets NOPed out after initial use
NOP on HBOOT the memory control blocks get
NOP hacked up, there will be errors at this
* stage and they are meaningless
*
BSR.L H_0104FE DOES MEMMGR SC JUMP UPDATE
BSR.L H_00F9E8 DOES LOADB SC JUMP UPDATE
BSR.L H_010AA0 DOES SYSLEV SC JUMP UPDATE
BSR.L H_010D54 ADDS LODMGR AND FMTNAM
*
LEA.L TRAPB(PC),A0 add new TRAP B handler
MOVE.L A0,$AC
LEA.L TRAPC(PC),A0 add new TRAP C handler
MOVE.L A0,$B0
*
LEA.L ALT_TRAP(PC),A0
MOVE.L A0,$0A30 Prep Alternate Trap Error Handler
* this is the CRASH interceptor
*
MOVEA.L #$3BEC,A1
MOVEA.L (A1),A0
H_FCB96E CMPA.L #$00000000,A0
BEQ.S H_FCB990
CMP.L #'USRM',(A0)
BNE.S N_USRM
LEA.L USRM_PTR(PC),A1
MOVE.L A0,(A1)
BRA.S N_SYSM
N_USRM CMP.L #'SYSM',(A0)
BNE.S N_SYSM
LEA.L SYSM_PTR(PC),A1
MOVE.L A0,(A1)
N_SYSM MOVEA.L +00004(A0),A0
BRA.S H_FCB96E
H_FCB990 EQU *
MOVEA.L SYSM_PTR(PC),A0
MOVEA.L 12(A0),A0
MOVE.L (A0),D0
SUBQ.L #4,D0
LEA.L USR_SV_ADR(PC),A0
CMP.L (A0),D0
BCS.L NUML_BREAK
MOVE.L D0,(A0)
*
NUML_BREAK EQU *
*
* GET CTRL BREAK AND CTRL NUML ADDRESSES - doesn't work properly, so
* we will fake it
*
* LEA.L CONFPKT(PC),A6 Get CTRL-Break and CTRL-NumLock addresses
* MOVEQ.L #$F6,D5 LUN for CON
* TRAP #6 SYSIO
* DC.W 6 FUNC
* NOP
* NOP
LEA.L CTRLBREAK(PC),A0
MOVE.L #$043B0,(A0) $43B0 is CTRL-BREAK byte
LEA.L CTRLNUML(PC),A0
MOVE.L #$043B1,(A0) $43B1 is CTRL-NUML byte
*
*
* end of initialization process - show resident commands and drive search list
*
LEA.L KBD_CMD_INT(PC),A0
MOVE.L A0,(A7)+
BRA.L IN_RES(PC)
*
INIT_MESS DC.B ' Initializing CSOS 2.01 ....',$D
DS.W 0
NOLIST
*
** FIRST INITIALIZATION SUBROUTINE
** updates System Call table and resident commmand table
CH_SC_TBL EQU *
H_00E29C LEA H_00EBAE(PC),A0
MOVE.W #$0000,D0
H_00E2A8 MOVE.B #$00,+000(A0,D0.W) clear mem block
ADDQ.W #1,D0
H_00E2B0 CMPI.W #+173,D0
BLE.S H_00E2A8
LEA H_00EA5E(PC),A0
LEA H_00EBA2(PC),A1
H_00E2BE CMPA.L A0,A1
BLE.S H_00E2CC
MOVE.L #$00000000,(A0)+
BRA.S H_00E2BE
H_00E2CC LEA H_00EC5C(PC),A0 UNMARK "MAGIC" BYTE (ALLOWS .BIN LOAD)
MOVE.B #$00,(A0)
LEA KBD_CMD_INT(PC),A0
DC.W $21C8,$0EB8 MOVE.L A0,$0EB8
*
LEA H_00E7CC(PC),A6
MOVEM.L D0/A0,-(A7)
TRAP #00 $0 SYSCALL
DC.W $003D GETSCTAB
*
MOVE.W #$0031,D0 enter (new) SC50 into table
ASL.W #2,D0
MOVE.L A6,+000(A0,D0.W) enter new value
*
LEA H_00FE6A(PC),A6 @FE6A
MOVE.W #$0018,D0 update SC25, GETPCB
ASL.W #2,D0
MOVE.L A6,+000(A0,D0.W) enter new value
*
LEA H_010172(PC),A6
MOVE.W #$0019,D0 update SC26, GIVPCB
ASL.W #2,D0
MOVE.L A6,+000(A0,D0.W) enter new value
LEA NEW_SC01(PC),A6 UPDATE SC01
MOVE.L A6,(A0) enter new value
*
LEA H_010306(PC),A6
MOVE.W #$002F,D0 enter (new) SC48 into table
ASL.W #2,D0
MOVE.L A6,+000(A0,D0.W) enter new value
*
LEA H_0102F8(PC),A6
MOVE.W #$0030,D0 enter (new) SC49 into table
ASL.W #2,D0
MOVE.L A6,+000(A0,D0.W) enter new value
*
LEA H_010314(PC),A6
MOVE.W #$002B,D0 enter (new) SC44 RUNTASK
ASL.W #2,D0
MOVE.L A6,+000(A0,D0.W) enter new value
*
LEA H_010384(PC),A6
MOVE.W #$002C,D0 enter (new) SC45 KILL
ASL.W #2,D0
MOVE.L A6,+000(A0,D0.W) enter new value
*
LEA H_010A76(PC),A6
MOVE.W #$000B,D0 update SC11, CHAIN
SUBQ.W #1,D0 compute SC TABLE offset
ASL.W #2,D0
MOVE.L +000(A0,D0.W),-(A7) push old entry
MOVE.L A6,+000(A0,D0.W) enter new value
MOVEA.L (A7)+,A6 pop old entry
CMPA.L #$0FC0000,A6
BLS.S N_CHAIN
*
MOVE.W #$0005,D0 update SC05, now CHAIN
SUBQ.W #1,D0 compute SC TABLE offset
ASL.W #2,D0
MOVE.L A6,+000(A0,D0.W) enter new value
*
N_CHAIN LEA H_0103D6(PC),A6
MOVE.W #$0035,D0 update SC53, MODSYSM
SUBQ.W #1,D0 compute SC TABLE offset
ASL.W #2,D0
MOVE.L +000(A0,D0.W),-(A7) push old entry
MOVE.L A6,+000(A0,D0.W) enter new value
MOVEA.L (A7)+,A6 pop old entry
CMPA.L #$0FC0000,A6
BLS.S N_MOD
*
MOVE.W #$0007,D0 update SC07, now MODSYSM
SUBQ.W #1,D0 compute SC TABLE offset
ASL.W #2,D0
MOVE.L A6,+000(A0,D0.W) enter new value
*
* UPDATE RESIDENT COMMAND TABLE
*
N_MOD MOVEM.L (A7)+,D0/A0
LEA ALIAS(PC),A0
MOVE.L #'ALIA',D1
MOVE.L #'S ',D2
BSR.L ADD__CMD
LEA H_00F06C(PC),A0
MOVE.L #'ATCH',D1
MOVE.L #'DRV ',D2
BSR.L ADD__CMD
LEA ATCHDRVB(PC),A0
MOVE.L #'ATCH',D1
MOVE.L #'DRVB',D2
BSR.L ADD__CMD
LEA ATCHDRVB(PC),A0
MOVE.L #'ATCH',D1
MOVE.L #'DRB ',D2
BSR.L ADD__CMD
LEA BEEP(PC),A0
MOVE.L #'BEEP',D1 short beep
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA BLANK(PC),A0
MOVE.L #'BLAN',D1 BLANK SCREEN
MOVE.L #'K ',D2
BSR.L ADD__CMD
LEA UNBLANK(PC),A0
MOVE.L #'UNBL',D1 UNBLANK SCREEN
MOVE.L #'ANK ',D2
BSR.L ADD__CMD
LEA COLDBOOT(PC),A0
MOVE.L #'CBOO',D1 power on tests
MOVE.L #'T ',D2
BSR.L ADD__CMD
LEA HBOOT(PC),A0
MOVE.L #'HBOO',D1 power on tests
MOVE.L #'T ',D2
BSR.L ADD__CMD
LEA CCNSL0(PC),A0
MOVE.L #'CCNS',D1
MOVE.L #'L0 ',D2
BSR.L ADD__CMD
LEA COMMAND(PC),A0
MOVE.L #'COMM',D1 list resident commands
MOVE.L #'AND ',D2
BSR.L ADD__CMD
LEA H_00E71E(PC),A0
MOVE.L #'DIAG',D1 manual (ROM) diagnostics
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA CRASH_TOL(PC),A0
MOVE.L #'CRAS',D1
MOVE.L #'HTOL',D2
BSR.L ADD__CMD
LEA H_00F2BC(PC),A0
MOVE.L #'DIR ',D1
MOVE.L #' ',D2 |
BSR.L ADD__CMD | aliases for DIR
MOVE.L #'DRI ',D1 |
MOVE.L #' ',D2 |
BSR.L ADD__CMD |
MOVE.L #'DOR ',D1 |
MOVE.L #' ',D2 |
BSR.L ADD__CMD |
MOVE.L #'DIOR',D1 |
MOVE.L #' ',D2 |
BSR.L ADD__CMD |
MOVE.L #'DOIR',D1 |
MOVE.L #' ',D2 |
BSR.L ADD__CMD |
MOVE.L #'DUR ',D1 |
MOVE.L #' ',D2 |
BSR.L ADD__CMD |
MOVE.L #'DIUR',D1 |
MOVE.L #' ',D2 | aliases for DIR
BSR.L ADD__CMD |
MOVE.L #'DUIR',D1 |
MOVE.L #' ',D2 |
BSR.L ADD__CMD |
MOVE.L #'DI ',D1 |
MOVE.L #' ',D2 |
BSR.L ADD__CMD |
LEA H_00F264(PC),A0
MOVE.L #'DTCH',D1
MOVE.L #'DRV ',D2
BSR.L ADD__CMD
LEA HEXOF(PC),A0
MOVE.L #'HEX ',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA HEXOF(PC),A0
MOVE.L #'HEXO',D1
MOVE.L #'F ',D2
BSR.L ADD__CMD
LEA WBOOT(PC),A0
MOVE.L #'WBOO',D1
MOVE.L #'T ',D2
BSR.L ADD__CMD
LEA HOWL(PC),A0
MOVE.L #'HOWL',D1 continuous beep
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA QUIET(PC),A0
MOVE.L #'HUSH',D1 RESIDENT QUERY
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA INVERSE(PC),A0
MOVE.L #'INVE',D1 TOGGLE VIDEO MODE
MOVE.L #'RSE ',D2
BSR.L ADD__CMD
LEA RESIDENT(PC),A0
MOVE.L #'LIST',D1 list resident commands
MOVE.L #'CMD ',D2
BSR.L ADD__CMD
LEA C_LOAD(PC),A0
MOVE.L #'LOAD',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA C_UNLOAD(PC),A0
MOVE.L #'UNLO',D1
MOVE.L #'AD ',D2
BSR.L ADD__CMD
LEA MAKRES(PC),A0
MOVE.L #'MAKE',D1 load .EXE and make command
MOVE.L #'RES ',D2
BSR.L ADD__CMD
LEA MAKRES(PC),A0
MOVE.L #'MAKR',D1 load .EXE and make command
MOVE.L #'ES ',D2
BSR.L ADD__CMD
LEA MODULES(PC),A0
MOVE.L #'MODU',D1 RESIDENT QUERY ALIAS
MOVE.L #'LES ',D2
BSR.L ADD__CMD
LEA NO(PC),A0
MOVE.L #'NO ',D1 KILL SCRNPRNT
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA NORMAL(PC),A0
MOVE.L #'NORM',D1 NORMAL VIDEO MODE
MOVE.L #'AL ',D2
BSR.L ADD__CMD
LEA WHAT_PATH(PC),A0
MOVE.L #'PATH',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA QUERY(PC),A0 |
MOVE.L #'QUER',D1 | RESIDENT QUERY
MOVE.L #'Y ',D2 |
BSR.L ADD__CMD |
* LEA QUERY(PC),A0 |
MOVE.L #'QEUR',D1 | RESIDENT QUERY
MOVE.L #'Y ',D2 |
BSR.L ADD__CMD |
* LEA QUERY(PC),A0 |
MOVE.L #'QUEY',D1 | RESIDENT QUERY
MOVE.L #'R ',D2 |
BSR.L ADD__CMD |
LEA QUIET(PC),A0 stop howl
MOVE.L #'QUIE',D1
MOVE.L #'T ',D2
BSR.L ADD__CMD
LEA REVERSE(PC),A0
MOVE.L #'REVE',D1 REVERSE VIDEO MODE
MOVE.L #'RSE ',D2
BSR.L ADD__CMD
LEA H_00EE42(PC),A0
MOVE.L #'RUN ',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA H_00EE42(PC),A0
MOVE.L #'RUNT',D1
MOVE.L #'ASK ',D2
BSR.L ADD__CMD
LEA ROM_SAVE(PC),A0
MOVE.L #'ROMS',D1 save w/o address validity checks
MOVE.L #'AVE ',D2
BSR.L ADD__CMD
LEA ROM_SAVE(PC),A0
MOVE.L #'SAVE',D1 save w/o address validity checks
MOVE.L #'ROM ',D2
BSR.L ADD__CMD
LEA SET_PATH(PC),A0
MOVE.L #'SETP',D1
MOVE.L #'ATH ',D2
BSR.L ADD__CMD
LEA CLSH(PC),A0
MOVE.L #'CLSH',D1 CLS & Home cursor
MOVE.L #' ',D2
BSR.L ADD__CMD
* LEA CLSH(PC),A0
MOVE.L #'CLS ',D1 CLS & Home cursor
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA SYSMAP(PC),A0 |
MOVE.L #'SYSM',D1 | RESIDENT SYSMAP
MOVE.L #'AP ',D2 |
BSR.L ADD__CMD |
* LEA SYSMAP(PC),A0 |
MOVE.L #'SYSA',D1 | RESIDENT SYSMAP
MOVE.L #'MP ',D2 |
BSR.L ADD__CMD |
* LEA SYSMAP(PC),A0 |
MOVE.L #'SYSM',D1 | RESIDENT SYSMAP
MOVE.L #'PA ',D2 |
BSR.L ADD__CMD |
LEA POOLS(PC),A0
MOVE.L #'POOL',D1 RESIDENT SYSMAP ALIAS
MOVE.L #'S ',D2
BSR.L ADD__CMD
LEA O_LOADB(PC),A0
MOVE.L #'LOAD',D1 LOAD Bin file
MOVE.L #'B ',D2
BSR.L ADD__CMD
LEA RSTDSK(PC),A0
MOVE.L #'RSTD',D1 reset floppies
MOVE.L #'SK ',D2
BSR.L ADD__CMD
LEA INIT_DONE(PC),A0
MOVE.L #'EXIT',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA UNLOADB(PC),A0
MOVE.L #'UNLO',D1 dealloc. memory after loadb
MOVE.L #'ADB ',D2
BSR.L ADD__CMD
LEA H_00F7AA(PC),A0
MOVE.L #'SET ',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA SUBMIT(PC),A0
MOVE.L #'SUBM',D1 extended SUBMIT, if no filename ext.
MOVE.L #'IT ',D2 looks for .SUB then .BAT
BSR.L ADD__CMD
LEA KBD_CMD_INT(PC),A0
MOVE.L #'CLI ',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA MAKECMD(PC),A0
MOVE.L #'MAKE',D1
MOVE.L #'CMD ',D2
BSR.L ADD__CMD
LEA P_B_(PC),A0
MOVE.L #'PB ',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA FUNC(PC),A0
MOVE.L #'FUNC',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA SUP_MODE(PC),A0
MOVE.L #'SUPM',D1
MOVE.L #'ODE ',D2
BSR.L ADD__CMD
LEA USR_MODE(PC),A0
MOVE.L #'USRM',D1
MOVE.L #'ODE ',D2
BSR.L ADD__CMD
LEA TELL_SR(PC),A0
MOVE.L #'SR ',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA TELL_USP(PC),A0
MOVE.L #'USP ',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA TELL_SSP(PC),A0
MOVE.L #'SSP ',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA TELL_SPS(PC),A0
MOVE.L #'SP ',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA TELL_USRM(PC),A0
MOVE.L #'USRM',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA TELL_SYSM(PC),A0
MOVE.L #'SYSM',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA RESET_PR(PC),A0
MOVE.L #'RSTP',D1
MOVE.L #'R ',D2
BSR.L ADD__CMD
LEA RLNFD(PC),A0
MOVE.L #'RLNF',D1
MOVE.L #'D ',D2
BSR.L ADD__CMD
LEA LNFD(PC),A0
MOVE.L #'LNFD',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA FMFD(PC),A0
MOVE.L #'FMFD',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA RED(PC),A0
MOVE.L #'RED ',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA GREEN(PC),A0
MOVE.L #'GREE',D1
MOVE.L #'N ',D2
BSR.L ADD__CMD
LEA BLUE(PC),A0
MOVE.L #'BLUE',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA BLACK(PC),A0
MOVE.L #'BLAC',D1
MOVE.L #'K ',D2
BSR.L ADD__CMD
LEA DO_KOLOR(PC),A0
MOVE.L #'COLO',D1
MOVE.L #'R ',D2
BSR.L ADD__CMD
LEA ANYCOLOR(PC),A0
MOVE.L #'ANYC',D1
MOVE.L #'OLOR',D2
BSR.L ADD__CMD
LEA LFON(PC),A0
MOVE.L #'LFON',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA FFON(PC),A0
MOVE.L #'FFON',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA LFOFF(PC),A0
MOVE.L #'LFOF',D1
MOVE.L #'F ',D2
BSR.L ADD__CMD
LEA FFOFF(PC),A0
MOVE.L #'FFOF',D1
MOVE.L #'F ',D2
BSR.L ADD__CMD
LEA TYPE(PC),A0
MOVE.L #'TYPE',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
* LEA TYPE(PC),A0
MOVE.L #'LIST',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA SYSLEVEL(PC),A0
MOVE.L #'SYSL',D1
MOVE.L #'EVEL',D2
BSR.L ADD__CMD
* LEA SYSLEVEL(PC),A0
MOVE.L #'VER ',D1
MOVE.L #' ',D2
BSR.L ADD__CMD
LEA.L SCREEN0(PC),A0
MOVE.L #'SCRE',D1
MOVE.L #'EN0 ',D2
BSR.L ADD__CMD
* LEA.L SCREEN0(PC),A0
MOVE.L #'SCRN',D1
MOVE.L #'0 ',D2
BSR.L ADD__CMD
LEA.L SCREEN1(PC),A0
MOVE.L #'SCRE',D1
MOVE.L #'EN1 ',D2
BSR.L ADD__CMD
* LEA.L SCREEN1(PC),A0
MOVE.L #'SCRN',D1
MOVE.L #'1 ',D2
BSR.L ADD__CMD
LEA.L SWITCH_SCREENS(PC),A0
MOVE.L #'SCRE',D1
MOVE.L #'ENX ',D2
BSR.L ADD__CMD
* LEA.L SWITCH_SCREENS(PC),A0
MOVE.L #'SWAP',D1
MOVE.L #'S ',D2
BSR.L ADD__CMD
*
* REPLACE SCHDRA ENTRIES W/ SCHDRA_X
TRAP #00 $0 SYSCALL
DC.W $003D GETSCTAB
MOVE.L 4(A0),D0 SCHDRA in D0
LEA SCHDRA_X(PC),A1
MOVEQ #68,D1
SC_TST_L CMP.L (A0),D0
BNE.S SC_NO_RPL
MOVE.L A1,(A0)
SC_NO_RPL ADDQ.L #4,A0
DBRA D1,SC_TST_L
RTS

*
*
* SECOND INITIALIZATION SUBROUTINE
H_0103DE SUBA.L #$00000014,A7
MOVEA.L A7,A6
MOVE.W #019,D0
H_0103F0 MOVE.B #$00,+000(A6,D0.W)
DBRA D0,H_0103F0
MOVE.L #'USRM',+00004(A6)
MOVEQ #001,D4 atachmpd = USRM
MOVE.L #2,8(A6) alloc mem from high to low
TRAP #00 $0 SYSCALL
DC.W $0039 MEM_MGR
NOP
NOP
ADDA.L #$00000014,A7
CMPI.W #$6002,D7
BNE.S NOT_6002
MOVE.W #0,D7
NOT_6002 CMPI.W #+000,D7
BNE.L H_010496
TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVE.L #$0000DC00,D1
MOVE.L D1,4(A5)
SUBA.L #$00000014,A7
MOVEA.L A7,A6
MOVE.W #019,D0
H_01043C MOVE.B #$00,+000(A6,D0.W)
DBRA D0,H_01043C
MOVE.L D1,+00004(A6)
MOVE.L +00008(A5),D0 app end
MOVE.L D0,D2
MOVEA.L SYSM_PTR(PC),A4
CMPA.L #0,A4
BEQ.S NO_SYSM
MOVEA.L 12(A4),A4
MOVE.L (A4),D2
SUBQ.L #4,D2
NO_SYSM CMP.L #0,D0
BEQ.S USE_D2
CMP.L 12(A5),D0
BCC.S USE_D2
CMP.L D0,D2
BCS.S USE_D0
USE_D2 MOVE.L D2,D0
USE_D0 LEA USR_SV_ADR(PC),A4
SUBI.L #$04,D0
MOVE.L D0,(A4)
SUBI.L #$00FFC,D0
BRA.S D0_OK
AG_ CMP.W #$600A,D7
BNE.S AFT_
MOVE.L USR_SV_ADR(PC),D0
SUBI.L #$00FFC,D0
BLE.S AFT_
D0_OK SUB.L D1,D0
BCLR #00,D0
LSR.L #5,D0
LSR.L #5,D0
CLR.L D7
MOVE.L D0,+00008(A6)
MOVEQ #003,D4 atachmsp
MOVE.L #'USRM',D5
TRAP #00 $0 SYSCALL
DC.W $0039 MEM_MGR
BRA.L AG_
AFT_ ADDA.L #$00000014,A7
CMPI.W #+000,D7
BNE.S H_010496
CLR.L D0
MOVE.L D0,+00008(A5)
MOVE.L D0,+00004(A5)
H_010496 LEA SSR_SV_ADDR(PC),A4
* MOVE.L SSTACK(PC),A2
LEA.L SUP_STACK(PC),A2
MOVE.L A2,(A4)
LEA.L SSTACK(PC),A4
MOVE.L A2,(A4)
H_0104FC RTS
* END OF SECOND INITIALIZATION SUBROUTINE
*
*
* THIRD INITIALIZATION SUBROUTINE
* updates SC JUMP table entry for MEMMGR
H_0104FE LEA H_010614(PC),A6
LEA H_0105EE(PC),A0
MOVE.L A6,+00032(A0)
LEA H_0107A0(PC),A6
LEA H_0105EE(PC),A0
MOVE.L A6,+00020(A0)
LEA H_01053A(PC),A6
MOVEM.L D0/A0,-(A7)
TRAP #00 $0 SYSCALL
DC.W $003D GETSCTAB
MOVE.W #$0038,D0 SC57 - MEMMGR
ASL.W #2,D0
MOVE.L +000(A0,D0.W),-(A7) push old entry
MOVE.L A6,+000(A0,D0.W) enter new value
MOVEA.L (A7)+,A6 pop old entry
CMPA.L #$0FC0000,A6
BLS.S N_MEMMGR
MOVE.W #$0008,D0 update SC08, now MEMMGR
SUBQ.W #1,D0 compute SC TABLE offset
ASL.W #2,D0
MOVE.L A6,+000(A0,D0.W) enter new value
N_MEMMGR MOVEM.L (A7)+,D0/A0
RTS
* END OF THIRD INITIALIZATION SUBROUTINE
** FOURTH INITIALIZATION SUBROUTINE
*
*
** UPDATES LOADB ENTRY IN SC JUMP TABLE
H_00F9E8 LEA H_00FA0C(PC),A6
MOVEM.L D0/A0,-(A7)
TRAP #00 $0 SYSCALL
DC.W $003D GETSCTAB
MOVE.W #$000D,D0 SC14 - LOADB
ASL.W #2,D0
MOVE.L +000(A0,D0.W),-(A7) push old entry
MOVE.L A6,+000(A0,D0.W) enter new value
MOVEA.L (A7)+,A6 pop old entry
CMPA.L #$0FC0000,A6
BLS.S N_LOADB
MOVE.W #$0006,D0 update SC06, now LOADB
SUBQ.W #1,D0 compute SC TABLE offset
ASL.W #2,D0
MOVE.L A6,+000(A0,D0.W) enter new value
N_LOADB MOVEM.L (A7)+,D0/A0
RTS
** END OF FOURTH INITIALIZATION SUBROUTINE
** FIFTH INITIALIZATION SUBROUTINE
*
*
** UPDATES SYSLEV ENTRY IN SC JUMP TABLE
H_010AA0 LEA NEW_SC32(PC),A6
MOVEM.L D0/A0,-(A7)
TRAP #00 $0 SYSCALL
DC.W $003D GETSCTAB
MOVE.W #$001F,D0 new SC32 SYSLEV
ASL.W #2,D0
MOVE.L A6,+000(A0,D0.W) enter new value
MOVEM.L (A7)+,D0/A0
RTS
** END OF FIFTH INITIALIZATION SUBROUTINE
*
*
** SIXTH INITIALIZATION SUBROUTINE
** ADDS LODMGR AND FMTNAM TO SC JUMP TABLE
H_010D54 LEA H_010DA2(PC),A6
MOVEM.L D0/A0,-(A7)
TRAP #00 $0 SYSCALL
DC.W $003D GETSCTAB
MOVE.W #$003F,D0 new SC64 LODMGR
ASL.W #2,D0
MOVE.L A6,+000(A0,D0.W) enter new value
LEA H_01200C(PC),A6
TRAP #00 $0 SYSCALL
DC.W $003D GETSCTAB
MOVE.W #$003E,D0 NEW SC63 FMTNAM
ASL.W #2,D0
MOVE.L A6,+000(A0,D0.W) enter new value
MOVEM.L (A7)+,D0/A0
* SUBA.L #$000000AE,A7
* MOVEA.L A7,A6
* MOVEA.L A6,A0
* MOVEA.L A6,A5
* MOVE.L #$000000AD,D0 PRE-LOAD DEBUG.EXE, & ENTER INTO RES_CMD_TABLE
*D_CLR_LCB CLR.B (A0)+
* DBF D0,D_CLR_LCB
* MOVE.L #'DEBU',+00006(A6)
* MOVE.L #'G ',+00010(A6)
* MOVE.W #'EX',+00014(A6)
* MOVE.B #'E',+00016(A6)
* MOVE.B #$03,+00018(A6)
* MOVEQ #008,D4 load W/SEARCH
* TRAP #00 $0 SYSCALL
* DC.W $0040 2-LodMgr
* BRA.L EXIT6
* MOVE.L 72(A5),A0
* MOVE.L #0,D0
* MOVE.L #'DEBU',D1
* MOVE.L #'G ',D2
* TRAP #0
* DC.W 50
*EXIT6 ADDA.L #$000000AE,A7
SUBA.L #$000000AE,A7 ------------|
MOVEA.L A7,A6 |
MOVEA.L A6,A0 |
MOVEA.L A6,A5 |
MOVE.L #$000000AD,D0 |PRE-LOAD DIR.EXE
R_CLR_LCB CLR.B (A0)+ |
DBF D0,R_CLR_LCB |
MOVE.L #'DIR ',+00006(A6) |
MOVE.L #' ',+00010(A6) |
MOVE.W #'EX',+00014(A6) |
MOVE.B #'E',+00016(A6) |
MOVE.B #$03,+00018(A6) |
MOVEQ #008,D4 load W/SEARCH |
TRAP #00 $0 SYSCALL |
DC.W $0040 2-LodMgr |
NOP |
NOP |
* ADDA.L #$000000AE,A7 -----------|
* SUBA.L #$000000AE,A7 ----------|
MOVEA.L A7,A6 |
MOVEA.L A6,A0 |
MOVEA.L A6,A5 |
MOVE.L #$000000AD,D0 | PRE-LOAD DEBUG.EXE,
D_CLR_LCB CLR.B (A0)+ | & ENTER INTO RES_CMD_TABLE
DBF D0,D_CLR_LCB |
MOVE.L #'DEBU',+00006(A6) |
MOVE.L #'G ',+00010(A6) |
MOVE.W #'EX',+00014(A6) |
MOVE.B #'E',+00016(A6) |
MOVE.B #$03,+00018(A6) |
MOVEQ #008,D4 load W/SEARCH|
TRAP #00 $0 SYSCALL |
DC.W $0040 2-LodMgr |
BRA.L EXIT6 |
MOVE.L 72(A5),A0 |
MOVE.L #0,D0 |
MOVE.L #'DEBU',D1 |
MOVE.L #'G ',D2 |
TRAP #0 |
DC.W 50 |
EXIT6 ADDA.L #$000000AE,A7 --------|
LEA.L NEWPRTSC(PC),A0
TRAP #0
DC.W 62
CMPA.L #$0FC2BAC,A0
BNE.S PRTSC_OVER
LEA.L NEWPRTSC(PC),A0
PRTSC_OVER MOVEA.L A0,A1
TRAP #0
DC.W 62
LEA.L PRTSC_VEC(PC),A0
MOVE.L A1,(A0)
MOVE.L A1,A0
MOVE.L #'PRTS',D1
MOVE.L #'C ',D2
BSR.L ADD__CMD
LEA.L N_TRAP0(PC),A0
MOVE.L A0,$080
RTS
** END OF SIXTH INITIALIZATION SUBROUTINE
*
END_TRANS EQU *
DCB.L 16,0
*
*
SYS_LEV_IND EQU *
H_00E298 DC.L $02010011 SYS_LEVEL INDICATOR; level 2, version 01
* internal level 0017
PRTSC_VEC DC.L 0
*
*
**
CONDIB EQU *
CNVOL DC.B '#CON '
CNDTD DC.B 1
CNTRN DC.B 0
DC.L 0,0
DC.W 0
CNFPKT DC.L 0
DC.L 0
*
CONFPKT DC.W 8
CTRLBREAK EQU *
DC.W 0,0,9
CTRLNUML EQU *
DC.W 0,0,0,0
RSTCONB DC.W 7,0
*
*
ADD__CMD MOVEQ #000,D0 add command
* SUBA.L #40,A7
TRAP #00 $0 SYSCALL
DC.W $0032 RES_CMD
* ADDA.L #40,A7
RTS
*
*****************************************************************************
* New TRAP 0 handler
N_TRAP0 EQU *
MOVE.L A0,-(A7)
MOVEA.L 6(A7),A0
CMPI.W #70,(A0) New TRAP #0 handler - check for
BCC.S SC_BAD syscall number out of range, if
CMPI.W #0,(A0) so - make it exit
BGT.S SC_OUT
SC_BAD MOVE.W #43,(A0)
SC_OUT MOVEA.L (A7)+,A0
JMP $FC413E
MAYBEGM LEA H_00EBAE(PC),A6
CMPI.B #4,88(A6)
BEQ.S NO_GIVIT
RTS
NO_GIVIT CMP.L #0,26(A6)
BEQ.S NONO_NO2
MOVEQ #5,D4 LMRETMEM
TRAP #0 SYSCALL
DC.W 64 LOD_MGR
NOP
NOP
MOVE.L 76(A6),26(A6)
CMP.L #0,26(A6)
BEQ.S NONO_NO2
MOVEQ #5,D4 LMRETMEM
TRAP #0 SYSCALL
DC.W 64 LOD_MGR
NOP
NOP
RTS
NONO_NO2 MOVEQ #2,D4 INQLOAD
TRAP #0 SYSCALL
DC.W 64 LOD_MGR
RTS
NOP
MOVEQ #5,D4 LMRETMEM
TRAP #0 SYSCALL
DC.W 64 LOD_MGR
NOP
NOP
RTS
FREEIT MOVE SR,D0
TRAP #00 $0 SYSCALL
DC.W $0030 2 SUP MODE
MOVEM.L D0/D5/A1/A4/A6,-(A7)
SUBA.L #$00000014,A7
MOVEA.L A7,A4
MOVEQ #020,D0
UL0E75E MOVE.B #$00,+000(A4,D0.W)
DBRA D0,UL0E75E
* MOVE.L UL_CONST(PC),012(A4)
MOVEA.L A4,A6
LEA H_00EBAE(PC),A4
MOVE.L 40(A4),12(A6)
F_GM_L MOVEQ #006,D4 GIVMEM
MOVE.L #'USRM',D5
TRAP #00 $0 SYSCALL
DC.W $0039 MEM_MGR
NOP
NOP
BRA.L F_OUT
F_T_SETS LEA.L UL_DO_SET(PC),A0
CMP.W #1,(A0)
BNE.L F_OUT
MOVEA.L USRM_PTR(PC),A4
MOVEA.L 12(A4),A4
MOVEA.L 12(A4),A0
CMPA.L #$0DC00,A0
BEQ.L F_OUT
MOVEA.L #$0DC00,A2
F_T_L ANDI.L #$0FFFFFE,4(A2)
MOVEA.L 4(A2),A1
CMPA.L A0,A1
BEQ.S F_SETDC00
CMPA.L #0,A1
BEQ.S F_SETBOTH
CMPA.L $0A10,A1
BCC.L F_OUT
MOVEA.L A1,A2
BRA F_T_L
F_SETBOTH MOVE.L A0,4(A2)
F_SETDC00 MOVE.L #$0DC00,12(A4)
MOVE.L #$DC00,A0
F_OUT_3 LEA.L 4(A0),A1
MOVE.L 4(A0),A0
CMPA.L #0,A0
BEQ.L F_OUT
CMPA.L #$0DC00,A0
BNE F_OUT_3
MOVE.L #0,(A1)
BRA.L F_OUT
FREEIT2 MOVE SR,D0
TRAP #00 $0 SYSCALL
DC.W $0030 2 SUP MODE
MOVEM.L D0/D5/A1/A4/A6,-(A7)
SUBA.L #$00000014,A7
MOVEA.L A7,A4
MOVEQ #020,D0
ULTE75E MOVE.B #$00,+000(A4,D0.W)
DBRA D0,ULTE75E
MOVEA.L A4,A6
LEA H_00EBAE(PC),A4
MOVE.L 40(A4),012(A4)
MOVE.L 44(A4),4(A6)
MOVE.L 40(A4),A4
MOVE.L -8(A4),D1
CMP.L 4(A6),D1
BEQ.S F_GM_L2
BRA.S F_GM_N
F_GM_L2 MOVEQ #006,D4 GIVMEM
MOVEA.L USRM_PTR(PC),A2
MOVE.L #2,8(A2)
F_GM_L3 MOVE.L #'USRM',D5
MOVE.L D0,-(A7)
TRAP #00 $0 SYSCALL
DC.W $0039 MEM_MGR
BRA.L F_ERR
MOVE.L (A7)+,D0
F_GM_N MOVEA.L USRM_PTR(PC),A4
MOVEA.L 12(A4),A4
CMPI.L #$0DC00,(A4)
BEQ.S F_T_OTHER
CMPI.L #$0,(A4)
BEQ F_T_SETS
F_GME_L MOVE.L (A4),4(A6)
LEA.L 8(A4),A4
MOVE.L A4,12(A6)
BRA F_GM_L2
F_T_OTHER MOVEA.L $0DC04,A4
CMPA.L #$0,A4
BEQ F_T_SETS
MOVE.L (A4),4(A6)
LEA.L 8(A4),A4
MOVE.L A4,12(A6)
BRA F_GM_L2
F_OUT ADDA.L #$00000014,A7
MOVEM.L (A7)+,D0/D5/A1/A4/A6
MOVE D0,SR
RTS
F_ERR_TOL DC.L 5
F_ERR MOVE.L (A7)+,D0
ADDQ.L #1,D0
CMP.L F_ERR_TOL(PC),D0
BCC F_T_SETS
MOVEA.L USRM_PTR(PC),A2
CMP.L #0,8(A2)
BNE.S F_GRONK
MOVE.L #2,8(A2)
BRA F_GME_L
F_GRONK MOVE.L #0,8(A2)
BRA F_GM_L3
BAS_SET MOVE.L D0,-(A7)
MOVE SR,D0
TRAP #0
DC.W 48 SUPMODE
MOVEM.L D0-D7/A0-A6,-(A7)
LEA.L UL_FOO(PC),A3
MOVE.L #0,(A3)
MOVEQ #007,D4 INQMEM
MOVE.L #'USRM',D5
LEA.L SM_0E33A(PC),A6
TRAP #0 SYSCALL
DC.W $0039 MEM_MGR
BRA.L UL_SKIP
MOVE.L SM_0E34A(PC),D0 cont. free
TRAP #0 SYSCALL
DC.W 0052 GBASTPR
MOVE.L #$0DC08,D1
CMP.L #0,4(A5)
BNE.S UL_SK1
MOVE.L D1,4(A5)
UL_SK1 ADD.L D1,D0
SUBQ.L #2,D0
CMP.L #0,8(A5)
BEQ.S UL_DO
CMP.L 8(A5),D0
BCS.S UL_SK2
UL_DO MOVE.L D0,8(A5)
UL_SK2 ADDQ.L #2,D0
MOVE.L D0,(A3)
UL_SKIP MOVEM.L (A7)+,D0-D7/A0-A6
MOVE D0,SR
MOVE.L (A7)+,D0
RTS
*
*
UL_FOO DC.L 0
USRM_PTR DC.L 0
SYSM_PTR DC.L 0
*
USR_SV_ADDR EQU *
USP_SV_ADDR EQU *
H_010D9A DC.L 0
*
SSR_SV_ADDR EQU *
SSP_SV_ADDR EQU *
H_010D9E DC.L 0
*
SR_SAVE DC.W 0
*
SSTACK DC.L 0
*
*
SETDD LEA +01108(A1),A2
MOVE.L A2,+00400(A1)
MOVE.B #247,D5
BSR SUB_CLOSE
SUBA.L #74,A7
MOVEA.L A7,A6
MOVEA.L +00400(A1),A4
MOVE.W #73,D0
SETDD_1 MOVE.B #0,0(A6,D0.W)
DBRA D0,SETDD_1
TRAP #0
DC.W 15 FMTDIB
MOVE.L #'DIR ',38(A6)
MOVE.L #' ',42(A6)
MOVE.W #'DI',46(A6)
MOVE.B #'R',48(A6)
LEA SETDD_PKT(PC),A5
MOVE.L A5,18(A6)
MOVE.B #1,6(A6)
ORI.W #$040,016(A6)
MOVE.B #247,D5
BSR SUB_OPEN
CMPI.W #0,D7
BNE KBD_ERR_
LEA SETDD_PKT(PC),A6
MOVE.B #247,D5
TRAP #6
DC.W 6 FUNC
BRA.L KBD_ERR_
MOVE.B #242,D5
BSR SUB_CLOSE
ADDA.L #66,A7
BRA INIT_DONE
SETDD_PKT DC.W 23,0,0,0
*
RST_NXTOK MOVE.L D0,-(A7)
MOVE SR,D0
TRAP #0 SYSCALL
DC.W $0030 2-SUPMODE
MOVEM.L D0/A1-A2/A5,-(A7)
TRAP #0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L 016(A5),A1
LEA 01108(A1),A2
MOVE.L A2,0400(A1)
MOVEM.L (A7)+,D0/A1-A2/A5
MOVE D0,SR
MOVE.L (A7)+,D0
RTS
CRT_CR DC.B 8
DC.B 0
IS_SUBMIT DC.B 0
DS.W 0
*
*----------------------------------- KEYBOARD COMMAND. INTERPRETER
* KEYBOARD COMMAND INTERPRETER
C_B_KBD_CMD_INT EQU *
DC.W $40C6 MOVE SR,D6
MOVE.L A0,-(A7)
C_B_INT EQU *
TRAP #00 $0 SYSCALL
DC.W $0030 SUP MODE
MOVE.L A5,-(A7)
TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L +00016(A5),A1
MOVEA.L (A7)+,A5
MOVE.B #0,1286(A1)
MOVEI.B #$F5,D5 | LUN $F5 is used by SUBMIT for input file
LEA.L 0,A6 | no FUNPKT
TRAP #6 |I/O MANAGER
DC.W 2 |CLOSE
BRA.L NOT_SUBMIT - if error, was not in SUBMIT, go Clear Ctrl-Break
LEA IS_SUBMIT(PC),A0
MOVEI.B #0,(A0)
NOT_SUBMIT MOVEI.B #0,$43B0 Clear Ctrl-BREAK indicator
IS_SUBM_ MOVE.L (A7)+,A0
BRA.S IN_KBD_CMD
*
KBD_ERR_ CMPI.W #$6FFF,D7
BLS.S NOT_L_ERR
BSR.L LOD_ERR_PRT
BRA.S KBD_CMD_INT
NOT_L_ERR TRAP #0 SYSCALL
DC.W 12 PRTERR
*
KBD_CMD_INT EQU *
H_00E4D6 DC.W $40C6 MOVE SR,D6
IN_KBD_CMD TRAP #00 $0 SYSCALL
DC.W $0031 USERMODE
LEA USR_SV_ADR(PC),A6 @10D9A
MOVEA.L (A6),A7
TRAP #00 $0 SYSCALL
DC.W $0030 SUP MODE
MOVE #$2000,SR
LEA L_SEARCH(PC),A6
MOVE.B #$FF,(A6) - NO SEARCH IN LODMGR
LEA SUP_STACK(PC),A7
MOVE.W P_B_PCBNO(PC),D0
TRAP #0 SYSCALL
DC.W 27 GSTAT
CMP.L #'PBTA',D1
BNE.S KBD_CONT
CLR.B D0 THERE IS A PBTASK
MOVEQ #2,D1 DELAY US BY 2 TICKS
TRAP #0
DC.W 29
BRA KBD_CMD_INT
KBD_CONT MOVEA.L #$0EB2,A6 - TRAP INDICATOR
CMP.B #0,(A6)
BEQ.S NON_NEG
BMI.S TRP_ZAP
SUB.B #1,(A6) - DECREMENT TRAP INDIC.
BCC.S NON_NEG
TRP_ZAP MOVE.B #0,(A6) - IF NEG. ZERO IT
LEA.L TRAPB(PC),A0 |
MOVE.L A0,$AC | restore trap vectors
LEA.L TRAPC(PC),A0 |
MOVE.L A0,$B0 |
LEA.L ALT_TRAP(PC),A0 |
MOVE.L A0,$0A30 |Prep Alternate Trap Error Handler
NON_NEG DC.W $46C6 MOVE D6,SR restore original SR for moment
BSR.L H_00E72E CHECK FOR POST .BIN CLEANUP
MOVE.L A5,-(A7)
TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L +00016(A5),A1
MOVEA.L (A7)+,A5
MOVE.L A0,-(A7)
LEA IS_SUBMIT(PC),A0
CMP.B #$FF,(A0)
BEQ.S SKIP_SUBMIT
MOVE SR,D6 save SR in D6
TRAP #0 SYSCALL
DC.W 48 SUPMODE
* CMP.B #$FF,$43B0 CTRL-Break Byte
DC.W $0C38,$00FF CMPI.B #$FF,$43B0 CHECK CTRL-Break BYTE
DC.W $43B0
BEQ C_B_INT
MOVE D6,SR
SKIP_SUBMIT EQU *
MOVE.L (A7)+,A0
MOVE.B #$FF,+01285(A1)
TRAP #00 $0 SYSCALL
DC.W $002A GetCmdE*
MOVE.L D0,-(A7)
TRAP #0 SYSCALL |
DC.W 55 INQCRTCR |
OR.B CRT_CR(PC),D0 | RESET THE CRT
TRAP #0 SYSCALL |
DC.W 54 SETCRTCR |
MOVE.L (A7)+,D0
MOVE SR,D6 save SR in D6
TRAP #0 SYSCALL
DC.W 48 SUPMODE
* CMP.B #$FF,$43B0 CTRL-Break Byte
DC.W $0C38,$00FF CMPI.B #$FF,$43B0 CHECK CTRL-Break BYTE
DC.W $43B0
BEQ C_B_KBD_CMD_INT
MOVE.B LEDS_(PC),$0F00001
MOVEQ #0,D0 |
LEA 01108(A1),A2 | make upper case and then parse
UC_LOOP CMPI.B #'a',0(A2,D0) |
BLT.S UCL_E576 |
CMPI.B #'z',0(A2,D0) |
BGT.S UCL_E576 |
ANDI.B #$DF,0(A2,D0) |
UCL_E576 CMPI.B #13,0(A2,D0) |
BEQ.S UCL_OUT |
ADDQ.W #1,D0 |
CMPI.W #80,D0 |
BCS UC_LOOP |
UCL_OUT LEA 01108(A1),A2
MOVE.L A2,0400(A1)
MOVEA.L A2,A3
MOVE.B #$FF,01285(A1)
MOVE D6,SR restore original SR
CLI_NXT TRAP #00 $0 SYSCALL
DC.W $0010 NxTok*
MOVE.B #$00,01285(A1)
MOVE.B 0411(A1),D2
MOVEA.L 0400(A1),A4
CMPI.B #+001,D2 is name?
BEQ.S H_00E582 Yes
CMPI.B #+003,D2 is number?
BNE.S H_00E552 No
MOVE.B #$01,D1 ;number as input
H_00E532 MOVE.B (A4)+,D2
CMPI.B #':',D2
BNE.S H_00E540
MOVE.B (A4)+,D2
CMPI.B #13,D2
BEQ SETDD
BRA.L TRY_LOAD
H_00E540 ADDQ.B #1,D1
H_00E542 CMPI.B #+006,D1
BLE.S H_00E532
MOVEA.L #BADCOMMAND,A6
BRA.S H_00E57A
H_00E552 CMPI.B #+013,D2 Not name or number ...
BEQ KBD_CMD_INT if was CR, try again
CMPI.B #'?',(A3)
BEQ.L RESIDENT
CMPI.B #3,(A3) HBOOT on Control-C
BEQ.L HBOOT
DC.W $40C6 MOVE SR,D6
TRAP #00 $0 SYSCALL
DC.W $0030 SUP MODE
CMPI.B #' ',(A3) |
BGE.S CMD_ERR | IF IT STARTS WITH CONTROL CHAR. MAKE IT A SPACE
MOVE.B #' ',(A3) | AND TRY AGAIN, ELSE AN ERROR
BRA UCL_OUT |
CMD_ERR MOVEA.L #CMDFMTERR,A6
H_00E57A TRAP #00 $0 SYSCALL
DC.W $0013 PrtErMsg*
MOVE D6,SR restore original SR
BRA KBD_CMD_INT
*
H_00E582 MOVEA.L +00400(A1),A4 ;name as input
CMPI.B #'.',(A4)
BEQ.L TRY_LOAD
CMPI.W #8,0408(A1) was cmpi.w #7, (wrong)
BGT.L TRY_LOAD
CMPI.B #':',(A4)+
BNE.S TRY_RESC
CMPI.B #13,(A4)
BEQ SETDD
CMPI.B #' ',(A4)
BEQ SETDD
BRA.L TRY_LOAD
TRY_RESC LEA RES_CMD_TABLE(PC),A5
H_00E59C CMPI.B #+255,(A5)
BEQ.L TRY_LOAD
IS_RES_CMD EQU *
MOVEA.L +00404(A1),A4
MOVE.W +00408(A1),D1
MOVE.W #$0000,D3
H_00E5B0 MOVE.B (A4)+,D2
CMP.B +000(A5,D3.W),D2
BEQ.S H_00E5BE
MOVE.B #$00,D2
H_00E5BE ADDQ.W #1,D3
CMP.W D3,D1
BEQ.S H_00E5CA
CMPI.B #+000,D2
BNE.S H_00E5B0
H_00E5CA CMPI.B #+000,D2
BEQ.S H_00E5E6
CMPI.B #8,D3
BEQ.S KC_IS_NUL
CMPI.B #' ',0(A5,D3.W)
BNE.S H_00E5E6
KC_IS_NUL CMPI.L #0,8(A5)
BEQ.S TRY_LOAD
BSR BAS_SET
MOVEA.L 08(A5),A1
MOVE.L (A5),D0
MOVE.L 4(A5),D1
BSR.L KBD_LCB
TRAP #0
DC.W 48
LEA.L NONONO(PC),A0
MOVE.L A0,-(A7)
MOVE SR_SAVE(PC),SR
CMPI.L #0,060(A4)
BEQ.S KC_0E6C8
CMPI.L #2,060(A4)
BLE.S KC_0E6C8
MOVE.L 048(A4),D3
ADD.L 052(A4),D3
ADD.L 056(A4),D3
ADD.L 060(A4),D3
SUBQ.L #4,D3
MOVEA.L D3,A7
KC_0E6C8 MOVE.L A0,-(A7)
JSR (A1) DO INTERNAL COMMAND
BRA.L NONONO CLEANUP W/O UNLOADING
H_00E5E6 ADDA.L #$0C,A5 TRY NEXT ENTRY IN KBD_CMD_TABLE
BRA H_00E59C
*
* Keyboard Command Interpreter, Phase 2
* COULDN'T FIND AS RESIDENT COMMAND, NEXT TRY LOAD FILE
TRY_LOAD LEA +01108(A1),A2
MOVE.L A2,+00400(A1)
MOVE.B #$FF,+01298(A1)
MOVEM.L D0/D6/A0,-(A7)
DC.W $40C6 MOVE SR,D6
BTST #13,D6
BNE.S H_00E60E
TRAP #00 $0 SYSCALL
DC.W $0030 SUP MODE
H_00E60E LEA H_00EBAE(PC),A0
MOVE.W #0173,D0
H_00E61A MOVE.B #$00,+000(A0,D0.W)
DBRA D0,H_00E61A
DC.W $46C6 MOVE D6,SR
MOVEM.L (A7)+,D0/D6/A0
BSR.L H_00EC60 LOAD IT! even if BIN
TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L +00016(A5),A1
CLR.B +01298(A1)
CMPI.W #0,D7
BNE.L TRY_SUBM
DC.W $40C0 MOVE SR,D0
BTST #13,D0
BNE.S H_00E65A
TRAP #00 $0 SYSCALL
DC.W $0030 2 SUP MODE
H_00E65A EQU *
LEA L_SEARCH(PC),A6
MOVE.B #0,(A6) - DO SEARCH IN LODMGR
LEA H_00EBAE(PC),A4
MOVE.B #03,-2(A4) ANOTHER UNLOAD INDIC.
DC.W $46C0 MOVE D0,SR
TST.L +00412(A1)
BEQ.L TRY_SUBM
MOVEA.L 412(A1),A1
LEA H_00EBAE(PC),A4
MOVEM.L A0,-(A7)
MOVEA.L 040(A4),A0
ADDA.L 044(A4),A0
CMPA.L 040(A4),A1
BLT.S H_00E68C
CMPA.L A1,A0
BGT.S H_00E69A
H_00E68C LEA BADXFER(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0013 PrtErMsg*
CLR.W D7
BRA KBD_CMD_INT
H_00E69A MOVEM.L (A7)+,A0
TRAP #0
DC.W 48
MOVE SR_SAVE(PC),SR
CMPI.B #04,088(A4)
BNE.S CLI_IS_BIN
BSR BAS_SET
CMPI.L #0,060(A4)
BLE.S H_00E6C8
CMPI.L #2,060(A4)
BEQ.S H_00E6C8
MOVE.L 048(A4),D0
ADD.L 052(A4),D0
ADD.L 056(A4),D0
ADD.L 060(A4),D0
SUBQ.L #4,D0
MOVEA.L D0,A7
H_00E6C8 MOVE.L 030(A4),D0
MOVE.L 034(A4),D1
JSR (A1)
H_00E6D2 TRAP #00 $0 SYSCALL
DC.W $002B Exit
CLI_IS_BIN BSR FREEIT MARK MEMORY AS FREE FOR FURTHER LOADS
BRA.S H_00E6C8
BADXFER EQU *
H_00E6D6 DC.B 'BAD TRANSFER ADDRESS',$D,$0
DS.W 0
H_00E6EC: DC.W +00000
*
* Keyboard Command Interpreter, phase 3
* NOT LOAD FILE, TRY SUBMIT FILE ...
TRY_SUBM CMPI.B #+000,+01286(A1)
BNE H_00E68C
LEA +01108(A1),A2
MOVE.L A2,+00400(A1)
BSR.L SUBMIT
CMPI.B #0,D7
BEQ H_00E6D2
MOVE.L #249,D5
TRAP #00 $0 SYSCALL
DC.W 0010 DPrtErr
BRA H_00E6D2
*
*****************************************************************************
C_DIAG EQU * this code implements the resident command DIAG
H_00E71E MOVEA.L #$00ABCDEF,A0 get into SupMode
TRAP #05
* address $00F2000C is ROM - Addr pointer- Man. DIAG
MOVEA.L $00F2000C,A0
JMP (A0) Bye!
*
*****************************************************************************
UNLOADBS TRAP #00 SYSCALL
DC.W $0030 2 SUP MODE
LEA H_00EC5C(PC),A0
MOVE.B #255,(A0)
LEA H_00EBAE(PC),A6
CMPI.B #1,088(A6) FULL CLEANUP?
BNE.S UNLOADBN
BSR FREEIT
UNLOADBN BSR FREEIT2
TRAP #00 $0 SYSCALL
DC.W $0031 2 usr MODE
BSR.S UNLOADBE
RTS
UL_CONST DC.L $E000
UL_DO_SET DC.W 0
*
UNLOADB PEA.L SYSMAP(PC)
TRAP #0
DC.W 48
PEA.L SYSMAP(PC)
BSR.L GET_NUM
LEA.L UL_DO_SET(PC),A0
MOVE.W #1,(A0)
CMP.L #15,D0
BCC.S ULB_OK
MOVEQ.L #15,D0
MOVE.W #0,(A0)
ULB_OK LEA.L F_ERR_TOL(PC),A0
MOVE.L D0,(A0)
BSR UNLOADBS
LEA.L UL_DO_SET(PC),A0
CMP.W #1,(A0)
BNE.S H_00E72A
BSR FREEIT2
H_00E72A BRA.L SYSMAP
H_00E72E LEA H_00EC5C(PC),A0 check for post .BIN cleanup
CMPI.B #+255,(A0) was "magic" byte set?
BEQ.S UNLOADBE YES! do cleanup
LEA H_00EBAE(PC),A6
CMPI.B #+001,+00088(A6)
BEQ.S UNLOADBE
CMPI.B #3,-2(A6)
BEQ.S UNLOADBE
BRA.L H_00E7CA
*
UNLOADBE MOVEM.L D0/D4-D5/A0/A4-A6,-(A7) yes! do cleanup
TRAP #00 $0 SYSCALL
DC.W $0030 2 SUP MODE
LEA H_00EBAE(PC),A6
CMPI.B #4,088(A6)
BNE.S H_00E750
BSR MAYBEGM
BRA.S H_00E7A4
H_00E750 SUBA.L #$00000014,A7
MOVEA.L A7,A4
MOVEQ #000,D0
H_00E75E MOVE.B #$00,+000(A4,D0.W)
ADDQ.L #1,D0
H_00E766 CMPI.L #$00000013,D0
BLE.S H_00E75E
MOVE.L +00040(A6),+00012(A4)
MOVEA.L A4,A6
MOVEQ #006,D4 GIVMEM
MOVE.L #'USRM',D5
TRAP #00 $0 SYSCALL
DC.W $0039 MEM_MGR
NOP
NOP
H_00E786 ADDA.L #$00000014,A7
BRA.S H_00E7BA
H_00E7A4 TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVE.L #$00000000,4(A5)
MOVE.L #$00000000,8(A5)
CMP.L #0,76(A6)
BEQ.S UL_NOT
MOVE.L 76(A6),26(A6)
UL_NOT MOVEQ #001,D4 unload
TRAP #0 SYSCALL
DC.W $0040 2-LodMgr
BRA.L H_00E7B4
H_00E7AE BRA.S H_00E7BA
H_00E7B4 TRAP #00 $0 SYSCALL
DC.W $000C PrtErr*
H_00E7BA LEA H_00EC5C(PC),A0 UNMARK "MAGIC" BYTE (.BIN LOAD)
MOVE.B #$00,(A0)
LEA B_UL(PC),A0 UNMARK OTHER CLEANUP INDICATOR
MOVE.B #0,(A0)
MOVE.B #0,90(A0)
LEA UL_CONST(PC),A0
MOVE.L #$E000,(A0)
LEA.L P_B_PCBNO(PC),A0
MOVE.W #0,(A0)
TRAP #00 $0 SYSCALL 2
DC.W $0031 2 USERMODE
MOVEM.L (A7)+,D0/D4-D5/A0/A4-A6
H_00E7CA MOVEM.L D5/A6,-(A7)
LEA CAPS_ON(PC),A6
MOVE.B #246,D5
TRAP #6 IOMGR
DC.W 6 FUNC
BSR.L OPE246
MOVE.B #247,D5
BSR SUB_CLOSE
MOVE.B #241,D5
BSR SUB_CLOSE
MOVEM.L (A7)+,D5/A6
BSR BAS_SET
RTS
CAPS_ON DC.W 24,0,0
OPE246 SUBA.L #74,A7
MOVEA.L A7,A6
MOVE.W #73,D0
OPE246_1 MOVE.B #0,0(A6,D0.W)
DBRA D0,OPE246_1
MOVE.L #'#CON',(A6)
MOVE.W #' ',4(A6)
MOVE.W #$0101,6(A6)
ORI.W #$0040,16(A6)
MOVE.B #246,D5
BSR.L SUB_OPEN
ADDA.L #74,A7
RTS
*
*****************************************************************************
NEW_SC50 EQU *
H_00E7CC CLR.W D7
CMPI.W #+000,D0 D0=0 ADD COMMAND
BNE.S H_00E7DE
BSR.S H_00E814
BRA.S H_00E80E
H_00E7DE CMPI.W #+001,D0 D0=1 DELETE COMMAND
BNE.S H_00E7EE
MOVE.L D3,-(A7)
MOVE.L D0,D3
BSR.L H_00E870
MOVE.L (A7)+,D3
BRA.S SC50_BYE
H_00E7EE CMPI.W #+002,D0 D0=2 LOOKUP COMMAND
BNE.S SC50_IS3
BSR.L SC50D02
BRA.S SC50_BYE
SC50_IS3 CMPI.W #+003,D0 D0=3 DELETE COMMAND ONLY FROM USRM
BNE.S H_00E7FE
MOVE.L D3,-(A7)
MOVE.L D0,D3
BSR.L H_00E870
MOVE.L (A7)+,D3
CMP.W #0,D7
BNE.S SC50_BYE
BSR.L UN_ALIAS
BRA.S SC50_BYE
SC50_IS4 CMPI.W #+004,D0 D0=4 return SSP_TOP value in D0
BNE.S SC50_IS5
* MOVE.L SSTACK(PC),A0
LEA SUP_STACK(PC),A0
MOVE.L A0,4(A7)
BRA.S H_00E80E
SC50_IS5 CMPI.W #+005,D0 D0=5 UNALIAS
BNE.S H_00E7FE
BSR.L UN_ALIAS
BRA.S SC50_BYE
H_00E7FE MOVE.W #$4100,D7
SC50_BYE EQU *
H_00E802 CMPI.W #+000,D7
BNE.S H_00E80E
MOVE.L A0,+00036(A7)
H_00E80E MOVE.W D7,+00034(A7)
RTS
*
*NEW SC50 D0=0 when entered should have NAME (8 char) in D1/D2
* & address in A0 = ENTERS RESIDENT COMMAND INTO TABLE
H_00E814 MOVE.L A0,-(A7)
BSR.L H_00E8C0
CMPI.W #+000,D7 command already in table?
BNE.S H_00E828 NO - go add it, if room enough
CMPA.L #0,A0 null command - place holder?
BNE.S ADD_CMD_BAD no
MOVE.L (A7)+,-4(A1) yes - is null
RTS
ADD_CMD_BAD MOVE.W #$4103,D7
MOVEA.L (A7)+,A0
BRA.S H_00E86E
H_00E828 MOVEA.L (A7)+,A0
LEA RES_CMD_TABLE(PC),A1
MOVE.W #255,D7
H_00E82E CMPI.L #$FFFFFFFF,8(A1)
BNE.S H_00E842
CMP.W #255,D7 NO FREE SLOTS - TRY AGAIN W/O SKIPPING
BNE.S SC50_PS2 OVER NULL PLACEHOLDERS
LEA RES_CMD_TABLE(PC),A1
MOVE.W #256,D7
BRA.S H_00E842
SC50_PS2 MOVE.W #$4101,D7
BRA.S H_00E86E
H_00E842 CMPI.L #0,(A1)
BEQ.S H_00E84A
CMP.W #256,D7
BNE.S H_00E864
H_00E84A CMPI.L #0,+00004(A1)
BEQ.S H_00E852
CMP.W #256,D7
BNE.S H_00E864
CMP.L #0,8(A1)
BNE.S H_00E864
H_00E852 CLR.W D7
MOVE.L D1,(A1)
MOVE.L D2,4(A1)
MOVE.L A0,8(A1)
H_00E864 LEA 12(A1),A1
H_00E868 CMPI.W #255,D7
BEQ.S H_00E82E
CMPI.W #256,D0
BEQ.S H_00E82E
H_00E86E RTS
*
*NEW SC50 D0=1 = ? DELETE RESIDENT COMMAND FROM TABLE
H_00E870 LEA RES_CMD_TABLE(PC),A1
MOVEQ #255,D7
H_00E876 CMPI.L #$FFFFFFFF,+00008(A1)
BNE.S H_00E88A
MOVE.W #$4102,D7
BRA.S H_00E8B8
H_00E88A CMP.L (A1),D1
BNE.S H_00E8B4
CMP.L 4(A1),D2
BNE.S H_00E8B4
MOVE.W #$4104,D7
MOVEA.L 8(A1),A0
CMP.B #1,D3 IF D3=1 DELETE IT
BEQ.S SC50D1_DOIT ELSE CHECK THAT
MOVEM.L A5,-(A7) ENTRY NOT IN SYSTEM
LEA.L USR_SV_ADR(PC),A5
MOVE.L (A5),D3
MOVEM.L (A7)+,A5
CMPA.L D3,A0
BHI.S NO_GO_
SC50D1_DOIT MOVE.L #0,8(A1)
MOVE.W #0,D7
H_00E8B4 LEA +00012(A1),A1
H_00E8B8 CMPI.W #+65535,D7
BEQ.S H_00E876
RTS
NO_GO_ MOVEQ #0,D1
MOVEA.L D1,A0
BRA H_00E8B4
*
*NEW SC50 D0=2 = LOOKUP RESIDENT COMMAND IN TABLE
SC50D02 BSR.S H_00E8C0
CMPA.L #0,A0
BEQ.S H_00E8CE
RTS
H_00E8C0 LEA RES_CMD_TABLE(PC),A1
MOVEQ #255,D7
H_00E8C6 CMPI.L #$FFFFFFFF,(A1)
BNE.S H_00E8D8
H_00E8CE MOVE.W #$4102,D7
RTS
H_00E8D8 CMP.L (A1),D1
BNE.S H_00E8EC
CMP.L 4(A1),D2
BNE.S H_00E8EC
CLR.W D7
MOVEA.L 8(A1),A0
H_00E8EC LEA 12(A1),A1
H_00E8F0 CMPI.W #+65535,D7
BEQ.S H_00E8C6
RTS
UN_ALIAS CMPA.L #0,A0
BNE.S OK_UN_ALIAS
RTS
OK_UN_ALIAS LEA RES_CMD_TABLE(PC),A1
UN_A_LOOP CMP.L #-1,8(A1)
BNE.S UN_A_CONT
RTS
UN_A_CONT CMPA.L 8(A1),A0
BNE.S NEXT
MOVE.L #0,8(A1)
NEXT ADDA.L #12,A1
BRA UN_A_LOOP
DS.W 0
*
RES_CMD_TABLE EQU * contains "null" entries for filling after load
H_00E94A EQU * this keeps listcmd output in alphabetical order
DC.B 'ALIAS '
DC.L 0
DC.B 'ALINK '
DC.L 0
DC.B 'ANYCOLOR'
DC.L 0
DC.B 'ARRGH '
DC.L $0FC000F
DC.B 'ATCHDEV '
DC.L $00FC2958
DC.B 'ATCHDRB '
DC.L 0
DC.B 'ATCHDRVB'
DC.L 0
DC.B 'ATCHDRV '
DC.L 0
DC.B 'BASIC '
DC.L 0
DC.B 'BEEP '
DC.L 0
DC.B 'BLACK '
DC.L 0
DC.B 'BLANK '
DC.L 0
DC.B 'BLUE '
DC.L 0
DC.B 'C '
DC.L 0
DC.B 'CAT '
DC.L 0
DC.B 'CBOOT '
DC.L 0
DC.B 'CC '
DC.L 0
DC.B 'CCNSL0 '
DC.L 0
DC.B 'CLEAR '
DC.L $00FC2886
DC.B 'CLI '
DC.L 0
DC.B 'CLS '
DC.L 0
DC.B 'CLSH '
DC.L 0
DC.B 'COLOR '
DC.L 0
DC.B 'COMMAND '
DC.L 0
DC.B 'COPY '
DC.L 0
DC.B 'CRASH '
DC.L $0FC000F
DC.B 'CRASHTOL'
DC.L 0
DC.B 'DEBUG '
DC.L 0
DC.B 'DEL '
DC.L $0FC12EA
DC.B 'DELETE '
DC.L $0FC12EA
DC.B 'DELAY '
DC.L $00FC3FD4
DC.B 'DIAG '
DC.L 0
DC.B 'DI '
DC.L 0
DC.B 'DIR '
DC.L 0
DC.B 'DIOR '
DC.L 0
DC.B 'DIUR '
DC.L 0
DC.B 'DISKCOPY'
DC.L 0
DC.B 'DLE '
DC.L $0FC12EA
DC.B 'DOR '
DC.L 0
DC.B 'DOIR '
DC.L 0
DC.B 'DRI '
DC.L 0
DC.B 'DUR '
DC.L 0
DC.B 'DUIR '
DC.L 0
DC.B 'DTCHDEV '
DC.L $00FC2968
DC.B 'DTCHDRB '
DC.L $00FC2978
DC.B 'DTCHDRVB'
DC.L $00FC2978
DC.B 'DTCHDRV '
DC.L 0
DC.B 'DUALFMT '
DC.L 0
DC.B 'E000 '
DC.L $0E000
DC.B 'ED '
DC.L 0
DC.B 'ERA '
DC.L $0FC12EA
DC.B 'ERASE '
DC.L $0FC12EA
DC.B 'EXIT '
DC.L 0
DC.B 'FFOFF '
DC.L 0
DC.B 'FFON '
DC.L 0
DC.B 'FMFD '
DC.L 0
DC.B 'FMU '
DC.L 0
DC.B 'FORMAT '
DC.L 0
DC.B 'FORTRAN '
DC.L 0
DC.B 'FUNC '
DC.L 0
DC.B 'GREEN '
DC.L 0
DC.B 'HBOOT '
DC.L 0
DC.B 'HELP '
DC.L 0
DC.B 'HEX '
DC.L 0
DC.B 'HEXOF '
DC.L 0
DC.B 'HOWL '
DC.L 0
DC.B 'HUSH '
DC.L 0
DC.B 'INVERSE '
DC.L 0
DC.B 'JUMP '
DC.L $0FC12BA
DC.B 'KILL '
DC.L $0FC3DFC
DC.B 'LIST '
DC.L 0
DC.B 'LISTCMD '
DC.L 0
DC.B 'LISTDEV '
DC.L $00FC28BE
DC.B 'LFOFF '
DC.L 0
DC.B 'LFON '
DC.L 0
DC.B 'LNFD '
DC.L 0
DC.B 'LOAD '
DC.L 0
DC.B 'LOADB '
DC.L 0
DC.B 'MAKECMD '
DC.L 0
DC.B 'MAKERES '
DC.L 0
DC.B 'MAKRES '
DC.L 0
DC.B 'MODULES '
DC.L 0
DC.B 'MORE '
DC.L 0
DC.B 'N '
DC.L $00FC1C0A
DC.B 'NO '
DC.L 0
DC.B 'NORMAL '
DC.L 0
DC.B 'PAGE '
DC.L $00FC2874
DC.B 'PARK '
DC.L 0
DC.B 'PASCAL '
DC.L 0
DC.B 'PASS2 '
DC.L 0
DC.B 'PATH '
DC.L 0
DC.B 'PB '
DC.L 0
DC.B 'PE '
DC.L 0
DC.B 'PEX '
DC.L 0
DC.B 'POOLS '
DC.L 0
DC.B 'PRI '
DC.L $0FC3E84
DC.B 'PRTSC '
DC.L 0
DC.B 'Q '
DC.L $00FC1C0A
DC.B 'QEURY '
DC.L 0
DC.B 'QUERY '
DC.L 0
DC.B 'QUEYR '
DC.L 0
DC.B 'QUIET '
DC.L 0
DC.B 'RED '
DC.L 0
DC.B 'REN '
DC.L $00FC1516
DC.B 'RENAME '
DC.L $00FC1516
DC.B 'REPAIR '
DC.L 0
DC.B 'RESETP '
DC.L 0
DC.B 'RESUME '
DC.L $00FC3FBC
DC.B 'REVERSE '
DC.L 0
DC.B 'RLNFD '
DC.L 0
DC.B 'ROMSAVE '
DC.L 0
DC.B 'RSTDSK '
DC.L 0
DC.B 'RSTPR '
DC.L 0
DC.B 'RUN '
DC.L 0
DC.B 'RUNTASK '
DC.L 0
DC.B 'SAVE '
DC.L $00FC1C24
DC.B 'SAVEROM '
DC.L 0
DC.B 'SCREEN0 '
DC.L 0
DC.B 'SCREEN1 '
DC.L 0
DC.B 'SCREENX '
DC.L 0
DC.B 'SCRN0 '
DC.L 0
DC.B 'SCRN1 '
DC.L 0
DC.B 'SECURE '
DC.L $00FC1E50
DC.B 'SET '
DC.L 0
DC.B 'SETPATH '
DC.L 0
DC.B 'SETSM '
DC.L 0
DC.B 'SETSTACK'
DC.L 0
DC.B 'SHIPDISK'
DC.L 0
DC.B 'SHOW '
DC.L $00FC401C
DC.B 'SPOOL '
DC.L $00FC2EE4
DC.B 'SPOOLQ '
DC.L $00FC2F34
DC.B 'SPOOLC '
DC.L $00FC301E
DC.B 'SP '
DC.L 0
DC.B 'SR '
DC.L 0
DC.B 'SSP '
DC.L 0
DC.B 'SYSLEVEL'
DC.L 0
DC.B 'SYSM '
DC.L 0
DC.B 'STAT '
DC.L 0
DC.B 'SYSMAP '
DC.L 0
DC.B 'SYSAMP '
DC.L 0
DC.B 'SYSMPA '
DC.L 0
DC.B 'SUBMIT '
DC.L 0
DC.B 'SUPMODE '
DC.L 0
DC.B 'SWAPS '
DC.L 0
DC.B 'TASKS '
DC.L $00FC3B1C
DC.B 'TIME '
DC.L $00FC2678
DC.B 'TYPE '
DC.L 0
DC.B 'UNBLANK '
DC.L 0
DC.B 'UNLOAD '
DC.L 0
DC.B 'UNLOADB '
DC.L 0
DC.B 'USP '
DC.L 0
DC.B 'USRM '
DC.L 0
DC.B 'USRMODE '
DC.L 0
DC.B 'VER '
DC.L 0
DC.B 'WBOOT '
DC.L 0
DC.B 'Y '
DC.L $00FC1C0A
* FROM HERE TO EBA2 CLEARED @ E2BE - this area set aside to extend above
H_00EA5E DCB.W 0288,0 LEAVE SPACE FOR 24 MORE COMMANDS
H_00EBA2 DCB.W 016,-1 $FFFF
*
B_UL DC.W 0
*
*
* 174 BYTES BEGINNING HERE CLEARED @ H_00E29C - CH_SC_TBL
H_00EBAE DCB.W 87,0 * USED FOR LCB BY LOAD COMMAND &C
H_00EC5C DC.W $B400 A "MAGIC" BYTE
DC.W 0
*
*ALTERNATE LOAD ENTRY POINT USED BY KBD_CMD_INTerpreter - D3=0 MEANS
* DON'T DISPLAY TRANSFER ADDRESS MESSAGE - also means don't make resident
*
LEDS_ DC.W $FD00
H_00EC60 CLR.B D3
BRA.S H_00EC6A
*
*****************************************************************************
C_LOAD EQU * this code implements the resident command LOAD
BSR.S H_00EC66
BRA.L SYSMAP
H_00EC66 MOVE.B #$01,D3
H_00EC6A BSR.L H_00ED02
CMPI.W #+000,D7
BNE.L H_00ECE8
TRAP #0 SYSCALL
DC.W $0E LoadB
CMPI.W #+000,D7
BEQ.S H_00ECA0
CMPI.B #+000,+01298(A3) KBD_CMD_INT CALLED US?
BEQ.S H_00EC98 YES - NO MESSAGES
CMPI.B #+130,D7 resident command LOAD
BEQ.L H_00ECE8
CMPI.W #$70FE,D7
BNE.S H_00EC98
BSR RST_NXTOK
BSR UNLOAD
CMPI.W #0,D7
BNE.S H_00EC98
BSR RST_NXTOK
BRA H_00EC6A
H_00EC98 BSR.L LOD_ERR_PRNT
H_00EC9C BRA.S H_00ECE8
H_00ECA0 MOVE.L A2,+00412(A3)
BEQ.S H_00ECE8
CMPI.B #+001,D3 KBD_CMD_INT CALLED US?
BNE.S H_00ECE8 YES - NO MESSAGE
LINK A3,#-00036
MOVEA.L A7,A6
MOVEA.L A6,A5 resident command LOAD
LEA $00FC1C0C,A4
MOVE.W #$0001,D0
H_00ECC4 MOVE.B (A4)+,(A5)+
ADDQ.W #1,D0
H_00ECC8 CMPI.W #+024,D0
BLE.S H_00ECC4
MOVE.L A2,D0
* address $00FC61B0 is Plug in tray ROM
JSR $00FC61B0 .L CONVERT TO HEX
MOVE.B #$0D,(A5) resident command LOAD
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
MOVE.B #$0D,(A6)
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
UNLK A3
LEA H_00EBAE(PC),A4
CMP.B #4,88(A4)
BNE.S H_00ECEA
MOVE.L 30(A4),D1
MOVE.L 34(A4),D2
MOVE.L 72(A4),A2
MOVEA.L A2,A0
MOVEQ #0,D0
* SUBA.L #40,A7
TRAP #0
DC.W 50
* ADDA.L #40,A7
H_00ECE8 RTS
*
H_00ECEA MOVE SR,D0 IF .BIN MARK FOR CLEANUP!
TRAP #0
DC.W 48 SUPMODE
MOVE.B #3,-2(A4)
MOVE D0,SR
BRA.L UNHYPE
H_00ED02 TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L +00016(A5),A3
LEA +00416(A3),A6 resident command LOAD
MOVE.W #073,D0
MOVE.L D3,-(A7)
H_00ED16 MOVE.B #$00,+000(A6,D0.W)
DBRA D0,H_00ED16
MOVE.B #$01,+00006(A6)
MOVE.L #$000000F7,D5
BSR.L SUB_CLOSE
CLR.W D7
TRAP #00 $0 SYSCALL
DC.W $000F FmtDib*
CMPI.W #+00260,D7 resident command LOAD
BEQ.S H_00ED38
CMPI.W #2,D7
BNE.L H_00EDB8
H_00ED38 DC.W $40C6 MOVE SR,D6
TRAP #00 $0 SYSCALL 2
DC.W $0030 2 SUP MODE
MOVE.W D6,-(A7)
LEA H_010128(PC),A4
MOVE.W #$0000,D0 resident command LOAD
H_00ED62 MOVE.B +000(A6,D0.W),+000(A4,D0.W)
ADDQ.W #1,D0
CMPI.W #+073,D0
BLE.S H_00ED62
CMPI.W #+00260,D7
BEQ.S CL_DOBOTH
LEA 046(A6),A2
CMP.B #'B',(A2)
BEQ.S CL_EXE
CMP.B #'E',(A2)
BEQ.S CL_BIN
BRA.S CL_EXE
CL_DOBOTH LEA 046(A4),A2
CL_EXE MOVE.B #'E',(A2)+
MOVE.B #'X',(A2)+
MOVE.B #'E',(A2)
CMPI.W #+00260,D7
BNE.S CL_D2
LEA 046(A6),A2
CL_BIN MOVE.B #'B',(A2)+
MOVE.B #'I',(A2)+
MOVE.B #'N',(A2) resident command LOAD
CL_D2 MOVEQ #0,D3
EXG A6,A4
EXG.L A5,D5
LEA CL_FIRST(PC),A5
MOVE.L A6,(A5)
EXG.L A5,D5
MOVE.L #$000000F7,D5
C_L_EXIST ORI.W #$0040,+00016(A6)
MOVE.L D3,-(A7)
BSR.L SUB_OPEN
TST.W D7
BNE.S H_00ED80
BSR.L SUB_CLOSE
MOVE.L (A7)+,D3
MOVE.W #073,D7 resident command LOAD
CL_COPY MOVE.B +000(A6,D7.W),+000(A4,D7.W)
DBRA D7,CL_COPY
LEA.L CL_FIRST(PC),A6
MOVEA.L (A6),A6
MOVEQ #0,D7
MOVE.L #$000000F7,D5
BRA.S H_00EDB0
H_00ED80 MOVE.L (A7)+,D3
CMPI.W #10,D7
BEQ.S CL_ALT_DRV
CMPI.W #$8600,D7
BEQ.S CL_ALT_DRV
CMPI.W #130,D7
BNE.S H_00EDBA
CMPA.L CL_FIRST(PC),A6
BEQ.S TRY_BIN
CL_ALT_DRV BSR.L DRV_SERCH
CMP.W #0,D7
BNE.S H_00EDBA
MOVE.B (A6),(A4)
MOVE.B 1(A6),1(A4)
MOVE.B 2(A6),2(A4)
MOVE.B 3(A6),3(A4)
MOVE.B 4(A6),4(A4)
MOVE.B 5(A6),5(A4)
CMPA.L CL_FIRST(PC),A6
BEQ C_L_EXIST
*
TRY_BIN EXG A6,A4
NT_BIN BRA.L C_L_EXIST
H_00EDB0 DC.W $46DF MOVE (A7)+,SR
BRA.S H_00EDCC
H_00EDB8 CMPI.W #+002,D7
BEQ.S H_00EDCC
BRA.S CL_ERR_
H_00EDBA MOVE.B #' ',(A6)
MOVE.B #' ',(A4)
DC.W $46DF MOVE (A7)+,SR
CL_ERR_ MOVE.L (A7)+,D3
CMPI.B #01,D3
BEQ.S CL_ERR_OK
RTS
CL_ERR_OK MOVE.L D3,-(A7)
LEA CL_ERR_MS(PC),A6
TRAP #00 $0 SYSCALL
DC.W 0018 PRTMSG
MOVE.L #249,D5
TRAP #00 $0 SYSCALL
DC.W 0010 DPRTERR
BRA.S H_00EDCE
*
CL_ERR_MS DC.B 'LOAD COMMAND: ',$4
DS.W 0
H_00EDBE MOVE.B #' ',(A6)
MOVE.B #' ',(A4)
DC.W $46DF MOVE (A7)+,SR
MOVE.W #$0101,D7
BRA CL_ERR_
H_00EDCC CLR.L D7
H_00EDCE MOVE.L (A7)+,D3
RTS END OF CODE FOR resident command LOAD
*
*
CL_FIRST DC.L 0,0
*
UNLOAD EQU * this code implements the resident command UNLOAD
MOVE SR,D6
TRAP #00 $0 SYSCALL 2 SUP MODE
DC.W $0030 2 SUP MODE
MOVE.W D6,-(A7)
CLR.W D7
LEA H_00EBAE(PC),A4
MOVE.W #173,D0
H_00EDE6 MOVE.B #0,0(A4,D0.W)
DBRA D0,H_00EDE6
LEA +00030(A4),A6 resident command UNLOAD
TRAP #00 $0 SYSCALL
DC.W $003F 2-FmtNam
CMPI.W #+001,D7
BLS.S H_00EE12
BRA.S H_00EE1E
H_00EE12 MOVEA.L A4,A6
MOVEQ #010,D4 unload - IGNORING $6012 ERRORS
TRAP #00 $0 SYSCALL
DC.W $0040 2-LodMgr
NOP
NOP
H_00EE1E CMPI.W #+000,D7 resident command UNLOAD
BEQ.S H_00EE2A
BSR.L LOD_ERR_PRNT
BRA.S C_UL_BYE
H_00EE2A MOVE.L 30(A4),D1 IF NO ERRORS - MAKE SURE
MOVE.L 34(A4),D2 IT IS DELETED FROM COMMAND TABLE
MOVEQ #3,D0 DELETE ENTRY BUT NOT FROM SYSTEM SPACE
MOVEA.L #0,A0
TRAP #0 SYSCALL
DC.W 50 RESCMD
C_UL_BYE DC.W $46DF MOVE (A7)+,SR
RTS
*
****************************************************************************
C_UNLOAD EQU * this code implements the resident command UNLOAD
BSR UNLOAD
BRA.L SYSMAP
* END OF CODE FOR resident command UNLOAD
DS.W 0
*
*****************************************************************************
C_RUNTASK EQU * this code implements the resident commands RUN, RUNTASK
H_00EE42 DC.W $40C6 MOVE SR,D6
TRAP #00 $0 SYSCALL 2
DC.W $0030 2 SUP MODE
MOVE.W D6,-(A7)
BSR.L H_00ED02
TRAP #01 EnterMon
CMPI.W #+000,D7
BNE.S H_00EEB2
CLR.W D7
MOVEM.L D0/A0-A2,-(A7)
MOVE.L +00038(A6),D1
H_00EE62 BSR.L H_01025E
BSR.L H_0102BC
CMPI.B #+000,D0 resident commands RUN, RUNTASK
BNE.S H_00EE62
LEA H_00EBAE(PC),A2
MOVE.W #$0000,D0
H_00EE7C MOVE.B #$00,+000(A2,D0.W)
ADDQ.W #1,D0
H_00EE84 CMPI.W #+173,D0
BLE.S H_00EE7C
BSET #00,+00020(A2)
BSET #01,+00020(A2)
MOVE.L D1,+00030(A2)
MOVE.L D2,+00034(A2) resident commands RUN, RUNTASK
MOVE.L #'USRM',+00022(A2)
MOVE.L +00038(A6),D1
MOVE.L +00042(A6),D2
MOVEM.L (A7)+,D0/A0-A2
H_00EEB2 CMPI.W #+000,D7
BNE.S H_00EED8
BSR.L H_00FA30
MOVE.L A2,+00412(A3)
LEA H_00EBAE(PC),A2
MOVE.B #$00,+00020(A2)
CMPI.W #+000,D7
BEQ.S H_00EED8
BSR.L LOD_ERR_PRNT
H_00EED8 CMPI.W #+000,D7 resident commands RUN, RUNTASK
BNE.S H_00EF20
TST.L +00412(A3)
BNE.S H_00EEF8
LEA H_00F24A(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0013 PrtErMsg*
MOVE.W #$00FF,D7
BRA.S H_00EF20
H_00EEF8 MOVEA.L +00412(A3),A1
LEA H_00EBAE(PC),A4
MOVEA.L +00040(A4),A0
ADDA.L +00044(A4),A0 resident commands RUN, RUNTASK
CMPA.L +00040(A4),A1
BLT.S H_00EF14
CMPA.L A1,A0
BGT.S H_00EF20
H_00EF14 LEA H_00E6D6(PC),A6
TRAP #00 $0 SYSCALL
DC.W $000C PrtErr*
MOVE.W #$0192,D7
H_00EF20 CMPI.W #+000,D7
BNE.S H_00EF88
MOVEA.L +00412(A3),A6
TRAP #00 $0 SYSCALL
DC.W $0010 NxTok* resident commands RUN, RUNTASK
CMPI.B #+004,+00410(A3)
BEQ.S H_00EF46
MOVEQ #001,D0
TRAP #00 $0 SYSCALL
DC.W $001B GStat
SUBQ.B #1,D0
BRA.S H_00EF88
H_00EF46 TRAP #00 $0 SYSCALL
DC.W $0010 NxTok*
CMPI.B #+003,+00411(A3)
BEQ.S H_00EF60
MOVE.W #$0101,D7 resident commands RUN, RUNTASK
TRAP #00 $0 SYSCALL
DC.W $0009 CPRTERR
MOVE.W #$00FF,D7
H_00EF60 CMPI.W #+000,D7
BNE.S H_00EF88
MOVE.L +00412(A3),D0
CMPI.L #$00000001,D0
BLT.S H_00EF7C
CMPI.L #$0000007F,D0
BLE.S H_00EF88
H_00EF7C MOVE.W #$0107,D7
TRAP #00 $0 SYSCALL
DC.W $0009 CPRTERR resident commands RUN, RUNTASK
MOVE.W #$00FF,D7
H_00EF88 CMPI.W #+000,D7
BNE.S H_00EFF4
LEA H_00EBAE(PC),A2
MOVE.L +00030(A2),D1
MOVE.L +00034(A2),D2
MOVE.L A6,-(A7)
SUBA.L #$0000000A,A7
LEA H_00F059(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
MOVEA.L A7,A6 resident commands RUN, RUNTASK
MOVE.L D1,(A6)
MOVE.L D2,+00004(A6)
MOVE.B #$0D,+00009(A6)
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
ADDA.L #$0000000A,A7
MOVEA.L (A7)+,A6
TRAP #00 $0 SYSCALL
DC.W $0019 GetPCB
TST.B D0
BEQ.S H_00EFF4
CMPI.B #+001,D0 resident commands RUN, RUNTASK
BNE.S H_00EFE8
LEA H_00F03C(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0013 PrtErMsg*
MOVE.W #$00FF,D7
BRA.S H_00EFF4
H_00EFE8 LEA H_00F03C(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0013 PrtErMsg*
MOVE.W #$00FF,D7
H_00EFF4 CMPI.W #+000,D7
BEQ.S H_00F00E
MOVE.L D7,-(A7) resident commands RUN, RUNTASK
LEA H_00EBAE(PC),A6
MOVEQ #001,D4 unload
TRAP #00 $0 SYSCALL
DC.W $0040 2-LodMgr
NOP
NOP
H_00F00C MOVE.L (A7)+,D7
H_00F00E TRAP #02 ExitMon
DC.W $46DF MOVE (A7)+,SR
RTS END OF CODE FOR resident commands RUN, RUNTASK
H_00F014 ORI.B #$00,D0
HEX_DIGITS EQU *
H_00F018 DC.B '0123456789ABCDEFDUPLICATE TASK NAME',$D
*H_00F058 EQU *+00000028
H_00F03C DC.B 'NO MORE TASKS MAY BE STARTED',$D
H_00F059 DC.B ' STARTING TASK ',$4
DS.W 0
H_00F06A: DC.W +00000
*
*****************************************************************************
C_ATCHDRV EQU * this code implements the resident command ATCHDRV
H_00F06C CLR.W D7
MOVE.B #$FF,D0
BSR.L H_00F1E8
CMPI.W #+00260,D7
BNE.S H_00F094
LEA +00046(A6),A2
MOVE.B #'D',(A2)+
MOVE.B #'R',(A2)+
MOVE.B #'V',(A2)
CLR.W D7
BRA.S H_00F0AA
H_00F094 CMPI.W #+002,D7 resident command ATCHDRV
BNE.S H_00F0A2
CLR.W D7
BRA.S H_00F0AA
H_00F0A2 MOVE.W #$0101,D7
TRAP #00 $0 SYSCALL CPRTERR
DC.W $0009 CPRTERR
H_00F0AA CMPI.W #+000,D7
BNE.L H_00F144
MOVE.B #$01,+00006(A6)
LEA +00746(A3),A4
MOVE.W #0015,D0
H_00F0C4 MOVE.B #$00,+000(A4,D0.W)
DBRA D0,H_00F0C4
LEA +00490(A3),A2
MOVE.L A2,+00004(A4)
MOVE.B #$F7,D5
DC.W $40C0 MOVE SR,D0
TRAP #00 $0 SYSCALL
DC.W $0030 2 SUP MODE
MOVEM.L D0-D1/A0-A2/A5,-(A7)
TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L +00016(A5),A1 resident command ATCHDRV
LEA +01108(A1),A1
LEA H_00EBAE(PC),A2
MOVE.L #'SYSM',+00022(A2)
CLR.B +00020(A2)
LEA +00092(A2),A2
MOVE.W #0079,D1
H_00F110 MOVE.B +000(A1,D1.W),+000(A2,D1.W)
DBRA D1,H_00F110
MOVEM.L (A7)+,D0-D1/A0-A2/A5
MOVE.W D0,-(A7)
BSR.L H_00FA30
MOVE.W (A7)+,D0
MOVE.W D7,-(A7)
DC.W $46C0 MOVE D0,SR
CMPI.W #+00256,D7 resident command ATCHDRV
BLT.S H_00F138
TRAP #00 $0 SYSCALL
DC.W $0009 CPRTERR
BRA.S H_00F144
H_00F138 CMPI.W #+000,D7
BEQ.S H_00F14A
BSR.L LOD_ERR_PRNT
H_00F144 CMPI.W #0,D7
BNE.S H_00F1D0
H_00F14A CMPA.L #0,A2
BEQ.S H_00F1C6
MOVEA.L #$0ABCDEF,A0
TRAP #5 resident command ATCHDRV
LEA H_00EBAE(PC),A6
MOVE.L 06(A6),D0
MOVE.L 10(A6),D1
MOVE.L A6,-(A7)
JSR (A2)
MOVEA.L (A7)+,A6
NOP
CMPI.W #+000,D7
BNE.S H_00F1BA
ROL.L #8,D0
CMPI.B #+035,D0 resident command ATCHDRV
BNE.S H_00F1BA
ROR.L #8,D0
LEA H_00EBAE(PC),A6
MOVE.L +00006(A6),+00030(A6)
MOVE.L +00010(A6),+00034(A6)
MOVE.L D0,+00006(A6)
MOVE.L D1,+00010(A6)
BSET #00,+00020(A6)
MOVEQ #003,D4 modify
TRAP #00 $0 SYSCALL
DC.W $0040 2-LodMgr
NOP
NOP
H_00F1AE CMPI.W #+000,D7 resident command ATCHDRV
BEQ.S H_00F1BA
BSR.L LOD_ERR_PRNT
H_00F1BA MOVEA.L #$00FEDCBA,A0
TRAP #05
BRA.S H_00F1D0
H_00F1C6 LEA H_00F24A,A6
TRAP #00 $0 SYSCALL
DC.W $0013 PrtErMsg*
H_00F1D0 CMPI.W #+000,D7
BEQ.S H_00F1E6
LEA H_00EBAE(PC),A6
MOVEQ #001,D4 unload
TRAP #00 $0 SYSCALL
DC.W $0040 2-LodMgr
NOP
NOP
H_00F1E6 RTS resident command ATCHDRV
H_00F1E8 TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L +00016(A5),A3
LEA +00416(A3),A6
MOVEA.L A6,A5
MOVE.W #$0019,D1
H_00F1FA CLR.B (A5)+
DBF D1,H_00F1FA
TRAP #00 SYSCALL
DC.W $000F FmtDib*
CMPI.B #+000,D0
BNE.S H_00F244
CMPI.W #+000,D7 resident command ATCHDRV
BNE.S H_00F238
TRAP #00 SYSCALL
DC.W $0010 NxTok*
CMPI.B #+013,+00411(A3)
BNE.S H_00F22C
MOVE.L (A6),D0
MOVE.W +00004(A6),D1
BRA.S H_00F248
H_00F238 EQU *
H_00F22C MOVE.W #$0101,D7 resident command ATCHDRV
TRAP #00 $0 SYSCALL
DC.W $0009 CPRTERR
H_00F234 EQU *
H_00F240 BRA.S H_00F248
H_00F244 NOP
NOP
H_00F248 RTS END OF CODE FOR resident command ATCHDRV
H_00F24A DC.B 'NO FILE TRANSFER ADDRESS',$D,$0
DS.W 0
*
*****************************************************************************
C_DTCHDRV EQU * this code implements the resident command DTCHDRV
H_00F264 CLR.B D0
BSR.S H_00F1E8
TRAP #08 $8 IOMGR8
DC.W $0006 DTACHDRV
NOP
NOP
H_00F270 MOVE.L D7,-(A7)
TRAP #00 $0 SYSCALL 2
DC.W $0030 2 SUP MODE
LEA H_00EBAE(PC),A6
MOVE.W #$0000,D2
H_00F282 MOVE.B #$00,+000(A6,D2.W) resident command DTCHDRV
ADDQ.W #1,D2
H_00F28A CMPI.W #+173,D2
BLE.S H_00F282
MOVE.L D0,+00030(A6)
MOVE.W D1,+00034(A6)
MOVE.W #$2020,+00036(A6)
TRAP #00 $0 SYSCALL 2
DC.W $0031 2 USERMODE
MOVEQ #001,D4 unload
TRAP #00 $0 SYSCALL 2
DC.W $0040 2-LodMgr
NOP
NOP
H_00F2AC MOVE.L (A7)+,D7
CMPI.W #+000,D7
BEQ.S H_00F2BA
BSR.L LOD_ERR_PRNT
H_00F2BA RTS END OF CODE FOR resident command DTCHDRV
*
*****************************************************************************
C_DIR EQU * this code implements the resident command dir
H_00F2BC TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L +00016(A5),A2
LEA H_00F7A6(PC),A6
MOVE.B #$F6,D5
TRAP #06 $6 IOMGR6/SYSIO
DC.W $0006 FUNC
BRA.L H_00F2D6
H_00F2D4 BRA.S H_00F2DC
H_00F2D6 TRAP #00 $0 SYSCALL
DC.W $000C PrtErr*
RTS
H_00F2DC CLR.B D4
LINK A3,#-00204 resident command DIR
MOVEA.L A7,A5
LEA +00024(A5),A6
MOVEQ #073,D2
H_00F2EA CLR.B (A6)+
DBF D2,H_00F2EA
LEA +00416(A2),A6
MOVEQ #073,D2
H_00F2F6 CLR.B (A6)+
DBF D2,H_00F2F6
LEA +00746(A2),A6
MOVEQ #015,D2
H_00F302 CLR.B (A6)+ resident command DIR
DBF D2,H_00F302
LEA +00746(A2),A6
LEA +00490(A2),A0
MOVE.L A0,+00004(A6)
MOVE.W #$0100,+00008(A6)
LEA +00416(A2),A6
TRAP #00 $0 SYSCALL
DC.W $0010 NxTok*
CMPI.B #+013,+00411(A2)
BNE.S H_00F332
BSR.L H_00F714
BRA.L H_00F470
H_00F332 CMPI.B #+044,+00411(A2) resident command DIR
BEQ.S H_00F342
CMPI.B #+059,+00411(A2)
BNE.S H_00F348
H_00F342 BSR.L H_00F714
BRA.S H_00F38E
H_00F348 MOVE.L +00404(A2),+00400(A2)
TRAP #00 $0 SYSCALL
DC.W $000F FmtDib*
CMPI.W #+002,D7
BEQ.S H_00F370
CMPI.W #+003,D7
BEQ.S H_00F370
CMPI.W #+001,D7 resident command DIR
BEQ.S H_00F36A
BRA.L H_00F6DC
H_00F368 BRA.S H_00F36E
H_00F36A BSR.L H_00F720
H_00F36E BRA.S H_00F38A
H_00F370 CMPI.W #+003,D7
BNE.S H_00F37A
BSET #02,D4
H_00F37A MOVE.L +00038(A6),(A5)
MOVE.L +00042(A6),+00004(A5)
MOVE.L +00046(A6),+00008(A5)
H_00F38A TRAP #00 $0 SYSCALL
DC.W $0010 NxTok* resident command DIR
H_00F38E CMPI.B #+044,+00411(A2)
BNE.L H_00F41E
LEA +00024(A5),A6
TRAP #00 $0 SYSCALL
DC.W $000F FmtDib*
CMPI.W #+000,D7
BEQ.S H_00F3AA
BRA.L H_00F6DC
H_00F3AA CMPI.L #'#SCR',(A6)
BNE.S H_00F3BC
CMPI.W #+20016,+00004(A6)
BNE.S H_00F3BC
BRA.S H_00F41A
H_00F3BC CMPI.L #'#SCR',(A6) resident command DIR
BEQ.S H_00F408
CMPI.L #'#FD0',(A6)
BEQ.S H_00F408
CMPI.L #'#HD0',(A6)
BEQ.S H_00F408
CMPI.L #'#CNS',(A6)
BEQ.S H_00F408
LEA +00098(A5),A4
MOVE.L #$000D0400,(A4)
MOVE.W #$0050,+00008(A4)
MOVE.B #$01,+00007(A6)
ORI.W #$0040,+00016(A6) resident command DIR
MOVE.B #$02,D5
TRAP #06 $6 IOMGR6/SYSIO
DC.W $0001 OPEN
BRA.L H_00F6D4
H_00F404 BSET #01,D4
H_00F408 BTST #01,D4
BNE.S H_00F41A
LEA H_00F751(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0013 PrtErMsg*
BRA.L H_00F6D8
H_00F41A TRAP #00 $0 SYSCALL
DC.W $0010 NxTok* resident command DIR
H_00F41E CMPI.B #+059,+00411(A2)
BNE.S H_00F464
MOVEA.L +00400(A2),A0
CMPI.B #+013,(A0)
BNE.S H_00F434
BRA.L H_00F6DC
H_00F434 CMPI.B #+013,(A0)
BEQ.S H_00F462
CMPI.B #+069,(A0)
BNE.S H_00F446
BSET #03,D4
BRA.S H_00F45E
H_00F446 CMPI.B #+083,(A0) resident command DIR
BNE.S H_00F452
BSET #04,D4
BRA.S H_00F45E
H_00F452 MOVE.W #$0102,D7
TRAP #00 $0 SYSCALL
DC.W $0009 CPRTERR
BRA.L H_00F6A2
H_00F45E ADDQ.L #1,A0
BRA.S H_00F434
H_00F462 BRA.S H_00F470
H_00F464 CMPI.B #+013,+00411(A2)
BEQ.S H_00F470
BRA.L H_00F6DC
H_00F470 LEA +00416(A2),A6 resident command dir
MOVE.L H_00F79E(PC),+00038(A6)
MOVE.L H_00F7A2(PC),+00042(A6)
MOVE.B H_00F79E(PC),+00046(A6)
MOVE.B H_00F79F(PC),+00047(A6)
MOVE.B H_00F7A0(PC),+00048(A6)
MOVE.B #$01,+00006(A6)
MOVE.W #$000C,+00012(A5)
CLR.W +00022(A5)
LEA +00012(A5),A4
MOVE.L A4,+00018(A6)
MOVE.L (A6),D1
MOVE.W +00004(A6),D2
ORI.W #$0040,+00016(A6)
MOVE.B #$01,D5
BSR.L SUB_OPEN
H_00F4C2 CMPI.W #+000,D7
BEQ.S H_00F4CC
BRA.L H_00F6A2
H_00F4CC LEA H_00F750(PC),A6
BSR.L H_00F6E6
CMPI.W #+000,D7 resident command dir
BEQ.S H_00F4DE
BRA.L H_00F6A2
H_00F4DE LEA H_00F732(PC),A6
BSR.L H_00F6E6
LEA +01108(A2),A6
MOVE.B +00021(A5),(A6)
MOVE.B #$04,+00001(A6)
BSR.L H_00F6E6
LEA H_00F746(PC),A6
BSR.L H_00F6E6
LEA +01108(A2),A6
LEA +00416(A2),A4 resident command dir
MOVE.L (A4),(A6)
MOVE.W +00004(A4),+00004(A6)
MOVE.B #$0D,+00006(A6)
BSR.L H_00F6E6
LEA H_00F750(PC),A6
BSR.L H_00F6E6
CMPI.W #+000,D7
BEQ.S H_00F52C
BRA.L H_00F6A2
H_00F52C BTST #03,D4
BNE.S H_00F53C
BTST #04,D4 resident command dir
BNE.S H_00F53C
BRA.L H_00F5D0
H_00F53C LEA +00416(A2),A6
MOVE.L D1,(A6)
MOVE.W D2,+00004(A6)
SUBA.L #$000000AE,A7
MOVEA.L A7,A6
MOVEA.L A6,A0
MOVE.L #$000000AD,D0
H_00F556 CLR.B (A0)+
DBF D0,H_00F556
MOVE.L D4,D0 resident command dir
MOVE.L #'DIR ',+00006(A6)
MOVE.L #' ',+00010(A6)
MOVE.W #'EX',+00014(A6)
MOVE.B #'E',+00016(A6)
MOVE.B #$03,+00018(A6)
MOVEQ #007,D4 load W/O SEARCH
C_D_LOD TRAP #00 $0 SYSCALL
DC.W $0040 2-LodMgr
NOP
NOP
CMPI.W #$70FE,D7 MODULE ALREADY EXISTS?
BEQ.S C_D_INQ YES - LOOK IT UP
CMP.B #8,D4 HAVE WE TRIED LOAD W/ SEARCH
BEQ.S H_00F58A YES - LEAVE
MOVE.B #8,D4 PREPARE FOR LOAD W/ SEARCH
CMPI.W #0,D7 ERRORS?
BEQ.S H_00F590 NO - LEAVE
BRA C_D_LOD YES - TRY AGAIN W/ SEARCH
C_D_INQ MOVE.L 6(A6),$1E(A6) COULDN'T LOAD - MODULE ALREADY EXISTS
MOVE.L 10(A6),$22(A6) SO LOOK IT UP VIA INQLOAD
CLR.B $14(A6)
MOVEQ #2,D4
BRA C_D_LOD
H_00F58A CMPI.W #+000,D7
BNE.S H_00F5B0
H_00F590 MOVE.L D0,D4
MOVE.L #'POLY',D3 resident command dir
MOVEA.L +00072(A6),A1
MOVE.L A6,-(A7)
JSR (A1)
MOVEA.L (A7)+,A6
H_00F5AE BRA.S H_00F5C6
H_00F5B0 CMPI.W #+130,D7
BNE.S H_00F5C2
LEA H_00F767(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0013 PrtErMsg* resident command dir
BRA.S H_00F5C6
H_00F5C2 TRAP #00 $0 SYSCALL
DC.W $0009 CPRTERR
H_00F5C6 ADDA.L #$000000AE,A7
BRA.L H_00F6A6
H_00F5D0 LEA (A5),A0
MOVEQ #001,D2
H_00F5D4 LEA +00746(A2),A6
MOVEQ #001,D5
TRAP #00 $0 SYSCALL
DC.W $0028 SrcDir
CMPI.W #+000,D7 resident command dir
BEQ.S H_00F5E8
BRA.L H_00F6A2
H_00F5E8 CMPA.L #$00000000,A1
BEQ.L H_00F676
MOVEA.L A1,A6
MOVE.B +00010(A1),+00011(A1)
MOVE.B +00009(A1),+00010(A1)
MOVE.B +00008(A1),+00009(A1)
MOVE.B #$2E,+00008(A1)
MOVE.L D2,D3
ADDQ.L #1,D2
LSR.B #1,D3 resident command dir
BCS.S H_00F620
LSR.B #1,D3
BCS.S H_00F620
MOVE.B #$0D,+00012(A1)
BRA.S H_00F64A
H_00F620 MOVE.B #$04,+00012(A1)
BSR.L H_00F6E6
CMPI.W #+000,D7
BEQ.S H_00F632
CLR.L D2
H_00F632 LEA +01108(A2),A6
MOVE.L #' ',(A6) resident command dir
MOVE.L #' ',+00004(A6)
MOVE.B #$04,+00008(A6)
H_00F64A BSR.L H_00F6E6
CMPI.W #+000,D7
BEQ.S H_00F656
CLR.L D2
H_00F656 DC.W $0C38,$0000 CMPI.B #+000,$43B0 CHECK CTRL-Break BYTE
DC.W $43B0
BEQ.S H_00F662
CLR.L D2
BRA.S H_00F674
H_00F662 DC.W $0C38,$0000 CMPI.B #+000,$43B1 CHECK CTRL-NumLock Byte
DC.W $43B1 resident command dir
BEQ.S H_00F674
CLR.L D0
MOVEQ #001,D1
TRAP #00 $0 SYSCALL
DC.W $001D Delay
BRA.S H_00F662
H_00F674 BRA.S H_00F68A
H_00F676 CMPI.L #$00000001,D2
BNE.S H_00F688
MOVE.W #$0103,D7
TRAP #00 $0 SYSCALL
DC.W $0009 CPRTERR resident command dir
CLR.W D7
H_00F688 CLR.L D2
H_00F68A CMPI.L #$00000000,D2
BNE.L H_00F5D4
LEA H_00F750(PC),A6
BSR.S H_00F6E6
LEA H_00F750(PC),A6
BSR.S H_00F6E6
BRA.S H_00F6A6
H_00F6A2 TRAP #00 $0 SYSCALL
DC.W $000C PrtErr*
H_00F6A6 BTST #01,D4 resident command dir
BEQ.S H_00F6BC
DC.W $4DF8,$0000 LEA $0000,A6
MOVE.B #$02,D5
TRAP #06 $6 IOMGR6/SYSIO
DC.W $0002 CLOSE
BRA.L H_00F6BE
H_00F6BC BRA.S H_00F6C2
H_00F6BE TRAP #00 $0 SYSCALL
DC.W $000C PrtErr*
H_00F6C2 DC.W $4DF8,$0000 LEA $0000,A6
MOVE.B #$01,D5
TRAP #06 $6 IOMGR6/SYSIO
DC.W $0002 CLOSE
BRA.L H_00F6D8
H_00F6D2 BRA.S H_00F6D8
H_00F6D4 TRAP #00 $0 SYSCALL
DC.W $000C PrtErr*
H_00F6D8 UNLK A3
RTS
H_00F6DC MOVE.W #$0101,D7
TRAP #00 $0 SYSCALL
DC.W $0009 CPRTERR
BRA.S H_00F6A6
H_00F6E6 BTST #01,D4 resident command dir
BNE.S H_00F6F2
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
RTS
H_00F6F2 MOVEA.L A6,A4
LEA +00098(A5),A6
MOVE.L A4,+00004(A6)
CLR.W +00010(A6)
MOVE.B #$02,D5
TRAP #06 $6 IOMGR6/SYSIO WRITE
DC.W $0004 WRITE resident command dir
BRA.L H_00F70E
H_00F70C RTS
H_00F70E TRAP #00 $0 SYSCALL
DC.W $000C PrtErr*
H_00F712 RTS
H_00F714 MOVE.L #' ',(A6)
MOVE.W #' ',+00004(A6)
H_00F720 BSET #02,D4
LEA H_00F79A(PC),A0
LEA (A5),A1
MOVEQ #003,D0
TRAP #00 $0 SYSCALL
DC.W $0014 FMTS resident command dir
RTS
H_00F746 EQU *+00000020
H_00F732 DC.B 'DIRECTORY OF DRIVE=',$4,' VOLUME=',$4
H_00F750 DC.B $0D
H_00F751 DC.B 'ILLEGAL OUTPUT DEVICE',$D
H_00F767 DC.B 'DIR.EXE NEEDED TO PROCESS OPTIONS',$D
DS.W 0
H_00F79A DC.B '*.*',$0
H_00F79F EQU *+01
H_00F7A0 EQU *+02
H_00F7A2 EQU *+04
H_00F79E: DC.B 'DIR '
H_00F7A6 DC.L $00070000 ORI.B #$00,D7 $00F7A6
*
*****************************************************************************
C_SET EQU * this code implements the resident command SET
H_00F7AA BSR.S H_00F7C2
CMPI.W #+00400,D7
BNE.S H_00F7C0
LEA H_010B04(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0013 PrtErMsg*
CLR.W D7 this code implements the resident command SET
H_00F7C0 RTS
H_00F7C2 TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L +00016(A5),A2
LEA +00416(A2),A6
MOVEA.L A6,A0
MOVEQ #073,D1
H_00F7D2 CLR.B (A0)+
DBF D1,H_00F7D2
LEA +00490(A2),A5
LEA +00746(A2),A4
TRAP #00 $0 SYSCALL
DC.W $0010 NxTok*
CMPI.B #+001,+00411(A2)
BNE.S H_00F7F6
CMPI.W #+002,+00408(A2) code for resident command SET
BEQ.S H_00F7FC
* address $00FC2474 is Plug in tray ROM
H_00F7F6 JMP $00FC2474 $101 syntax error
H_00F7FC MOVEA.L +00404(A2),A0
MOVE.B (A0),D1
ASL.W #8,D1
MOVE.B +00001(A0),D1
* address $00FC24AE is Plug in tray ROM
LEA $00FC24AE,A0
H_00F80E CMP.W (A0),D1
BEQ.S H_00F828
ADDA.L #$00000012,A0
TST.W (A0) code for resident command SET
BNE.S H_00F826
* address $00FC247E is Plug in tray ROM
JMP $00FC247E .L
H_00F826 BRA.S H_00F80E
H_00F828 TRAP #00 $0 SYSCALL
DC.W $0010 NxTok*
CMPI.B #'=',+00411(A2)
BEQ.S H_00F850
CMPI.B #+013,+00411(A2)
BNE.S H_00F84A
* address $00FC1FCE is Plug in tray ROM
JMP $00FC1FCE .L code for resident command SET
H_00F846 BRA.S H_00F850
* address $00FC2474 is Plug in tray ROM
H_00F84A JMP $00FC2474 .L
H_00F850 CMPI.W #'NT',D1
BEQ.S H_00F85E
CMPI.W #'SM',D1
BEQ.L SETSM
* address $00FC217A is Plug in tray ROM
JMP $00FC217A .L
H_00F85E TRAP #00 $0 SYSCALL
DC.W $0010 NxTok*
CMPI.B #+045,+00411(A2)
BNE.S H_00F886
TRAP #00 $0 SYSCALL
DC.W $0010 NxTok* code for resident command SET
CMPI.B #+003,+00411(A2)
BEQ.S H_00F87E
* address $00FC2484 is Plug in tray ROM
JMP $00FC2484 .L
H_00F87E MOVE.L +00412(A2),D0
NEG.L D0
BRA.S H_00F8A6
H_00F886 CMPI.B #+043,+00411(A2)
BNE.S H_00F892
TRAP #00 $0 SYSCALL
DC.W $0010 NxTok*
H_00F892 CMPI.B #+003,+00411(A2) code for resident command SET
BEQ.S H_00F8A2
* address $00FC2484 is Plug in tray ROM
JMP $00FC2484 .L
H_00F8A2 MOVE.L +00412(A2),D0
H_00F8A6 TRAP #00 $0 SYSCALL
DC.W $0010 NxTok*
CMPI.B #+013,+00411(A2)
BEQ.S H_00F8BA
* address $00FC2474 is Plug in tray ROM
JMP $00FC2474 .L
H_00F8BA CMPI.W #+003,D0 code for resident command SET
BLE.S H_00F8C8
CMPI.W #+064,D0
BLE.S H_00F8CE
* address $00FC2484 is Plug in tray ROM
H_00F8C8 JMP $00FC2484 .L
H_00F8CE MOVEM.L D0-D7/A0-A6,-(A7)
DC.W $2278,$0A56 MOVEA.L $0A56,A1
ADDA.L #$000005DC,A1
DC.W $3E38,$0A54 MOVE.W $0A54,D7
SUBQ.W #3,D7
CLR.L D1
H_00F8E4 TST.B +00008(A1) code for resident command SET
BEQ.S H_00F8F0
TST.L (A1)
BEQ.S H_00F8F0
ADDQ.B #1,D1
H_00F8F0 ADDA.L #$000002EE,A1
DBF D7,H_00F8E4
TST.B D1
BEQ.S H_00F908
MOVEM.L (A7)+,D0-D7/A0-A6
* address $00FC2490 is Plug in tray ROM
JMP $00FC2490 .L
H_00F908 MOVE.W D0,D1 code for resident command SET
MULU #$02EE,D1
SUBA.L #$00000014,A7
MOVEA.L A7,A6
MOVE.L D1,+00004(A6)
CLR.L +00008(A6)
CLR.L (A6)
CLR.L +00016(A6)
MOVEQ #005,D4 GETMEM
MOVE.L #'SYSM',D5
TRAP #00 $0 SYSCALL
DC.W $0039 MEM_MGR
NOP
NOP
H_00F934 MOVEA.L 012(A6),A1 code for resident command SET
ADDA.L #$014,A7
CMPI.W #0,D7
BEQ.S H_00F94E
MOVEM.L (A7)+,D0-D7/A0-A6
* address $00FC249C is Plug in tray ROM
JMP $00FC249C .L
H_00F94E DC.W $40C1 MOVE SR,D1
TRAP #00 $0 SYSCALL 2
DC.W $0030 2 SUP MODE
DC.L $007C0700 ORI.W #$0700,SR
DC.W $2F38,$0A56 MOVE.L $0A56,-(A7)
DC.W $2078,$0A56 MOVEA.L $0A56,A0
DC.W $21C9,$0A56 MOVE.L A1,$0A56
DC.W $31C0,$0A54 MOVE.W D0,$0A54
* address $00FC02FE is Plug in tray ROM
JSR $00FC02FE .L code for resident command SET
MOVE.W #$02ED,D7
H_00F972 MOVE.B (A0)+,(A1)+
DBF D7,H_00F972
MOVEA.L (A7)+,A1
MOVEA.L +00086(A1),A3
SUBA.L A1,A3
DC.W $2078,$0A56 MOVEA.L $0A56,A0
ADDA.L A0,A3
MOVE.L A3,+00086(A0)
DC.W $0CB8 CMPI.L #$00000000,$0A18
DC.W 0,0
DC.W $0A18 code for resident command SET
BEQ.S H_00F9A2
DC.W $2678,$0A18 MOVEA.L $0A18,A3
SUBA.L A1,A3
DC.W $D7F8,$0A56 ADDA.L $0A56,A3
DC.W $21CB,$0A18 MOVE.L A3,$0A18
H_00F9A2 DC.W $0CB8 CMPI.L #$00000000,$0A1C
DC.L 0
DC.W $0A1C
BEQ.S H_00F9BA
DC.W $2678,$0A1C MOVEA.L $0A1C,A3
SUBA.L A1,A3 code for resident command SET
DC.W $D7F8,$0A56 ADDA.L $0A56,A3
DC.W $21CB,$0A1C MOVE.L A3,$0A1C
H_00F9BA DC.W $46C1 MOVE D1,SR
MOVEA.L A1,A0
* address $00FD60BA is Plug in tray ROM
JSR $00FD60BA .L
MOVEM.L (A7)+,D0-D7/A0-A6
RTS code for resident command SET
*
*****************************************************************************
NEW_SC14 EQU * NEW CODE FOR SysCall 14 LOADB
H_00FA0C LEA H_00EBAE(PC),A4
MOVE.L #'USRM',+00022(A4)
CLR.B 020(A4)
BSET #01,020(A4)
BSR.S H_00FA30
MOVE.L A2,044(A7)
MOVE.W D7,034(A7)
RTS
H_00FA30 MOVEA.L #0,A2
CLR.L D7
SUBA.L #$06,A7
MOVE.W #$0002,(A7) NEW CODE FOR SysCall 14 LOADB
CLR.W 04(A7)
MOVE.L A7,018(A6)
ORI.W #$0040,016(A6)
BSR.L SUB_OPEN
H_00FA58 MOVE.W 02(A7),D0
ADDA.L #$06,A7
CMPI.W #0,D7
BNE.L H_00FB42
CMPI.W #02,D0 NEW CODE FOR SysCall 14 LOADB
BNE.S H_00FB30
LEA H_00EBAE(PC),A4
MOVE.B 049(A6),088(A4)
CMPI.B #4,+00049(A6)
BNE.S H_00FAEA
BSR.L SUB_CLOSE
H_00FA96 MOVE.W #5,D0 NEW CODE FOR SysCall 14 LOADB
H_00FAA0 MOVE.B 0(A6,D0.W),0(A4,D0.W)
DBRA D0,H_00FAA0
MOVE.W #7,D0
H_00FAB6 MOVE.B +038(A6,D0.W),+006(A4,D0.W)
DBRA D0,H_00FAB6
MOVE.W #02,D0 NEW CODE FOR SysCall 14 LOADB
H_00FACC MOVE.B +046(A6,D0.W),+014(A4,D0.W)
DBRA D0,H_00FACC
CMPI.W #0,D7
BNE.S H_00FAE6
BSR.L H_00FDAA
H_00FAE6 BRA.S H_00FB2C
H_00FAEA CMPI.B #01,+00049(A6)
BCS.S H_00FB16
LEA.L B_UL(PC),A5 SET UNLOAD INDIC
MOVE.B #3,(A5) AND LOAD .BIN ANYWAY!
TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L +00016(A5),A5 NEW CODE FOR SysCall 14 LOADB
SC14_BIN BSR.S H_00FB52
H_00FB12 BRA.S H_00FB1A
H_00FB16 MOVE.W #$0151,D7
H_00FB1A MOVE.W D7,-(A7) NEW CODE FOR SysCall 14 LOADB
BSR.L CLOS_SUB
H_00FB2A MOVE.W (A7)+,D7
H_00FB2C BRA.S H_00FB42
H_00FB30 BSR.L CLOS_SUB
H_00FB3E MOVE.W #$0151,D7
H_00FB42 CMPI.W #+000,D7 NEW CODE FOR SysCall 14 LOADB
BEQ.S H_00FB50
MOVEA.L #$00000000,A2
H_00FB50 RTS
H_00FB52 MOVEM.L D0/D4-D5/A4-A6,-(A7)
MOVE.W +00026(A6),D0
MULU #$00FC,D0
MOVE.L D0,+00044(A4)
MOVE.B D5,+00018(A4)
SUBA.L #$00000014,A7
MOVEA.L A7,A6
MOVEQ #019,D0
H_00FB74 MOVE.B #0,0(A6,D0.W) NEW CODE FOR SysCall 14 LOADB
DBRA D0,H_00FB74
MOVE.L #$0E000,012(A6) START
MOVE.L 044(A4),04(A6) LEN
MOVE.L D5,-(A7)
MOVEQ #8,D4 NEW MEMMGR FUNCTION
MOVE.L #'USRM',D5
TRAP #00 $0 SYSCALL
DC.W $0039 MEM_MGR
NOP
NOP
H_00FBA4 MOVE.L (A7)+,D5
CMPI.W #+000,D7 NEW CODE FOR SysCall 14 LOADB
BNE.L H_00FD68
MOVE.L A6,-(A7)
TRAP #0 SYSCALL
DC.W $0034 GBasPtr
MOVE.L 012(A6),040(A4) START
MOVE.L 004(A6),044(A4) LEN
MOVEA.L 012(A6),A0 START
MOVE.L 004(A6),D0 LEN
LEA 0(A0,D0.L),A1
SUBA.L #$014,A7
MOVEA.L A7,A6
MOVE.W #19,D0 NEW CODE FOR SysCall 14 LOADB
H_00FBDC CLR.B 0(A6,D0.W)
DBRA D0,H_00FBDC
MOVE.L #$0110,04(A6)
MOVE.L D5,-(A7)
MOVEQ #5,D4 GETMEM
MOVE.L #'SYSM',D5
TRAP #0 SYSCALL
DC.W $0039 MEM_MGR
NOP
NOP
H_00FC02 MOVE.L (A7)+,D5 NEW CODE FOR SysCall 14 LOADB
CMPI.W #+000,D7
BNE.L H_00FD40
MOVE.L A6,-(A7)
MOVEA.L +00012(A6),A6
LEA +00016(A6),A5
MOVE.W #$0000,D6
H_00FC1A MOVE.L A5,+00004(A6)
MOVE.W #$0001,+00008(A6)
BSR.L H_00FD74
CMPI.W #+000,D7
BNE.L H_00FCEA
CMPI.B #+003,(A5) NEW CODE FOR SysCall 14 LOADB
BNE.S H_00FC6C
MOVE.W #$0006,+00008(A6)
BSR.L H_00FD74
CMPI.W #+000,D7
BNE.S H_00FC68
MOVEA.L (A5),A3
MOVE.W +00004(A5),D1
BSR.L H_00FD92
CMPI.W #+000,D7
BNE.S H_00FC68
MOVE.L A3,+00004(A6)
MOVE.W D1,+00008(A6) NEW CODE FOR SysCall 14 LOADB
BSR.L H_00FD74
H_00FC68 BRA.S H_00FCE6
H_00FC6C CMPI.B #+002,(A5)
BNE.S H_00FCAA
MOVE.W #$0005,+00008(A6)
BSR.L H_00FD74
CMPI.W #+000,D7
BNE.S H_00FCA6
MOVEA.L (A5),A3
CLR.W D1
MOVE.B +00004(A5),D1
BSR.L H_00FD92
CMPI.W #+000,D7 NEW CODE FOR SysCall 14 LOADB
BNE.S H_00FCA6
MOVE.L A3,+00004(A6)
MOVE.W D1,+00008(A6)
BSR.L H_00FD74
H_00FCA6 BRA.S H_00FCE6
H_00FCAA CMPI.B #+022,(A5)
BNE.S H_00FCE2
MOVE.W #$0004,+00008(A6)
BSR.L H_00FD74
CMPI.W #+000,D7
BNE.S H_00FCEC
MOVEA.L (A5),A2
CMPA.L A2,A0 NEW CODE FOR SysCall 14 LOADB
BGT.S H_00FCD0
CMPA.L A2,A1
BGE.S H_00FCDA
H_00FCD0 MOVE.W #$0152,D7
MOVEA.L #$00000000,A2
H_00FCDA MOVE.L A2,+00072(A4)
H_00FCDE BRA.S H_00FCEC
H_00FCE2 MOVE.B #$FF,D6
H_00FCE6 BRA.S H_00FCEC
H_00FCEA MOVE.W D7,D6
H_00FCEC CMPI.W #+000,D6
BEQ.L H_00FC1A
CMPI.W #+000,D7 NEW CODE FOR SysCall 14 LOADB
BNE.S H_00FD26
CMPA.L #$00000000,A2
BEQ.S H_00FD22
TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVE.L A0,+00004(A5)
SUBA.L #$00000002,A1
MOVE.L A1,+00008(A5)
ADDA.L #$00000002,A1
BRA.S H_00FD26
H_00FD22 MOVE.W #$0153,D7
H_00FD26 MOVEA.L (A7)+,A6 NEW CODE FOR SysCall 14 LOADB
MOVE.L D7,-(A7)
MOVE.L D5,-(A7)
MOVEQ #006,D4 GIVMEM
MOVE.L #'SYSM',D5
TRAP #00 $0 SYSCALL
DC.W $0039 MEM_MGR
NOP
NOP
H_00FD3C MOVE.L (A7)+,D5
MOVE.L (A7)+,D7
H_00FD40 ADDA.L #$00000014,A7
MOVEA.L (A7)+,A6
CMPI.W #+000,D7 NEW CODE FOR SysCall 14 LOADB
BEQ.S H_00FD68
MOVE.L D7,-(A7)
MOVE.L D5,-(A7)
MOVEQ #006,D4 GIVMEM
MOVE.L #'USRM',D5
TRAP #00 $0 SYSCALL
DC.W $0039 MEM_MGR
NOP
NOP
H_00FD64 MOVE.L (A7)+,D5
MOVE.L (A7)+,D7
H_00FD68 ADDA.L #$00000014,A7
MOVEM.L (A7)+,D0/D4-D5/A4-A6
RTS NEW CODE FOR SysCall 14 LOADB
H_00FD74 CLR.W 010(A6)
TRAP #06 IOMGR6/SYSIO
DC.W $0003 READ
NOP
NOP
H_00FD80 CMPI.W #+133,D7
BNE.S H_00FD90
CLR.W D7
CLR.B (A5)
MOVE.B #$FF,D6
H_00FD90 RTS
H_00FD92 MOVE.L A4,-(A7)
LEA +000(A3,D1.W),A4
CMPA.L A3,A0 NEW CODE FOR SysCall 14 LOADB
BGT.S H_00FDA2
CMPA.L A4,A1
BGE.S H_00FDA6
H_00FDA2 MOVE.W #$0153,D7
H_00FDA6 MOVEA.L (A7)+,A4
RTS
H_00FDAA MOVEM.L D0/D4/A4/A6,-(A7)
TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L +00016(A5),A0
LEA +01108(A0),A1
MOVE.L +00400(A0),D0 NEW CODE FOR SysCall 14 LOADB
SUB.L A1,D0
MOVEM.L D1-D3,-(A7)
MOVE.L D0,D3
MOVE.B +000(A1,D0.W),D2
CLR.L D1
CMPI.B #+032,D2
BEQ.S H_00FE0E
H_00FDD4 CMPI.W #+080,D0
BLT.S H_00FDE2
MOVE.B #$FF,D1
MOVE.B D3,D0
H_00FDE2 MOVE.B +000(A1,D0.W),D2
CMPI.B #+032,D2 NEW CODE FOR SysCall 14 LOADB
BNE.S H_00FDF2
MOVE.B #$FF,D1
H_00FDF2 CMPI.B #+013,D2
BNE.S H_00FDFE
MOVE.B #$FF,D1
H_00FDFE CMPI.B #+255,D1
BEQ.S H_00FE08
ADDQ.W #1,D0
H_00FE08 CMPI.B #+255,D1
BNE.S H_00FDD4
H_00FE0E MOVEM.L (A7)+,D1-D3
MOVE.W D0,+00172(A4) NEW CODE FOR SysCall 14 LOADB
LEA +00092(A4),A5
MOVE.W #$0000,D0
H_00FE22 MOVE.B +000(A1,D0.W),+000(A5,D0.W)
ADDQ.W #1,D0
H_00FE2A CMPI.W #+079,D0
BLE.S H_00FE22
MOVE.B D5,+00018(A4)
MOVEA.L A4,A6
MOVEQ #000,D4 load
TRAP #00 $0 SYSCALL
DC.W $0040 2-LodMgr
BRA.L H_00FE5E NEW CODE FOR SysCall 14 LOADB
MOVEA.L 072(A6),A2
CMPA.L #$00000000,A2
BNE.S H_00FE64
MOVEA.L +00040(A6),A2
H_00FE5A BRA.S H_00FE64
H_00FE5E MOVEA.L #$00000000,A2
H_00FE64 MOVEM.L (A7)+,D0/D4/A4/A6
RTS END OF NEW CODE FOR SysCall 14 LOADB
*
*****************************************************************************
NEW_SC25 EQU * NEW CODE FOR GETPCB SysCall
H_00FE6A DC.W $3C38,$0A54 MOVE.W $0A54,D6
DC.W $2278,$0A56 MOVEA.L $0A56,A1
CLR.L D7
DC.W $40E7 MOVE SR,-(A7)
TRAP #01 MASK OFF INTs 0,1
CMPI.B #+001,D0
BGE.S H_00FE88
MOVE.B #$02,D0
MOVE.B #$FF,D7
H_00FE88 CMPI.B #+000,D7
BNE.S H_00FEAA
ROR.W #8,D0
CMPI.B #+000,D0 NEW CODE FOR GETPCB SysCall
BEQ.S H_00FEA8
MOVE.W +00066(A7),D3
BTST #13,D3
BNE.S H_00FEA8
CLR.B D0
H_00FEA8 ROR.W #8,D0
H_00FEAA CMPI.B #+000,D7
BNE.S H_00FEF2
MOVE.W #$0001,D6
H_00FEB6 CMPI.B #+000,D7 NEW CODE FOR GETPCB SysCall
BNE.S H_00FEF2
DC.W $BC78,$0A54 CMP.W $0A54,D6
BGT.S H_00FEF2
CMPI.B #+000,+00008(A1)
BEQ.S H_00FEE8
CMP.L (A1),D1
BNE.S H_00FEE8
CMP.L +00004(A1),D2
BNE.S H_00FEE8
MOVE.B #$FF,+00009(A7)
MOVE.B #$FF,D7 NEW CODE FOR GETPCB SysCall
H_00FEE8 ADDA.L #$000002EE,A1
ADDQ.W #1,D6
BRA.S H_00FEB6
H_00FEF2 CMPI.B #+000,D7
BNE.S H_00FF56
MOVE.W #$0001,D6
DC.W $2278,$0A56 MOVEA.L $0A56,A1
CLR.L D5
H_00FF04 CMPI.B #+000,D7
BNE.S H_00FF4A
DC.W $BC78,$0A54 CMP.W $0A54,D6
BGT.S H_00FF4A
CMPI.B #+000,+00008(A1)
BNE.S H_00FF26
MOVE.W D6,D5 NEW CODE FOR GETPCB SysCall
MOVEA.L A1,A5
BRA.S H_00FF40
H_00FF26 DC.W $BC78,$0A54 CMP.W $0A54,D6
BLT.S H_00FF40
CMPI.W #+000,D5
BNE.S H_00FF40
MOVE.B #$01,+00009(A7)
MOVE.B #$FF,D7
H_00FF40 ADDA.L #$000002EE,A1
ADDQ.W #1,D6
BRA.S H_00FF04
H_00FF4A CMPI.B #+000,D7 NEW CODE FOR GETPCB SysCall
BNE.S H_00FF56
MOVEA.L A5,A1
MOVE.W D5,D6
H_00FF56 CMPI.B #+000,D7
BNE.L H_010076
MOVE.B D6,+00013(A7)
MOVE.W #0749,D6
H_00FF6A MOVE.B #0,0(A1,D6.W)
DBRA D6,H_00FF6A
CLR.B +00009(A7) NEW CODE FOR GETPCB SysCall
MOVE.L D1,(A1)
MOVE.L D2,+00004(A1)
MOVE.B D0,+00009(A1)
MOVE.B #$01,+00008(A1)
MOVEM.L D0-D2,-(A7)
TRAP #00 $0 SYSCALL
DC.W $0017 GetTim
MOVE.B D2,+00019(A1)
LSR.L #8,D2
MOVE.B D2,+00018(A1)
LSR.L #8,D2 NEW CODE FOR GETPCB SysCall
MOVE.B D2,+00017(A1)
MOVE.B D1,+00016(A1)
LSR.L #8,D1
MOVE.B D1,+00015(A1)
LSR.L #8,D1
MOVE.B D1,+00014(A1)
MOVEM.L (A7)+,D0-D2
CLR.L +00010(A1)
LEA +00750(A1),A2
MOVE.L A6,-(A2)
ROR.W #8,D0 NEW CODE FOR GETPCB SysCall
LEA H_01007A(PC),A6
MOVE.W #0173,D6
H_00FFD0 MOVE.B #0,0(A6,D6.W)
DBRA D0,H_00FFD0
MOVE.L D1,030(A6)
MOVE.L D2,034(A6)
MOVEQ #002,D4 inqload
TRAP #0 SYSCALL
DC.W $0040 2-LodMgr
BRA.L H_010046
H_00FFFF EQU *+07
CMPI.L #0,060(A6)
BLE.S H_010042
MOVE.L 048(A6),D6
ADD.L 052(A6),D6
ADD.L 056(A6),D6
ADD.L 060(A6),D6
SUBQ.L #4,D6
MOVEA.L D6,A6
CMPI.B #+000,D0 NEW CODE FOR GETPCB SysCall
BNE.S H_010030
MOVE.W #0,-(A2)
MOVE.L A6,090(A1)
MOVE.L A2,086(A1)
BRA.S H_010066
H_010030 MOVE.L (A2)+,-(A6)
MOVE.W #$2000,-(A6)
MOVE.L A6,086(A1)
MOVE.L #0,090(A1)
H_010042 BRA.S H_010066
H_010046 CMPI.B #0,D0 NEW CODE FOR GETPCB SysCall
BNE.S H_010056
MOVE.W #0,-(A2)
BRA.S H_01005A
H_010056 MOVE.W #$2000,-(A2)
H_01005A MOVE.L A2,086(A1)
MOVE.L #0,090(A1)
H_010066 MOVE.L D1,026(A1)
MOVE.L D2,030(A1)
ROR.W #8,D0 NEW CODE FOR GETPCB SysCall
* address $00FD10A4 is Plug in tray ROM
JSR $00FD10A4 .L
H_010076 DC.W $46DF MOVE (A7)+,SR
RTS END OF NEW CODE FOR GETPCB SysCall
H_010128 EQU *+00000174
H_01007A DCB.W 00124,+00000
*
*****************************************************************************
NEW_SC26 EQU * NEW CODE FOR GIVPCB SysCall
H_010172 CLR.L D7
DC.W $2278,$0A1C MOVEA.L $0A1C,A1
CMPI.B #+000,D0
BEQ.S H_0101C4
SUBQ.B #1,D0
CMPI.B #+000,D0
BNE.S H_010194
MOVE.B #$04,+00007(A7)
MOVE.B #$FF,D7
H_010194 CMPI.B #+001,D0
BLE.S H_0101A2
DC.W $B038,$0A55 CMP.B $0A55,D0
BLT.S H_0101AC
H_0101A2 MOVE.B #$01,+00007(A7)
MOVE.B #$FF,D7 NEW CODE FOR GIVPCB SysCall
H_0101AC CMPI.W #+000,D7
BNE.S H_0101C0
DC.W $2278,$0A56 MOVEA.L $0A56,A1
EXT.W D0
MULU #$02EE,D0
ADDA.L D0,A1
H_0101C0 BRA.S H_0101E8
H_0101C4 MOVE.L #'SYST',D1
MOVE.L #'EM ',D2
CMP.L (A1),D1 NEW CODE FOR GIVPCB SysCall
BNE.S H_0101E8
CMP.L +00004(A1),D2
BNE.S H_0101E8
MOVE.B #$04,+00007(A7)
MOVE.B #$FF,D7
H_0101E8 CMPI.B #+000,D7
BNE.S H_01024E
TRAP #01 ?? EnterMon ??
LEA H_01007A(PC),A6
MOVE.W #$0000,D6 NEW CODE FOR GIVPCB SysCall
H_0101FE MOVE.B #$00,+000(A6,D6.W)
ADDQ.W #1,D6
H_010206 CMPI.W #+173,D6
BLE.S H_0101FE
MOVE.L (A1),+00030(A6)
MOVE.L +00004(A1),+00034(A6)
MOVEM.L A6,-(A7)
BSR.S H_010250
MOVEM.L (A7)+,A6 NEW CODE FOR GIVPCB SysCall
MOVEQ #001,D4 unload
TRAP #00 $0 SYSCALL
DC.W $0040 2-LodMgr
NOP
NOP
H_01022C CLR.W D7
DC.W $B3F8,$0A1C CMPA.L $0A1C,A1
BNE.S H_01023C
* address $00FC0CD2 is Plug in tray ROM
JMP $00FC0CD2 .L
H_01023C CMPI.B #+000,+00008(A1)
BEQ.S H_01024C
MOVE.B #$00,+00007(A7)
H_01024C TRAP #02 ?? ExitMon ??
H_01024E RTS NEW CODE FOR GIVPCB SysCall
H_010250 MOVE.L A0,-(A7)
MOVEA.L A1,A0
* address $00FD669A is Plug in tray ROM
JSR $00FD669A .L
MOVEA.L (A7)+,A0
RTS
H_01025E MOVEM.L D0/D3-D4/A0,-(A7)
MOVE.W #$0001,D0
* BRA.S H_010280
H_01026A ROL.L #8,D1
CMPI.B #+032,D1 NEW CODE FOR GIVPCB SysCall
BLS.S H_01027A
CMPI.B #+127,D1
BLS.S H_01027E
H_01027A MOVE.B #$30,D1
H_01027E ADDQ.W #1,D0
H_010280 CMPI.W #+004,D0
BLE.S H_01026A
LEA H_00F014(PC),A0
MOVE.L (A0),D0
ADDI.L #$00000001,D0
MOVE.L D0,(A0) NEW CODE FOR GIVPCB SysCall
LEA HEX_DIGITS(PC),A0
MOVE.W #$0001,D3
H_0102A0 MOVE.B D0,D4
ANDI.W #$000F,D4
MOVE.B +000(A0,D4.W),D2
ROL.W #4,D0
ROL.L #8,D2
ADDQ.W #1,D3
H_0102B0 CMPI.W #+004,D3
BLE.S H_0102A0
MOVEM.L (A7)+,D0/D3-D4/A0
RTS NEW CODE FOR GIVPCB SysCall
H_0102BC DC.W $2278,$0A56 MOVEA.L $0A56,A1
TRAP #01 ?? EnterMon ??
MOVE.W #$0001,D0
BRA.S H_0102EC
H_0102CA CMP.L (A1),D1
BNE.S H_0102E6
CMP.L +00004(A1),D2
BNE.S H_0102E6
CMPI.B #+000,+00008(A1)
BEQ.S H_0102E6
TRAP #02 ?? ExitMon ??
RTS NEW CODE FOR GIVPCB SysCall
H_0102E6 ADDA.W #$02EE,A1
ADDQ.W #1,D0
H_0102EC DC.W $B078,$0A54 CMP.W $0A54,D0
BLE.S H_0102CA
CLR.B D0
TRAP #02 ?? ExitMon ??
RTS END OF NEW CODE FOR GIVPCB SysCall
*
*
*****************************************************************************
NEW_SC01 EQU * CODE FOR SysCall 01 -- user defined
MOVE.L 4(A7),D0
CMPI.W #0,D0 subsidiary call number in D0.W
BGE.S SC01_NXTT MUST be greater or equal to 0
RTS
SC01_NXTT CMPI.W #11,D0 call number less or equal to 10
BCS.S SC01_VALD
RTS
SC01_VALD EQU *
LSL.L #2,D0
LEA.L USER_TABLE(PC),A0
MOVEA.L 0(A0,D0.L),A1
LEA.L USER_0(PC),A0
JMP 0(A0,A1.L)
USER_TABLE DC.L 0 LOAD SR FROM D1.W D0=0
DC.L USER_1-USER_0 SW. STACKS IF SUP MODE D0=1
DC.L USER_2-USER_0 SW. STACKS IF USR MODE D0=2
DC.L USER_3-USER_0 RET. USP_TOP IN D0 D0=3
DC.L USER_4-USER_0 RET. SSP_TOP IN D0 D0=4
DC.L USER_5-USER_0 SET PRTSC KOLOR FROM D1 D0=5
DC.L USER_6-USER_0 SET PRTSC KOLOR to RED D0=6
DC.L USER_7-USER_0 SET PRTSC KOLOR to Green D0=7
DC.L USER_8-USER_0 SET PRTSC KOLOR to Blue D0=8
DC.L USER_9-USER_0 SET PRTSC KOLOR TO BLACK D0=9
DC.L USER_A-USER_0 SET PrtSc color to use currentD0=10
DC.L USER_B-USER_0 KILL PRTSC IN PROGRESS D0=11
*
USER_0 EQU * LOAD D1.W INTO SR
MOVE.W 64(A7),D2
EOR.W D1,D2
BTST #13,D2
MOVE.W D1,064(A7)
BEQ.S USER_0RET
BTST #13,D1
BEQ.S USER_IN1
BRA.S USER_IN2
USER_0RET RTS
*
USER_1 EQU * IF USR RTS / IF SUP SWITCH STACKS
MOVE.W 64(A7),D0
BTST #13,D0
BEQ.S USER_0RET
BCLR #13,D0
USER_IN1 MOVE.W D0,64(A7)
MOVE SR,D0
ORI #$2700,SR
LEA.L 70(A7),A6
MOVE A6,USP
* MOVE.L SSTACK(PC),A7
LEA SUP_STACK(PC),A7
USR_ST_CP MOVE.L -(A6),-(A7)
MOVE.W -(A6),-(A7)
MOVEQ #15,D1
USER_1_LOOP MOVE.L -(A6),-(A7)
DBRA D1,USER_1_LOOP
MOVE D0,SR
USER_1RET RTS
*
USER_2 EQU * IF SUP RTS / IF USR SWITCH STACKS
MOVE.W 64(A7),D0
BTST #13,D0
BNE.S USER_1RET
BSET #13,D0
MOVE.W D0,64(A7)
USER_IN2 MOVE SR,D0
ORI #$2700,SR
LEA.L 70(A7),A6
MOVE USP,A7
BRA USR_ST_CP
*
USER_3 EQU *
LEA.L USP_SV_ADDR(PC),A0 RETURNS USP_TOP IN D0
MOVE.L (A0),D0 & USP_TOP_PTR IN A0
MOVE.L D0,4(A7)
MOVE.L A0,36(A7)
RTS
*
USER_4 EQU *
LEA.L SSP_SV_ADDR(PC),A0 RETURNS SSP_TOP IN D0
MOVE.L (A0),D0 & SSP_TOP_PTR IN A0
MOVE.L D0,4(A7)
MOVE.L A0,36(A7)
RTS
*
USER_5 EQU *
* MOVE.L 8(A7),D1
ANDI.W #$0F,D1 0 .. 3 = RED .. BLACK, >3 == USE CURRENT COLOR
MOVE.L D1,D0
IN_USER_5 EQU *
BSR.L KOLOR_SET
RTS
*
USER_6 EQU * SET PrtSc COLOR TO RED
MOVEQ.L #$00,D0
BRA IN_USER_5
*
USER_7 EQU * SET PrtSc COLOR TO GREEN
MOVEQ.L #$01,D0
BRA IN_USER_5
*
USER_8 EQU * SET PrtSc COLOR TO BLUE
MOVEQ.L #$02,D0
BRA IN_USER_5
*
USER_9 EQU * SET PrtSc COLOR TO BLACK
MOVEQ.L #$03,D0
BRA IN_USER_5
*
USER_A EQU * SET PrtSc COLOR to use current color
MOVEQ.L #$08,D0
BRA IN_USER_5
*
USER_B EQU * KILL PRTSC
MOVE.L #'SCRN',D1
MOVE.L #'PRNT',D2
TRAP #0 SYSCALL
DC.W 45 KILL
RTS
*
*****************************************************************************
NEW_SC49 EQU * CODE FOR SysCall 49 - >user mode
H_0102F8 MOVE.W 064(A7),D0
BCLR #13,D0
MOVE.W D0,064(A7)
RTS
*
*****************************************************************************
NEW_SC48 EQU * CODE FOR SysCall 48 - >supervisor mode
H_010306 MOVE.W 064(A7),D0
BSET #13,D0
MOVE.W D0,064(A7)
RTS
*
*****************************************************************************
NEW_SC44 EQU * CODE FOR SysCall 44 RUNTASK
H_010314 CLR.W D7
MOVEA.L A0,A6
MOVEQ #000,D4 load
TRAP #00 $0 SYSCALL
DC.W $0040 2-LodMgr
NOP
NOP
H_010322 CMPI.W #+000,D7
BNE.S H_01037E
MOVE.L +00030(A0),D1
MOVE.L +00034(A0),D2
MOVE.W D0,D3 CODE FOR SysCall 44 RUNTASK
CMPI.B #+000,D0
BNE.S H_010348
MOVEQ #001,D0
TRAP #00 $0 SYSCALL
DC.W $001B GStat
SUBQ.B #1,D0
MOVE.B D0,D3
MOVE.W D3,D0
H_010348 ANDI.W #$FF00,D3
BEQ.S H_010360
MOVE.W +00064(A7),D3
BTST #13,D3 CODE FOR SysCall 44 RUNTASK
BNE.S H_010360
ANDI.W #$00FF,D0
H_010360 MOVEA.L +00072(A0),A6
TRAP #00 $0 SYSCALL
DC.W $0019 GetPCB
CMPI.W #+000,D7
BEQ.S H_01037E
MOVE.W D7,-(A7)
MOVEQ #001,D4 unload
TRAP #00 $0 SYSCALL
DC.W $0040 2-LodMgr
NOP
NOP
H_01037C MOVE.W (A7)+,D7
H_01037E MOVE.L D7,+00032(A7)
RTS END OF CODE FOR SysCall 44 RUNTASK
*
*****************************************************************************
NEW_SC45 EQU * CODE FOR SysCall 45 KILL
H_010384 CLR.W D7
DC.W $2078,$0A56 MOVEA.L $0A56,A0
CLR.L D0
MOVEQ #001,D6
H_01038E CMPI.W #+000,D0
BNE.S H_0103BC
DC.W $BC78,$0A54 CMP.W $0A54,D6
BGT.S H_0103BC
CMP.L (A0),D1
BNE.S H_0103B2
CMP.L +00004(A0),D2
BNE.S H_0103B2
MOVE.W D6,D0 CODE FOR SysCall 45 KILL
BRA.S H_01038E
H_0103B2 ADDQ.W #1,D6
ADDA.L #$000002EE,A0
H_0103BA BRA.S H_01038E
H_0103BC CMPI.W #+000,D0
BLE.S H_0103CC
TRAP #00 $0 SYSCALL
DC.W $001A GivPCB
BRA.S H_0103D0
H_0103CC MOVE.B #$FF,D7 CODE FOR SysCall 45 KILL
H_0103D0 MOVE.L D7,+00032(A7)
RTS END OF CODE FOR SysCall 45 KILL
*
*****************************************************************************
NEW_SC53 EQU * NEW CODE FOR MODSYSM SysCall 53
H_0103D6 MOVE.W #$0190,+00034(A7)
RTS
*
****************************************************************************
NEW_SC57 EQU * NEW CODE FOR MEMMGR SysCall 57
H_01053A DC.W $40E7 MOVE SR,-(A7)
H_01053C LEA H_010612(PC),A0
TAS (A0)
BEQ.S H_010554
MOVEQ #002,D1
CLR.B D0
TRAP #00 $0 SYSCALL
DC.W $001D Delay
MOVEQ #255,D7
BRA.S H_010556
H_010554 CLR.W D7
H_010556 DC.W $BE78,$0000 CMP.W $0000,D7
BNE.S H_01053C
CLR.L D7
CMPI.W #+001,D4
BLT.S H_0105A8
CMPI.W #+08,D4 WAS 36 SHOULD BE 8
BGT.S H_0105A8
MOVE.L A6,D6
DC.W $BCB8,$0A24 CMP.L $0A24,D6
BLT.S H_0105A0
DC.W $BCB8,$0A28 CMP.L $0A28,D6
BGE.S H_0105A0
BTST #00,D6
BNE.S H_010598
LSL.W #2,D4
LEA H_0105EE(PC),A0
MOVEA.L +000(A0,D4.W),A0
JSR (A0)
BRA.S H_0105AC
H_010598 EQU *
H_0105A0 MOVE.B #$11,D7
H_01059C EQU *
H_0105A4 BRA.S H_0105AC
H_0105A8 MOVE.B #$0F,D7
H_0105AC ANDI.L #$000000FF,D7
CMPI.B #+000,D7
BNE.S H_0105C6
ADDI.L #$00000004,+00068(A7)
BRA.S H_0105E0
H_0105C6 ORI.W #$6000,D7
DC.W $2078,$0A1C MOVEA.L $0A1C,A0
MOVE.W D7,+00138(A0)
MOVE.L #'MEMM',+00124(A0)
MOVE.W #$4752,+00128(A0)
H_0105E0 LEA H_010612(PC),A0
CLR.B (A0)
MOVE.L D7,+00034(A7)
DC.W $46DF MOVE (A7)+,SR
RTS
* MEMMGR JUMP TABLE
H_0105EE EQU *
DC.L $0000000 +0
DC.L $0FCB94C MEMMGR fn 1 - ATACHMPD +4
DC.L $0FCB9EC MEMMGR fn 2 - DTACHMPD +8
DC.L $0FCBA6C MEMMGR fn 3 - ATACHMSP +12
DC.L $0FCBEE8 MEMMGR fn 4 - ? (DTACHMSP?) +16
DC.L $0FCC258 MEMMGR fn 5 - GETMEM +20
* above is modified during init to point to H_0107A0
DC.L $0FCC4FE MEMMGR fn 6 - GIVMEM +24
DC.L $0FCC6EA MEMMGR fn 7 - INQMEM +28
DC.L 0 MEMMGR fn 8 - new ????? loaded during init w/H_010614
H_010612 EQU *
DC.W 0
*
H_010614 MOVEM.L D0-D6/A0-A6,-(A7) new (added) mem-mgr function #8
CMPI.L #$00000000,D5
BEQ.S H_01065E
DC.W $2078,$3BEC MOVEA.L $3BEC,A0
CLR.L D6
H_010628 CMPI.B #+255,D6
BEQ.S H_01065A
CMPA.L #$00000000,A0
BEQ.S H_010650
CMP.L (A0),D5
BNE.S H_010648
MOVE.B #$FF,D6
BRA.S H_010628
H_010648 MOVEA.L +00004(A0),A0
H_01064C BRA.S H_010628
H_010650 MOVE.B #$FF,D6
MOVE.B #$05,D7 (added) mem-mgr function #8
H_010658 BRA.S H_010628
H_01065A BRA.S H_010662
H_01065E MOVE.B #$01,D7
H_010662 CMPI.B #+000,D7
BNE.S H_010698
CMPI.L #$00000008,+00004(A6)
BLT.S H_010690
MOVE.L +00004(A6),D0
BTST #00,D0
BEQ.S H_010698
ADDI.L #$00000001,D0
MOVE.L D0,+00004(A6)
H_01068C BRA.S H_010698
H_010690 MOVE.L #$00000008,+00004(A6)
H_010698 CMPI.B #+000,D7 (added) mem-mgr function #8
BNE.L H_01079A
CLR.B D6
MOVEA.L +00012(A0),A1
H_0106A6 CMPI.B #+255,D6
BEQ.L H_01079A
CMPA.L #$00000000,A1
BEQ.L H_01078E
CLR.B D5
MOVEA.L +00012(A1),A2
LEA +00012(A1),A3
H_0106C2 CMPI.B #+255,D5
BEQ.L H_010786
CMPA.L #$00000000,A2
BEQ.L H_01077E
MOVE.L (A2),D0 (added) mem-mgr function #8
CMP.L +00004(A6),D0
BLT.L H_010772
MOVEM.L D0-D3,-(A7)
MOVE.L +00012(A6),D0
MOVE.L D0,D1
ADD.L +00004(A6),D1
MOVE.L A2,D2
ADDQ.L #8,D2
MOVE.L D2,D3
ADD.L (A2),D3
CMP.L D0,D2
BGT.S H_01073A
CMP.L D1,D3
BLT.S H_01073A
CLR.L D4 (added) mem-mgr function #8
MOVEM.L D5-D6/A4,-(A7)
MOVE.L D3,D6
SUB.L D1,D6
MOVE.L #$00001008,D5
SUB.L D5,D6
CMPI.L #$00000008,D6
BLE.S H_010732
SUB.L D5,D3
SUBQ.L #8,D5
MOVEA.L D3,A4
MOVE.L D5,(A4)
MOVE.L +00004(A2),+00004(A4)
MOVE.L A4,+00004(A2)
SUB.L D2,D3
MOVE.L D3,(A2) (added) mem-mgr function #8
H_010732 MOVEM.L (A7)+,D5-D6/A4
BRA.S H_01073E
H_01073A MOVE.B #$FF,D4
H_01073E MOVEM.L (A7)+,D0-D3
CMPI.B #+000,D4
BNE.S H_010766
MOVE.B #$FF,D5
MOVE.B #$FF,D6
MOVE.L +00004(A2),(A3)
MOVE.L (A2),+00004(A6)
LEA +00008(A2),A4
MOVE.L A4,+00012(A6)
BRA.S H_010782
H_010766 LEA +00004(A2),A3
MOVEA.L +00004(A2),A2 (added) mem-mgr function #8
H_01076E BRA.S H_010782
H_010772 LEA +00004(A2),A3
MOVEA.L +00004(A2),A2
H_01077A BRA.S H_010782
H_01077E MOVE.B #$FF,D5
H_010782 BRA.L H_0106C2
H_010786 MOVEA.L +00008(A1),A1
BRA.S H_010796
H_01078E MOVE.B #$FF,D6
MOVE.B #$10,D7
H_010796 BRA.L H_0106A6
H_01079A MOVEM.L (A7)+,D0-D6/A0-A6
RTS end of code for (added) mem-mgr function #8
*
H_0107A0 MOVEM.L D0-D6/A0-A6,-(A7) new (modified) mem-mgr fn 5 (GETMEM)
CMPI.L #$00000000,D5
BEQ.S H_0107EA
DC.W $2078,$3BEC MOVEA.L $3BEC,A0
CLR.L D6
H_0107B4 CMPI.B #+255,D6
BEQ.S H_0107E6
CMPA.L #$00000000,A0
BEQ.S H_0107DC
CMP.L (A0),D5
BNE.S H_0107D4
MOVE.B #$FF,D6
BRA.S H_0107B4
H_0107D4 MOVEA.L +00004(A0),A0
H_0107D8 BRA.S H_0107B4
H_0107DC MOVE.B #$FF,D6 (modified) mem-mgr fn 5 (GETMEM)
MOVE.B #$05,D7
H_0107E4 BRA.S H_0107B4
H_0107E6 BRA.S H_0107EE
H_0107EA MOVE.B #$01,D7
H_0107EE CMPI.B #+000,D7
BNE.S H_010840
CMPI.L #$00000008,+00004(A6)
BLT.S H_010838
MOVE.L +00004(A6),D0
BTST #00,D0
BEQ.S H_010818
ADDI.L #$00000001,D0
MOVE.L D0,+00004(A6) (modified) mem-mgr fn 5 (GETMEM)
H_010818 MOVE.L +00008(A6),D0
BTST #00,D0
BEQ.S H_010834
CMPI.L #$00010000,+00004(A6)
BLT.S H_010840
MOVE.B #$0D,D7
H_010834 BRA.S H_010840
H_010838 MOVE.L #$00000008,+00004(A6)
H_010840 CMPI.B #+000,D7
BNE.L H_010A70
CLR.B D6
MOVEA.L +00012(A0),A1
H_01084E CMPI.B #+255,D6
BEQ.L H_010A70
CMPA.L #$00000000,A1
BEQ.L H_010A64
CLR.B D5
MOVEA.L +00012(A1),A2
LEA +00012(A1),A3 (modified) mem-mgr fn 5 (GETMEM)
H_01086A CMPI.B #+255,D5
BEQ.L H_010A5C
CMPA.L #$00000000,A2
BEQ.L H_010A54
MOVE.L (A2),D0
CMP.L +00004(A6),D0
BLT.L H_010A48
CLR.L D4
MOVEM.L D0-D3/D5-D6/A4,-(A7)
MOVE.L +00008(A6),D3
BTST #00,D3
BEQ.L H_010970
MOVE.L +00008(A0),D0
BTST #01,D0
BNE.S H_010912
MOVE.L A2,D0
ADDQ.L #8,D0 (modified) mem-mgr fn 5 (GETMEM)
MOVE.L +00004(A6),D1
MOVE.L (A2),D2
ADD.L D0,D1
ADD.L D0,D2
SWAP D0
SWAP D1
CMP.W D0,D1
BEQ.S H_01090E
ADDI.W #+001,D0
MOVE.W D0,D1
SWAP D1
CLR.W D1
ADD.L +00004(A6),D1 (modified) mem-mgr fn 5 (GETMEM)
CMP.L D1,D2
BLT.S H_01090A
SWAP D0
CLR.W D0
SUB.L D0,D2
SUBQ.L #8,D0
MOVEA.L D0,A4
MOVE.L D0,D1
SUB.L A2,D1
CMPI.L #$00000008,D1
BLT.S H_010902
SUBQ.L #8,D1
MOVE.L D1,(A2)
MOVE.L D2,(A4)
MOVE.L +00004(A2),+00004(A4)
MOVE.L A4,+00004(A2) (modified) mem-mgr fn 5 (GETMEM)
LEA +00004(A2),A3
MOVEA.L (A3),A2
BRA.S H_010970
H_010902 ADD.L D1,+00004(A6)
H_010906 BRA.S H_010970
H_01090A MOVE.B #$FF,D4
H_01090E BRA.S H_010970
H_010912 MOVE.L A2,D0
ADDQ.L #8,D0
MOVE.L D0,D2
ADD.L (A2),D2
MOVE.L D2,D1
SUB.L +00004(A6),D1
SWAP D1
SWAP D2 (modified) mem-mgr fn 5 (GETMEM)
CMP.W D1,D2
BEQ.S H_010970
SWAP D2
MOVE.L D2,D1
CLR.W D1
SUB.L +00004(A6),D1
CMP.L D1,D0
BGE.S H_01096C
MOVE.L D2,D1
CLR.W D2
MOVEA.L D2,A4
SUB.L D2,D1
CMPI.L #$00000008,D1
BLT.S H_010964
SUBQ.L #8,D1
MOVE.L D1,(A4) (modified) mem-mgr fn 5 (GETMEM)
MOVEA.L D2,A4
SUB.L D0,D2
MOVE.L D2,(A2)
MOVE.L +00004(A2),+00004(A4)
MOVE.L A4,+00004(A2)
BRA.S H_010970
H_010964 ADD.L D1,+00004(A6)
H_010968 BRA.S H_010970
H_01096C MOVE.B #$FF,D4
H_010970 MOVEM.L (A7)+,D0-D3/D5-D6/A4
MOVE.L (A2),D0
CMPI.B #+000,D4
BNE.L H_010A3C
MOVE.B #$FF,D5
MOVE.B #$FF,D6 (modified) mem-mgr fn 5 (GETMEM)
MOVE.L +00004(A6),D1
MOVE.L D0,D2
SUBQ.L #8,D2
SUB.L D1,D2
CMPI.L #$00000008,D2
BGE.S H_0109AE
MOVE.L +00004(A2),(A3)
MOVE.L (A2),+00004(A6)
LEA +00008(A2),A4
MOVE.L A4,+00012(A6)
BRA.S H_0109F6
H_0109AE MOVE.L +00008(A0),D4
BTST #01,D4
BNE.S H_0109DE
LEA +008(A2,D1.L),A4
MOVE.L D2,(A4) (modified) mem-mgr fn 5 (GETMEM)
MOVE.L D1,(A2)
MOVE.L +00004(A2),+00004(A4)
MOVE.L A4,(A3)
MOVE.L #$00000000,+00004(A2)
LEA +00008(A2),A2
MOVE.L A2,+00012(A6)
BRA.S H_0109F6
H_0109DE LEA +008(A2,D2.L),A4
MOVE.L D1,(A4)
MOVE.L D2,(A2)
MOVE.L #$00000000,+00004(A4)
LEA +00008(A4),A4
MOVE.L A4,+00012(A6)
H_0109F6 MOVEA.L +00012(A6),A4
MOVE.L +00008(A6),D0 (modified) mem-mgr fn 5 (GETMEM)
BTST #01,D0
BNE.S H_010A38
MOVEM.L D0-D1/A0-A1,-(A7)
MOVE.L +00004(A6),D0
MOVE.L D0,D1
ANDI.W #$FFFC,D0
MOVEA.L A4,A0
MOVEA.L A4,A1
ADDA.L D0,A1
H_010A1A CMPA.L A0,A1
BLE.S H_010A24
CLR.L (A0)+
BRA.S H_010A1A
H_010A24 ANDI.W #$0003,D1
ADDA.W D1,A1 (modified) mem-mgr fn 5 (GETMEM)
H_010A2A CMPA.L A0,A1
BLE.S H_010A34
CLR.B (A0)+
BRA.S H_010A2A
H_010A34 MOVEM.L (A7)+,D0-D1/A0-A1
H_010A38 BRA.S H_010A58
H_010A3C LEA +00004(A2),A3
MOVEA.L +00004(A2),A2
H_010A44 BRA.S H_010A58
H_010A48 LEA +00004(A2),A3 (modified) mem-mgr fn 5 (GETMEM)
MOVEA.L +00004(A2),A2
H_010A50 BRA.S H_010A58
H_010A54 MOVE.B #$FF,D5
H_010A58 BRA.L H_01086A
H_010A5C MOVEA.L +00008(A1),A1
BRA.S H_010A6C
H_010A64 MOVE.B #$FF,D6
MOVE.B #$10,D7
H_010A6C BRA.L H_01084E
H_010A70 MOVEM.L (A7)+,D0-D6/A0-A6
RTS end of code for (modified) mem-mgr
fn 5 (GETMEM)
*
****************************************************************************
NEW_SC11 EQU * NEW CODE FOR CHAIN SysCall 11
H_010A76 EQU *
TRAP #0 SYSCALL
DC.W $000E LoadB (OLD LOADB IS NOW SC6)
CMPI.W #+000,D7
BEQ.S SC11_COOL
TRAP #0 SYSCALL
DC.W $0006 OLD LOADB
CMPI.W #+000,D7
BNE.S H_010A9A
SC11_COOL DC.L $007C0100 ORI.W #$0100,SR
MOVE.W +00064(A7),D0
LEA +00070(A7),A7
DC.W $46C0 MOVE D0,SR
MOVE.L +00038(A6),D0
MOVE.L +00042(A6),D1
MOVEQ #0,D7
JSR (A2)
H_010A9A MOVE.W D7,+00034(A7)
BRA.L PT_MESS
H_010A9E RTS END OF NEW CODE FOR CHAIN SysCall 11
*
****************************************************************************
NEW_SC32 EQU * NEW CODE FOR SYSLEV SysCall 32
H_010AC4 MOVE.L H_00E298(PC),+00004(A7)
RTS
*
* LOOKUP AND PRINT ERROR MESSAGE FOR FILE LOAD/LODMGR
LOD_ERR_PRNT EQU *
H_010ACC LEA LOAD_ERROR_TABLE(PC),A6
H_010AD0 MOVE.B (A6)+,D0
LSL.W #8,D0
MOVE.B (A6)+,D0
CMP.W D0,D7
BNE.S H_010AE4
TRAP #00 $0 SYSCALL
DC.W $0013 PrtErMsg*
BRA.S H_010AEA
H_010AE4 CMPI.B #+013,(A6)+
BNE.S H_010AE4
H_010AEA CMP.W D0,D7
BEQ.S H_010AF4
CMPI.W #+000,D0
BNE.S H_010AD0
H_010AF4 CMPI.W #+000,D0
BNE.S H_010B00
TRAP #00 $0 SYSCALL
DC.W $0009 CPRTERR
H_010B00 RTS
LOAD_ERROR_TABLE EQU *
H_010B02 DC.W $0190
H_010B04 DC.B 'FUNCTION NO LONGER SUPPORTED',$D
H_010B21 DC.B $01,$91
H_010B23 DC.B 'LOAD NOT SUPPORTED FOR BIN FILES',$D
H_010B44 DC.W $0192
H_010B46 DC.B 'TRANSFER ADDRESS OUT OF RANGE',$D
H_010B64 DC.B $70,$01,'LCB ERROR - ODD ADDRESS',$D
H_010B7E DC.B $70,$0F,'LOAD FUNCTION NOT SUPPORTED',$D
*H_010BBC EQU *+00000032
H_010B9C DC.B $70,$11,'INVALID MAGIC NUMBER IN HEADER',$D
H_010BBD DC.B $70,$12,'INVALID EXTENDED HEADER SIZE',$D
*H_010BF8 EQU *+00000028
H_010BDC DC.B $70,$13,'INVALID CPU TYPE IN HEADER',$D
H_010BF9 DC.B $70,$14,'INVALID RELOC/SYMBOL FORMAT DESCRIPTOR',$D
H_010C22 DC.B $70,$15,'INVALID RUN-TIME ENVIRONMENT DESCRIPTOR',$D
H_010C4C DC.B $70,$32,'TEXT RELOCATION ERROR',$D
H_010C64 DC.B $70,$33,'DATA RELOCATION ERROR',$D
H_010C7C DC.B $70,$34,'SYMBOL TABLE RELOCATION ERROR',$D
*H_010CC8 EQU *+00000044
H_010C9C DC.B $70,$66,'CANNOT UNLOAD - MODULE IS AN ACTIVE DEVICE',$D
H_010CC9 DC.B $70,$67,'CANNOT UNLOAD - MODULE IS AN ACTIVE TASK',$D
H_010CF4 DC.B $70,$71,'MEMORY DEALLOCATION ERROR',$D
H_010D10 DC.B $70,$FE,'MODULE ALREADY EXISTS',$D
H_010D2A EQU *+2
H_010D28 DC.B $70,$FD,'IMVALID MODULE NAME',$D
H_010D3E DC.B $70,$FF,'MODULE NOT FOUND',$D,$0
H_010D52: DC.W +00000
*
****************************************************************************
NEW_SC64 EQU * CODE FOR LODMGR SysCall 64
H_010DA2 DC.W $40E7 MOVE SR,-(A7)
H_010DA4 LEA H_0120A2(PC),A0
TAS (A0)
BEQ.S H_010DBC
MOVEQ #002,D1
CLR.B D0
TRAP #00 $0 SYSCALL
DC.W $001D Delay
MOVEQ #255,D7
BRA.S H_010DBE
H_010DBC CLR.W D7
H_010DBE DC.W $BE78,$0000 CMP.W $0000,D7
BNE.S H_010DA4
CLR.L D7 CODE FOR LODMGR SysCall 64
CMPI.W #+000,D4
BLT.S H_010E10
CMPI.W #+10,D4 should be 6 not 27 !?!
BGT.S H_010E10
MOVE.L A6,D6
DC.W $BCB8,$0A24 CMP.L $0A24,D6
BLT.S H_010E08
DC.W $BCB8,$0A28 CMP.L $0A28,D6
BGE.S H_010E08
BTST #00,D6 CODE FOR LODMGR SysCall 64
BNE.S H_010E00
LSL.W #2,D4
LEA ERR_6012(PC),A0
MOVE.W #$6012,(A0)
LEA H_010E52(PC),A0
ADDA.L +000(A0,D4.W),A0
JSR (A0)
BRA.S H_010E14
H_010E00 EQU * CODE FOR LODMGR SysCall 64
H_010E08 MOVE.W #$7001,D7
H_010E04 EQU *
H_010E0C BRA.S H_010E14
H_010E10 MOVE.W #$700F,D7
H_010E14 ANDI.L #$0000FFFF,D7
CMPI.W #+000,D7 COMMON LM RET PT - IS D7=0? $701x = not .exe
BNE.S H_010E2E x = 1 means bad magic number
ADDI.L #$00000004,+00068(A7)
BRA.S H_010E44
H_010E2E DC.W $2078,$0A1C MOVEA.L $0A1C,A0
MOVE.W D7,+00138(A0)
MOVE.L #'LODM',+00124(A0)
MOVE.W #$4752,+00128(A0)
H_010E44 MOVE.L D7,+00034(A7)
DC.W $46DF MOVE (A7)+,SR
LEA H_0120A2(PC),A0
CLR.B (A0) CODE FOR LODMGR SysCall 64
RTS
ERR_6012 DC.W $6012
L_SEARCH DC.W 0
* LODMGR DISPATCH OFFSET TABLE
H_010E52 DC.L LM_0_LOAD-H_010E52 LOAD - SEARCH OR NOT AS SET
DC.L LM_1_UNLOAD-H_010E52 UNLOAD
DC.L LM_2_INQLOAD-H_010E52 INQLOAD
DC.L LM_3_MODIFY-H_010E52 MODIFY
DC.L LM_4_LMREQMEM-H_010E52 LMREQMEM
DC.L LM_5_LMRETMEM-H_010E52 LMRETMEM
DC.L LM_6_LMINQMEM-H_010E52 LMINQMEM
DC.L LM_7_LOAD-H_010E52 LOAD - NO DRIVE SEARCH
DC.L LM_8_LOAD-H_010E52 LOAD - W/ DRIVE SEARCH
DC.L LM_9_UNLOAD-H_010E52 UNLOAD W/O MESSING COMMAND TABLE
DC.L LM_10_UNLOAD-H_010E52 UNLOAD W/O STOPPING FOR $6012 ERR
*
LM_7_LOAD EQU * NO SEARCH
LEA L_SEARCH(PC),A4
MOVE.B #$FF,(A4)
BRA.S LM_0_LOAD
*
LM_8_LOAD EQU * DO SEARCH
LEA L_SEARCH(PC),A4
MOVE.B #0,(A4)
*
LM_0_LOAD BSR.S LM0LOAD
CMPI.W #0,D7
BNE.S LM0_RET
MOVE.L #0,26(A6)
LM0_RET RTS
*
LM0LOAD MOVEA.L A6,A4 CODE FOR LODMGR - fn 0 LOAD
CMPI.L #$00000000,(A4)
BNE.S H_010E90
CMPI.W #+000,+00004(A4)
BNE.S H_010E90
MOVE.L #' ',(A4)
MOVE.W #' ',+00004(A4)
H_010E90 MOVE.L +00014(A4),D0
ASR.L #8,D0 CODE FOR LODMGR - fn 0 LOAD
MOVE.B D0,D1
ASL.L #8,D0
MOVE.B D1,D0
CMPI.L #$00000000,D0
BEQ.S H_010EAE
CMPI.L #' ',D0
BNE.S H_010EB6
H_010EAE MOVE.L #'EXE ',+00014(A4)
H_010EB6 CLR.L D7 CODE FOR LODMGR - fn 0 LOAD
LEA +00006(A4),A0
BSR.L H_01191A
CMPI.W #+000,D7
BNE.S H_010EEE
BTST #00,+00020(A4)
BEQ.S H_010EEA
LEA +00030(A4),A0
BSR.L H_01191A
CMPI.W #+65535,D7
BNE.S H_010EEA
MOVE.W #$70FD,D7 CODE FOR LODMGR - fn 0 LOAD
BRA.L H_0113C0
H_010EEA BRA.S H_010EF8
H_010EEE MOVE.W #$70FD,+00090(A4)
BRA.L H_0113C0
H_010EF8 BTST #00,+00020(A4)
BEQ.S H_010F0A
LEA +00030(A4),A0
BRA.S H_010F0E
H_010F0A LEA +00006(A4),A0
H_010F0E LEA H_0120A4(PC),A5
BSR.L H_011C04 ?search for modules
CMPI.W #+000,D7 CODE FOR LODMGR - fn 0 LOAD
BNE.S H_010F2C
MOVE.L #$000070FE,D7 MODULE ALREADY EXISTS
MOVE.W D7,+00090(A4)
BRA.L H_0113C0
H_010F2C BSR.L H_011786 FILE OPEN SUBR
CMPI.W #+000,D7
BEQ.S H_010F3E
MOVE.W D7,+00090(A4)
BRA.L H_0113C0
H_010F3E MOVE.L #$000000A2,D0
MOVE.L #'SYSM',D5
CLR.B D1 CODE FOR LODMGR - fn 0 LOAD
BSR.L H_011EF8
CMPI.W #+000,D7
BEQ.S H_010F60
MOVE.B #$21,+00089(A4)
BRA.L H_0113B8
H_010F60 MOVEA.L A6,A5
MOVE.W #$0000,D0
H_010F6A MOVE.B #$00,+000(A5,D0.W)
ADDQ.W #1,D0
H_010F72 CMPI.W #+161,D0
BLE.S H_010F6A
LEA (A4),A0 CODE FOR LODMGR - fn 0 LOAD
LEA +00004(A5),A1
MOVE.W #$0000,D0
H_010F86 MOVE.B (A0)+,(A1)+
ADDQ.W #1,D0
H_010F8A CMPI.W #+016,D0
BLE.S H_010F86
BTST #00,+00020(A4)
BEQ.S H_010FA2
LEA +00030(A4),A0
BRA.S H_010FA6
H_010FA2 LEA +00006(A4),A0
H_010FA6 LEA +00030(A5),A1
MOVE.W #$0000,D0 CODE FOR LODMGR - fn 0 LOAD
H_010FB2 MOVE.B (A0)+,(A1)+
ADDQ.W #1,D0
H_010FB6 CMPI.W #+007,D0
BLE.S H_010FB2
CMPI.L #$00000000,+00022(A4)
BEQ.S H_010FD2
CMPI.L #' ',+00022(A4)
BNE.S H_010FDA
H_010FD2 MOVE.L #'USRM',+00022(A4)
H_010FDA MOVE.L +00022(A4),+00022(A5)
LEA +00092(A4),A0
LEA +00080(A5),A1
MOVE.W #$0000,D7 CODE FOR LODMGR - fn 0 LOAD
H_010FF0 MOVE.B (A0)+,(A1)+
ADDQ.W #1,D7
H_010FF4 CMPI.W #+080,D7
BLE.S H_010FF0
MOVE.W +00172(A4),+00160(A5)
MOVE.B #$10,+00089(A4)
SUBA.L #$00000034,A7
MOVEA.L A7,A0
MOVEQ #052,D0
BSR.L H_01182A
CMPI.W #+000,D7 CODE FOR LODMGR - fn 0 LOAD
BNE.L H_0110D8
MOVE.W (A0),D0
CMPI.W #+00518,D0
BEQ.S H_01102C
MOVE.W #$7011,D7
BRA.S H_01107C
H_01102C MOVE.W +00002(A0),D0
CMPI.W #+020,D0
BEQ.S H_01103E
MOVE.W #$7012,D7
BRA.S H_01107C
H_01103E MOVE.B +00028(A0),D0
CMPI.B #+133,D0 CODE FOR LODMGR - fn 0 LOAD
BEQ.S H_011052
MOVE.W #$7013,D7
BRA.S H_01107C
H_011052 MOVE.B +00029(A0),D0
CMPI.B #+000,D0
BEQ.S H_011064
MOVE.W #$7014,D7
BRA.S H_01107C
H_011064 MOVE.W +00030(A0),D0
MOVE.W D0,D3
MOVE.W #$0008,D1
NOT.W D1 CODE FOR LODMGR - fn 0 LOAD
AND.W D1,D0
CMPI.W #+16480,D0
BEQ.S H_01107C
MOVE.W #$7015,D7
H_01107C CMPI.W #+000,D7
BNE.S H_0110D4
MOVE.L +00004(A0),+00044(A5)
MOVE.L +00008(A0),+00052(A5)
MOVE.L +00012(A0),+00056(A5)
MOVE.L +00016(A0),+00068(A5)
LEA H_0120A8(PC),A1
MOVE.L +00020(A0),(A1) CODE FOR LODMGR - fn 0 LOAD
MOVE.L +00024(A0),+00072(A5)
LEA H_0120AC(PC),A1
MOVE.L +00032(A0),(A1)
LEA H_0120B0(PC),A1
MOVE.L +00036(A0),(A1)
LEA H_0120B4(PC),A1
MOVE.L +00040(A0),(A1)
LEA H_0120B8(PC),A1
MOVE.L +00044(A0),(A1)
MOVE.L +00048(A0),+00060(A5)
BRA.S H_0110D8
H_0110D4 MOVE.B D7,+00089(A4)
H_0110D8 ADDA.L #$00000034,A7
CMPI.W #+000,D7 CODE FOR LODMGR - fn 0 LOAD
BEQ.S H_0110EA
BRA.L H_0113A2
H_0110EA MOVE.L +00044(A5),D0
CMPI.L #$00000000,D0
BEQ.S H_011116
CLR.B D1
MOVE.L +00022(A5),D5
BSR.L H_011EF8
CMPI.W #+000,D7
BEQ.S H_011112
MOVE.B #$22,+00089(A4)
BRA.L H_011372
H_011112 BRA.S H_011118
H_011116 MOVEA.L D0,A6 CODE FOR LODMGR - fn 0 LOAD
H_011118 MOVE.L A6,+00040(A5)
MOVE.L +00052(A5),D0
ADD.L +00056(A5),D0
ANDI.W #$0008,D3
CMPI.W #+000,D3
BEQ.S H_011138
ADD.L +00060(A5),D0
BRA.S H_01116C
H_011138 MOVE.L +00022(A5),D5
BSR.L H_011FA6
CMP.L D1,D0
BCC.S H_01116A
SUB.L D0,D1 CODE FOR LODMGR - fn 0 LOAD
LSR.L #1,D1
BCLR #00,D1
CMP.L +00060(A5),D1
BCS.S H_011164
MOVE.L D1,+00060(A5)
SUB.L D0,+00060(A5)
ADD.L D1,D0
BRA.S H_01116C
H_011164 EQU *
H_011166 EQU *
H_01116A MOVEQ #255,D0
H_01116C CMPI.L #$00000000,D0
BEQ.S H_011194
MOVE.L +00022(A5),D5
CLR.B D1 CODE FOR LODMGR - fn 0 LOAD
BSR.L H_011EF8
CMPI.W #+000,D7
BEQ.S H_011190
MOVE.B #$24,+00089(A4)
BRA.L H_01138A
H_011190 BRA.S H_011196
H_011194 MOVEA.L D0,A6
H_011196 MOVE.L A6,+00048(A5)
MOVE.L +00068(A5),D0
CMPI.L #$00000000,D0
BEQ.S H_0111C6
CLR.B D1 CODE FOR LODMGR - fn 0 LOAD
MOVE.L +00022(A5),D5
BSR.L H_011EF8
CMPI.W #+000,D7
BEQ.S H_0111C2
MOVE.B #$24,+00089(A4)
BRA.L H_0113A2
H_0111C2 BRA.S H_0111C8
H_0111C6 MOVEA.L D0,A6
H_0111C8 MOVE.L A6,+00064(A5)
MOVEA.L +00040(A5),A0
MOVE.L +00044(A5),D0
BSR.L H_011892
CMPI.W #+000,D7 CODE FOR LODMGR - fn 0 LOAD
BEQ.S H_0111E8
MOVE.B #$42,+00089(A4)
BRA.L H_011362
H_0111E8 MOVEA.L +00048(A5),A0
MOVE.L +00052(A5),D0
BSR.L H_011892
CMPI.W #+000,D7
BEQ.S H_011204
MOVE.B #$43,+00089(A4)
BRA.L H_011362
H_011204 MOVEA.L +00064(A5),A0
MOVE.L +00068(A5),D0
BSR.L H_011892
CMPI.W #+000,D7 CODE FOR LODMGR - fn 0 LOAD
BEQ.S H_011220
MOVE.B #$45,+00089(A4)
BRA.L H_011362
H_011220 MOVEA.L +00064(A5),A1
MOVEA.L +00068(A5),A3
ADDA.L A1,A3
CLR.W D5
H_01122C CMPA.L A1,A3
BLE.S H_011274
CMPI.W #+000,D7
BNE.S H_011274
BSR.L H_0114F0
CMPI.W #+65535,D7 CODE FOR LODMGR - fn 0 LOAD
BNE.S H_011272
MOVE.W D7,D5
LEA H_0113C6(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
LEA H_0120D0(PC),A6
H_011254 CMPI.B #+000,(A0)
BEQ.S H_011260
MOVE.B (A0)+,(A6)+
BRA.S H_011254
H_011260 MOVE.B #$22,(A6)+ CODE FOR LODMGR - fn 0 LOAD
MOVE.B #$0D,(A6)+
LEA H_0120D0(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
CLR.W D7
H_011272 BRA.S H_01122C
H_011274 CMPI.W #+000,D5
BEQ.S H_01127E
MOVE.W #$7034,D7
H_01127E CMPI.W #+000,D7 CODE FOR LODMGR - fn 0 LOAD
BEQ.S H_01128E
MOVE.B #$34,+00089(A4)
BRA.L H_011362
H_01128E MOVEA.L +00040(A5),A3
MOVE.L H_0120AC(PC),D0
BSR.L H_0113E6
CMPI.W #+000,D7
BEQ.S H_0112B4
CMPI.W #+65535,D7
BNE.S H_0112AA
MOVE.W #$7032,D7 CODE FOR LODMGR - fn 0 LOAD
H_0112AA MOVE.B #$32,+00089(A4)
BRA.L H_011362
H_0112B4 MOVE.L +00072(A5),D0
ADD.L A3,D0
MOVE.L D0,+00072(A5)
MOVE.L +00076(A5),D0
ADD.L A3,D0
MOVE.L D0,+00076(A5)
MOVEA.L +00048(A5),A3
MOVE.L H_0120B0(PC),D0
BSR.L H_0113E6
CMPI.W #+000,D7
BEQ.S H_0112EE
CMPI.W #+65535,D7 CODE FOR LODMGR - fn 0 LOAD
BNE.S H_0112E4
MOVE.W #$7033,D7
H_0112E4 MOVE.B #$33,+00089(A4)
BRA.S H_011362
H_0112EE BTST #00,+00020(A4)
BNE.S H_011312
LEA +00030(A5),A0
LEA +00030(A4),A1
MOVE.W #$0000,D0
H_011308 MOVE.B (A0)+,(A1)+
ADDQ.W #1,D0
H_01130C CMPI.W #+007,D0 CODE FOR LODMGR - fn 0 LOAD
BLE.S H_011308
H_011312 MOVE.L +00040(A5),+00040(A4)
MOVE.L +00044(A5),+00044(A4)
MOVE.L +00048(A5),+00048(A4)
MOVE.L +00052(A5),+00052(A4)
MOVE.L +00056(A5),+00056(A4)
MOVE.L +00060(A5),+00060(A4)
MOVE.L +00064(A5),+00064(A4)
MOVE.L +00068(A5),+00068(A4)
MOVE.L +00072(A5),+00072(A4)
MOVE.L +00076(A5),+00076(A4)
LEA H_0120A4(PC),A0
LEA (A5),A1 CODE FOR LODMGR - fn 0 LOAD
MOVE.L (A0),(A1)
MOVE.L A1,(A0)
MOVEQ #000,D7
MOVE.B D7,+00089(A4)
BRA.S H_0113B8
H_011362 MOVE.W D7,+00090(A4)
MOVEA.L +00040(A5),A6
BSR.L H_011F52
BRA.S H_011376
H_011372 MOVE.W D7,+00090(A4)
H_011376 MOVEA.L +00048(A5),A6
BSR.L H_011F52
CMPI.W #+000,D7 CODE FOR LODMGR - fn 0 LOAD
BEQ.S H_011386
MOVE.L D7,D0
H_011386 BRA.S H_01138E
H_01138A MOVE.W D7,+00090(A4)
H_01138E MOVEA.L +00064(A5),A6
BSR.L H_011F52
CMPI.W #+000,D7
BEQ.S H_01139E
MOVE.L D7,D0
H_01139E BRA.S H_0113A6
H_0113A2 MOVE.W D7,+00090(A4)
H_0113A6 MOVEA.L A5,A6 CODE FOR LODMGR - fn 0 LOAD
BSR.L H_011F52
CMPI.W #+000,D7
BEQ.S H_0113BC
MOVE.L D7,D0
H_0113B4 BRA.S H_0113BC
H_0113B8 MOVE.W D7,+00090(A4)
H_0113BC BSR.L H_011876
H_0113C0 MOVE.W +00090(A4),D7
RTS
H_0113C6 DC.B ' RELOCATION ERROR ON SYMBOL "',$4,$0
DS.W 0
H_0113E6 MOVE.L D0,D3 CODE FOR LODMGR - fn 0 LOAD
MOVE.L #'USRM',D5
CLR.B D1
BSR.L H_011EF8
CMPI.W #+000,D7
BNE.S H_01143A
MOVE.L A6,-(A7)
MOVEA.L A6,A0
MOVE.L D3,D0
BSR.L H_011892
CMPI.W #+000,D7
BNE.S H_01142A
MOVEA.L A0,A1 CODE FOR LODMGR - fn 0 LOAD
ADDA.L D3,A1
H_011410 CMPA.L A0,A1
BLE.S H_01142A
CMPI.W #+000,D7
BNE.S H_01142A
BSR.S H_01143C
ADDA.L #$00000008,A0
BRA.S H_011410
H_01142A MOVE.W D7,D1
MOVEA.L (A7)+,A6
BSR.L H_011F52
CMPI.W #+000,D7 CODE FOR LODMGR - fn 0 LOAD
BNE.S H_01143A
MOVE.W D1,D7
H_01143A RTS
H_01143C MOVE.W (A0),D1
ANDI.W #$C000,D1
CMPI.W #+49152,D1
BNE.S H_01148C
BTST #02,+00020(A4)
BNE.S H_011486
MOVEA.L +00004(A0),A2
ADDA.L A3,A2
MOVE.W (A0),D1
ANDI.W #$3000,D1
CMPI.W #+08192,D1 CODE FOR LODMGR - fn 0 LOAD
BNE.S H_011480
MOVE.W +00002(A0),D0
BSR.L H_011714
CMPI.W #+000,D7
BNE.S H_0114EE
MOVE.L +00004(A6),(A2)
H_01147C BRA.S H_0114EE
H_011480 MOVEQ #255,D7
H_011482 BRA.S H_0114EE
H_011486 MOVEQ #255,D7
H_011488 BRA.S H_0114EE
H_01148C CMPI.W #+000,D1 CODE FOR LODMGR - fn 0 LOAD
BNE.S H_0114A0
MOVE.L +00040(A5),D2
SUB.L H_0120B4(PC),D2
BRA.S H_0114CA
H_0114A0 CMPI.W #+16384,D1
BNE.S H_0114B4
MOVE.L +00048(A5),D2
SUB.L H_0120B8(PC),D2
BRA.S H_0114CA
H_0114B4 CMPI.W #+32768,D1
BNE.S H_0114C8
MOVE.L +00048(A5),D2
SUB.L H_0120B8(PC),D2
BRA.S H_0114CA
H_0114C8 MOVEQ #255,D7 CODE FOR LODMGR - fn 0 LOAD
H_0114CA CMPI.W #+000,D7
BNE.S H_0114EE
MOVE.W (A0),D1
ANDI.W #$3000,D1
CMPI.W #+08192,D1
BNE.S H_0114EC
MOVE.L +00004(A0),D0
ADD.L D2,+000(A3,D0.L)
BRA.S H_0114EE
H_0114EC MOVEQ #255,D7
H_0114EE RTS
H_0114F0 BSR.L H_0115C0
ANDI.W #$001F,D1 CODE FOR LODMGR - fn 0 LOAD
CMPI.W #+001,D1
BNE.S H_011506
ADDQ.L #6,A1
BRA.L H_0115B8
H_011506 CMPI.W #+000,D1
BNE.S H_011558
LEA +00006(A1),A0
MOVE.B +00020(A4),D3
DC.W $C638,$0004 AND.B $0004,D3
CMPI.W #+000,D1
BNE.S H_011552
CMPI.B #+000,D3
BNE.S H_011552
BSR.L H_01160E
CMPI.W #+000,D7 CODE FOR LODMGR - fn 0 LOAD
BNE.S H_011548
SUBA.L #$00000002,A1
MOVE.W D6,D1
ANDI.W #$001F,D1
BSR.S H_0115D8
MOVE.L A6,D1
H_011548 ADDA.L #$00000002,A1
BRA.S H_0115A6
H_011552 MOVEQ #255,D7
H_011554 BRA.S H_0115A6
H_011558 CMPI.W #+002,D1 CODE FOR LODMGR - fn 0 LOAD
BNE.S H_01156C
MOVE.L +00040(A5),D0
SUB.L H_0120B4(PC),D0
BRA.S H_011596
H_01156C CMPI.W #+003,D1
BNE.S H_011580
MOVE.L +00048(A5),D0
SUB.L H_0120B8(PC),D0
BRA.S H_011596
H_011580 CMPI.W #+004,D1
BNE.S H_011594
MOVE.L +00048(A5),D0
SUB.L H_0120B8(PC),D0
BRA.S H_011596
H_011594 MOVEQ #255,D7 CODE FOR LODMGR - fn 0 LOAD
H_011596 ADDA.L #$00000002,A1
MOVE.L A1,-(A7)
BSR.S H_0115C8
ADD.L D0,D1
MOVEA.L (A7)+,A1
H_0115A6 CMPI.W #+000,D7
BEQ.S H_0115B4
ADDQ.L #4,A1
BRA.S H_0115B8
H_0115B4 BSR.S H_0115EA
H_0115B8 CMPI.B #+000,(A1)+
BNE.S H_0115B8
RTS CODE FOR LODMGR - fn 0 LOAD
H_0115C0 MOVE.B (A1)+,D1
ROL.W #8,D1
MOVE.B (A1)+,D1
RTS
H_0115C8 MOVEM.L D0,-(A7)
BSR.S H_0115C0
SWAP D1
BSR.S H_0115C0
MOVEM.L (A7)+,D0
RTS
H_0115D8 MOVEM.L D0/D2,-(A7)
MOVE.W #$0001,D2 CODE FOR LODMGR - fn 0 LOAD
BSR.S H_0115FC
MOVEM.L (A7)+,D0/D2
RTS
H_0115EA MOVEM.L D0/D2,-(A7)
MOVE.W #$0003,D2
BSR.S H_0115FC
MOVEM.L (A7)+,D0/D2
RTS
H_0115FC MOVE.W #$0000,D0
BRA.S H_011608
H_011602 ROL.L #8,D1
MOVE.B D1,(A1)+
ADDQ.W #1,D0 CODE FOR LODMGR - fn 0 LOAD
H_011608 CMP.W D2,D0
BLE.S H_011602
RTS
H_01160E MOVEM.L D0-D1/A0-A3/A5,-(A7)
MOVEA.L A0,A2
CLR.W D7
LEA H_0120A4(PC),A5
H_01161A MOVEA.L (A5),A5
CMPA.L #$00000000,A5
BEQ.S H_011650
MOVEA.L +00064(A5),A1
MOVEA.L +00068(A5),A0
CMPA.L #$00000000,A1
BEQ.S H_01164C
CMPA.L #$00000000,A0
BEQ.S H_01164C
ADDA.L A1,A0 CODE FOR LODMGR - fn 0 LOAD
BSR.S H_01167C
BRA.S H_011650
H_01164C MOVE.W #$FFFF,D7
H_011650 CMPI.W #+000,(A5)
BEQ.S H_01165C
CMPI.W #+000,D7
BNE.S H_01161A
H_01165C CMPA.L #$00000000,A5
BNE.S H_011674
MOVE.W #$FFFF,D7
MOVEA.L #$00000000,A6
BRA.S H_011676
H_011674 MOVEA.L A3,A6 CODE FOR LODMGR - fn 0 LOAD
H_011676 MOVEM.L (A7)+,D0-D1/A0-A3/A5
RTS
H_01167C BSR.L H_0115C0
MOVE.W D1,D6
BSR.L H_0115C0
BSR.L H_0115C8
MOVEA.L D1,A3
BSR.S H_0116D6
CMPI.W #+000,D7
BNE.S H_01169A
MOVEA.L A1,A0
H_01169A CMPA.L A1,A0
BGT.S H_01167C
CMPI.W #+000,D0 CODE FOR LODMGR - fn 0 LOAD
BNE.S H_0116D4
MOVE.W D6,D0
ANDI.W #$0020,D0
CMPI.W #+000,D0
BEQ.S H_0116D0
MOVE.W D6,D0
ANDI.W #$001F,D0
CMPI.W #+001,D0
BLT.S H_0116C8
CMPI.W #+004,D0
BLE.S H_0116D4
H_0116C8 EQU * CODE FOR LODMGR - fn 0 LOAD
H_0116CC EQU *
H_0116D0 MOVE.W #$FFFF,D7
H_0116D4 RTS
H_0116D6 CLR.L D7
CLR.L D0
MOVE.L A2,-(A7)
H_0116DC MOVE.B (A1)+,D1
MOVE.B (A2)+,D2
CMP.B D1,D2
BEQ.S H_0116EC
MOVE.W #$FFFF,D7
MOVE.W D7,D0 CODE FOR LODMGR - fn 0 LOAD
H_0116EC CMPI.B #+000,D1
BEQ.S H_0116FA
CMPI.B #+000,D2
BNE.S H_0116FE
H_0116FA MOVE.W #$FFFF,D0
H_0116FE CMPI.W #+000,D0
BEQ.S H_0116DC
H_011704 CMPI.B #+000,D1
BEQ.S H_011710
MOVE.B (A1)+,D1
BRA.S H_011704
H_011710 MOVEA.L (A7)+,A2 CODE FOR LODMGR - fn 0 LOAD
RTS
H_011714 MOVEM.L D1/A1-A2,-(A7)
MOVE.W D0,D7
CMPI.L #$00000000,+00068(A5)
BEQ.S H_011776
CMPI.L #$00000000,+00064(A5)
BEQ.S H_011776
MOVEA.L +00064(A5),A1
MOVEA.L +00068(A5),A2
ADDA.L A1,A2
H_01173C CMPA.L A1,A2
BLE.S H_01175E
CMPI.W #+000,D7 CODE FOR LODMGR - fn 0 LOAD
BEQ.S H_01175E
ADDA.L #$00000008,A1
H_011750 CMPI.B #+000,(A1)+
BEQ.S H_01175A
BRA.S H_011750
H_01175A SUBQ.W #1,D7
BRA.S H_01173C
H_01175E MOVEA.L A1,A6
CMPI.W #+000,D7
BEQ.S H_011780
MOVE.W #$FFFF,D7
MOVEA.L #$00000000,A6
H_011772 BRA.S H_011780
H_011776 MOVE.W #$FFFF,D7 CODE FOR LODMGR - fn 0 LOAD
MOVEA.L #$00000000,A6
H_011780 MOVEM.L (A7)+,D1/A1-A2
RTS
H_011786 SUBA.L #$0000005A,A7
MOVEA.L A7,A6
MOVE.W #$0000,D7
H_011796 MOVE.B #$00,+000(A6,D7.W)
ADDQ.W #1,D7
H_01179E CMPI.W #+089,D7
BLE.S H_011796
LEA (A4),A2 CODE FOR LODMGR - fn 0 LOAD
MOVE.W #$0000,D7
H_0117AE MOVE.B (A2)+,+000(A6,D7.W)
ADDQ.W #1,D7
H_0117B4 CMPI.W #+005,D7
BLE.S H_0117AE
LEA +00006(A4),A2
MOVE.W #$0000,D7
H_0117C6 MOVE.B (A2)+,+038(A6,D7.W)
ADDQ.W #1,D7
H_0117CC CMPI.W #+007,D7 CODE FOR LODMGR - fn 0 LOAD
BLE.S H_0117C6
LEA +00014(A4),A2
MOVE.W #$0000,D7
H_0117DE MOVE.B (A2)+,+046(A6,D7.W)
ADDQ.W #1,D7
H_0117E4 CMPI.W #+002,D7
BLE.S H_0117DE
MOVE.L D3,-(A7)
BTST #0,L_SEARCH(PC)
BNE.S LM_0_NS
MOVEQ #0,D3
CMP.B #' ',(A6)
BEQ.S LM_F0_RE
CMP.B #0,(A6)
BEQ.S LM_F0_RE
LM_0_NS MOVEQ #13,D3
LM_F0_RE MOVE.B #$01,+00006(A6)
CLR.L D7 CODE FOR LODMGR - fn 0 LOAD
MOVE.B +00018(A4),D5
ORI.W #$0040,+00016(A6)
MOVE.L D3,-(A7)
BSR.L SUB_OPEN
MOVE.L (A7)+,D3
H_011804 CMPI.W #+000,D7
BEQ.S L_FILEOK
L_TRYIT BSR.L DRV_SERCH
CMP.W #0,D7
BEQ LM_F0_RE
BRA.S H_011822
L_FILEOK LEA H_0120BC(PC),A0
MOVE.W +00026(A6),(A0)
LEA H_0120BE(PC),A0
MOVE.W +00028(A6),(A0)
MOVE.B +00049(A6),+00088(A4)
H_011822 MOVE.L (A7)+,D3
ADDA.L #$0000005A,A7
RTS
H_01182A MOVEM.L A0,-(A7) CODE FOR LODMGR - fn 0 LOAD
MOVE.B +00018(A4),D5
LEA H_0120C0(PC),A6
MOVE.B #$00,(A6)
MOVE.B #$00,+00001(A6)
MOVE.B #$00,+00002(A6)
MOVE.L A0,+00004(A6)
MOVE.W D0,+00008(A6)
MOVE.W #$0000,+00010(A6)
MOVE.L #$00000000,+00012(A6)
CLR.L D7
TRAP #06 $6 IOMGR6/SYSIO
DC.W $0003 READ
NOP
NOP
H_011866 CMPI.W #+000,D7 CODE FOR LODMGR - fn 0 LOAD
BEQ.S H_011870
MOVE.W D7,D0
H_011870 MOVEM.L (A7)+,A0
RTS
H_011876 MOVE.B +00018(A4),D5
BSR.L CLOS_SUB
H_011888 CMPI.W #+000,D7
H_011890 RTS CODE FOR LODMGR - fn 0 LOAD
H_011892 MOVEM.L D0-D1/A0,-(A7)
MOVE.L D0,D1
H_011898 CMPI.L #$00000000,D1
BLE.S H_0118C4
CMPI.L #$0000FFFF,D1
BLT.S H_0118B0
MOVE.L #$0000FFFF,D0
BRA.S H_0118B2
H_0118B0 MOVE.L D1,D0
H_0118B2 SUB.L D0,D1
BSR.S H_01182A
CMPI.W #+000,D7 CODE FOR LODMGR - fn 0 LOAD
BEQ.S H_0118C0
BRA.S H_0118C4
H_0118C0 ADDA.L D0,A0
BRA.S H_011898
H_0118C4 MOVEM.L (A7)+,D0-D1/A0
RTS END OF CODE FOR LODMGR - fn 0 LOAD
*
LM_3_MODIFY EQU * CODE FOR LODMGR - fn 3 MODIFY
H_0118CA MOVEA.L A6,A4
CLR.L D7
LEA +00006(A4),A0
BSR.S H_01191A
CMPI.W #+001,D7
BHI.S H_0118FC
LEA +00030(A4),A0
LEA H_0120A4(PC),A5
BSR.L H_011C04 ?? search for modules
CMPI.W #+000,D7
BEQ.S H_0118F8
MOVE.L #$000070FF,D7
H_0118F8 BRA.S H_011902
H_0118FC MOVE.L #$000070FD,D7
H_011902 CMPI.W #+000,D7 CODE FOR LODMGR - fn 3 MODIFY
BNE.S H_011918
BTST #00,+00020(A4)
BEQ.S H_011918
BSR.L H_011AB4
H_011918 RTS
H_01191A MOVEM.L D0-D1/D4-D6/A0-A1,-(A7) SUB USED BY LOAD, MODIFY
BSR.L H_0119EE
CMPI.W #+000,D7
BNE.S H_01199E
MOVEA.L A0,A1
LEA +00008(A1),A1
MOVE.B (A0)+,D5
BSR.L H_011A3A
CMPI.W #+000,D7 CODE FOR LODMGR - fn 3 MODIFY
BEQ.S H_011988
CMPI.B #+035,D5
BNE.S H_011982
MOVE.B (A0)+,D5
BSR.L H_011A3A
CMPI.W #+000,D7
BEQ.S H_01195A
MOVEQ #255,D7
BRA.S H_01197E
H_01195A CMPI.W #+006,D4
BGT.S H_01197C
MOVE.W #$0004,D6
MOVE.W #$0003,D1 CODE FOR LODMGR - fn 3 MODIFY
BSR.S H_0119A4
CMPI.W #+65535,D7
BEQ.S H_01199E
MOVEQ #001,D7
H_011978 BRA.S H_01199E
H_01197C EQU *
H_01197E EQU *
H_011982 MOVEQ #255,D7
H_011984 BRA.S H_01199E
H_011988 MOVE.W #$0007,D6
MOVE.W #$0001,D1
BSR.S H_0119A4
CMPI.W #+65535,D7 CODE FOR LODMGR - fn 3 MODIFY
BEQ.S H_01199E
MOVEQ #000,D7
H_01199E MOVEM.L (A7)+,D0-D1/D4-D6/A0-A1
RTS
H_0119A4 CLR.W D4
CLR.W D0
CLR.W D7
H_0119AA CMP.W D0,D6
BLE.S H_0119D2
CMPI.W #+65535,D7
BEQ.S H_0119D2
MOVE.B (A0)+,D5 CODE FOR LODMGR - fn 3 MODIFY
BSR.S H_011A3A
CMP.W D7,D1
BCC.S H_0119CE
CMPI.B #+032,D5
BEQ.S H_0119CE
MOVEQ #255,D7
H_0119CE ADDQ.W #1,D0
BRA.S H_0119AA
H_0119D2 CMPA.L A0,A1
BLE.S H_0119EC
CMPI.W #+65535,D7
BEQ.S H_0119EC
CMPI.B #+032,(A0)+
BEQ.S H_0119EA
MOVEQ #255,D7 CODE FOR LODMGR - fn 3 MODIFY
H_0119EA BRA.S H_0119D2
H_0119EC RTS
H_0119EE CLR.W D4
CLR.W D7
CMPI.B #+032,(A0)
BEQ.S H_011A34
MOVE.W #$0000,D0
H_011A02 MOVE.B +000(A0,D0.W),D5
CMPI.B #+032,D5
BNE.S H_011A1C
CMPI.W #+000,D4
BNE.S H_011A18
MOVE.W D0,D4 CODE FOR LODMGR - fn 3 MODIFY
H_011A18 BRA.S H_011A28
H_011A1C CMPI.W #+000,D4
BEQ.S H_011A28
MOVE.W #$FFFF,D7
H_011A28 ADDQ.W #1,D0
H_011A2A CMPI.W #+007,D0
BLE.S H_011A02
BRA.S H_011A38
H_011A34 MOVE.W #$FFFF,D7
H_011A38 RTS
H_011A3A CMPI.B #+065,D5
BLT.S H_011A4E
CMPI.B #+090,D5 CODE FOR LODMGR - fn 3 MODIFY
BGT.S H_011A4E
MOVE.W #$0000,D7
BRA.S H_011AB2
H_011A4E CMPI.B #+048,D5
BLT.S H_011A62
CMPI.B #+057,D5
BGT.S H_011A62
MOVE.W #$0001,D7
BRA.S H_011AB2
H_011A62 CMPI.B #+013,D5
BNE.S H_011A70
MOVE.W #$0002,D7
BRA.S H_011AB2
H_011A70 CMPI.B #+032,D5 CODE FOR LODMGR - fn 3 MODIFY
BNE.S H_011A7E
MOVE.W #$0002,D7
BRA.S H_011AB2
H_011A7E CMPI.B #+044,D5
BNE.S H_011A8C
MOVE.W #$0002,D7
BRA.S H_011AB2
H_011A8C CMPI.B #+059,D5
BNE.S H_011A9A
MOVE.W #$0002,D7
BRA.S H_011AB2
H_011A9A CMPI.B #+032,D5 CODE FOR LODMGR - fn 3 MODIFY
BLS.S H_011AAE
CMPI.B #+126,D5
BHI.S H_011AAE
MOVE.W #$0003,D7
BRA.S H_011AB2
H_011AAE MOVE.W #$FFFF,D7
H_011AB2 RTS
H_011AB4 MOVE.L A5,-(A7)
LEA +00006(A4),A0
LEA H_0120A4(PC),A5
BSR.L H_011C04 ?? search for modules
MOVEA.L (A7)+,A5 CODE FOR LODMGR - fn 3 MODIFY
CMPI.W #+000,D7
BNE.S H_011AD6
MOVE.L #$000070FE,D7
BRA.S H_011AF8
H_011AD6 LEA +00006(A4),A0
LEA +00030(A4),A3
LEA +00030(A5),A1
MOVE.W #$0000,D0
H_011AEA MOVE.B (A0),(A3)+
MOVE.B (A0)+,(A1)+
ADDQ.W #1,D0 CODE FOR LODMGR - fn 3 MODIFY
H_011AF0 CMPI.W #+007,D0
BLE.S H_011AEA
CLR.L D7
H_011AF8 RTS END OF CODE FOR LODMGR - fn 3 MODIFY
*
LM_2_INQLOAD EQU * CODE FOR LODMGR - fn 2 INQLOAD
H_011AFA MOVEA.L A6,A4
LEA H_0120A4(PC),A5
MOVE.B +00020(A4),D0
ANDI.B #$01,D0
BNE.S H_011B18
LEA +00030(A4),A0
BSR.L H_011C04 search for modules
BRA.S H_011B20
H_011B18 MOVE.W +00038(A4),D0
BSR.L H_011BCA
H_011B20 MOVE.W D0,+00038(A4)
CMPI.W #+000,D7 CODE FOR LODMGR - fn 2 INQLOAD
BNE.L H_011BC4
LEA +00030(A5),A0
LEA +00030(A4),A1
MOVE.W #$0000,D0
H_011B3C MOVE.B (A0)+,(A1)+
ADDQ.W #1,D0
H_011B40 CMPI.W #+007,D0 CODE FOR LODMGR - fn 2 INQLOAD
BLE.S H_011B3C
LEA +00004(A5),A0
LEA (A4),A1
MOVE.W #$0000,D0
H_011B54 MOVE.B (A0)+,(A1)+
ADDQ.W #1,D0
H_011B58 CMPI.W #+016,D0 CODE FOR LODMGR - fn 2 INQLOAD
BLE.S H_011B54
MOVE.L +00040(A5),+00040(A4)
MOVE.L +00044(A5),+00044(A4)
MOVE.L +00048(A5),+00048(A4)
MOVE.L +00052(A5),+00052(A4)
MOVE.L +00056(A5),+00056(A4)
MOVE.L +00060(A5),+00060(A4)
MOVE.L +00064(A5),+00064(A4)
MOVE.L +00068(A5),+00068(A4)
MOVE.L +00072(A5),+00072(A4)
MOVE.L +00022(A5),+00022(A4)
MOVE.L +00026(A5),+00026(A4)
LEA +00080(A5),A0
LEA +00092(A4),A1
MOVE.W #$0000,D0 CODE FOR LODMGR - fn 2 INQLOAD
H_011BB0 MOVE.B (A0)+,(A1)+
ADDQ.W #1,D0
H_011BB4 CMPI.W #+080,D0
BLE.S H_011BB0
MOVE.W +00160(A5),+00172(A4)
BRA.S H_011BC8
H_011BC4 MOVE.W #$70FF,D7
H_011BC8 RTS
H_011BCA CMPA.L #$00000000,A5
BNE.S H_011BDA
MOVE.W #$FFFF,D7
RTS
H_011BDA MOVE.W #$0000,D1 CODE FOR LODMGR - fn 2 INQLOAD
BRA.S H_011BF6
H_011BE2 MOVEA.L (A5),A5
CMPA.L #$00000000,A5
BNE.S H_011BF4
MOVE.W #$FFFF,D7
RTS
H_011BF4 ADDQ.W #1,D1
H_011BF6 CMP.W D0,D1
BLE.S H_011BE2
LEA +00030(A5),A0
ADDQ.W #1,D0
CLR.W D7 CODE FOR LODMGR - fn 2 INQLOAD
RTS
H_011C04 CLR.W D0 search for modules, a5 points to list (@ 120A4)
H_011C06 CMPI.L #$00000000,(A5)
BNE.S H_011C18
MOVE.W #$FFFF,D7
BRA.S H_011C26
H_011C18 ADDQ.W #1,D0
MOVEA.L A5,A3
MOVEA.L (A5),A5
LEA +00030(A5),A1
BSR.S H_011C36
H_011C26 CMPI.W #+000,D7 CODE FOR LODMGR - fn 2 INQLOAD
BEQ.S H_011C34
CMPI.L #$00000000,(A5)
BNE.S H_011C06
H_011C34 RTS
H_011C36 CLR.W D7
MOVEM.L D0-D1,-(A7)
MOVE.W #$0000,D0
H_011C44 MOVE.B +000(A0,D0.W),D1
CMP.B +000(A1,D0.W),D1
BEQ.S H_011C54
MOVE.W #$FFFF,D7
H_011C54 ADDQ.W #1,D0
H_011C56 CMPI.W #+007,D0 CODE FOR LODMGR - fn 2 INQLOAD
BLE.S H_011C44
MOVEM.L (A7)+,D0-D1
RTS END OF CODE FOR LODMGR - fn 2 INQLOAD
*
LM_10_UNLOAD EQU * CODE FOR LODMGR - fn 10 UNLOAD disregarding
* mem_mgr error $6012
MOVE.L A0,-(A7)
LEA.L ERR_6012(PC),A0
MOVE.W #0,(A0)
MOVE.L (A7)+,A0
*
LM_1_UNLOAD EQU * CODE FOR LODMGR - fn 1 UNLOAD
H_011C62 MOVEM.L D0-D6/A1-A3/A6,-(A7)
MOVE.L 6(A6),D1 when unloading - make sure that commands
MOVE.L 10(A6),D2 made resident are deleted from the system
MOVE.L #3,D0 resident command table. Check for both
* SUBA.L #40,A7 the file name and the module name.
TRAP #0
DC.W 50
MOVE.L $1E(A6),D1
MOVE.L $22(A6),D2
MOVE.L #3,D0
TRAP #0
DC.W 50
* ADDA.L #40,A7
MOVEM.L (A7)+,D0-D6/A1-A3/A6
MOVEQ.L #0,D7
*
LM_9_UNLOAD EQU *
MOVEA.L A6,A4
MOVE.B #$00,089(A4)
LEA H_0120A4(PC),A5
LEA 030(A4),A0
BSR.L H_011C04
CMPI.W #+000,D7
BNE.S H_011D0C
BSR.L H_011D1A
CMPI.W #+000,D7
BNE.S H_011D08
MOVEA.L 040(A5),A6
BSR.L H_011F52
CMPI.W #+000,D7 CODE FOR LODMGR - fn 1 UNLOAD
BEQ.S H_011CA2
MOVE.B #$55,089(A4)
BRA.S H_011D08
H_011CA2 MOVEA.L 048(A5),A6
BSR.L H_011F52
CMPI.W #+000,D7
BEQ.S H_011CBC
MOVE.B #$53,89(A4)
BRA.S H_011D08
H_011CBC MOVEA.L 064(A5),A6
BSR.L H_011F52
CMPI.W #+000,D7 CODE FOR LODMGR - fn 1 UNLOAD
BEQ.S H_011CD6
MOVE.B #$54,+00089(A4)
BRA.S H_011D08
H_011CD6 MOVEA.L +00026(A5),A0
MOVEA.L A5,A6
MOVE.L (A5),(A3)
BSR.L H_011F52
CMPI.W #+000,D7
BEQ.S H_011CF4
MOVE.B #$51,+00089(A4)
BRA.S H_011D08
H_011CF4 MOVEA.L A0,A6 CODE FOR LODMGR - fn 1 UNLOAD
BSR.L H_011FDE
CMPI.W #+000,D7
BEQ.S H_011D08
MOVE.B #$55,+00089(A4)
H_011D08 BRA.S H_011D14
H_011D0C MOVE.W #$70FF,D7
MOVE.B D7,+00089(A4)
H_011D14 MOVE.W D7,+00090(A4)
RTS
H_011D1A BSR.S H_011D40
CMPI.W #+000,D7
BEQ.S H_011D2E
MOVE.W #$7067,D7 CODE FOR LODMGR - fn 1 UNLOAD
BRA.S H_011D3E
H_011D2E BSR.S H_011D92
CMPI.W #+000,D7
BEQ.S H_011D3E
MOVE.W #$7066,D7
H_011D3E RTS
H_011D40 CLR.L D7
MOVE.L +00030(A5),D1
MOVE.L +00034(A5),D2
DC.W $2278,$0A56 MOVEA.L $0A56,A1
MOVE.W #$0001,D6
H_011D52 CMPI.B #+000,D7 CODE FOR LODMGR - fn 1 UNLOAD
BNE.S H_011D90
DC.W $BC78,$0A54 CMP.W $0A54,D6
BGT.S H_011D90
CMP.L (A1),D1
BNE.S H_011D86
CMP.L +00004(A1),D2
BNE.S H_011D86
CMPI.B #+000,+00008(A1)
BEQ.S H_011D86
CMPI.B #+000,+00140(A1)
BNE.S H_011D86
MOVEQ #255,D7
H_011D86 ADDA.L #$000002EE,A1
ADDQ.W #1,D6 CODE FOR LODMGR - fn 1 UNLOAD
BRA.S H_011D52
H_011D90 RTS
H_011D92 CLR.W D7
MOVE.L +00030(A5),D0
MOVE.W +00034(A5),D1
ROL.L #8,D0
CMPI.B #+035,D0
BNE.S H_011DBE
ROR.L #8,D0
* address $00FD1892 is Plug in tray ROM
JSR $00FD1892 .L
CMPI.W #+000,D7 CODE FOR LODMGR - fn 1 UNLOAD
BNE.S H_011DBC
MOVEQ #255,D7
BRA.S H_011DBE
H_011DBC CLR.W D7
H_011DBE RTS END OF CODE FOR LODMGR - fn 1 UNLOAD
*
LM_4_LMREQMEM EQU * CODE FOR LODMGR - fn 4 LMREQMEM
BSR.S H_011DC0
CMP.W #0,D7
BNE.S LM_4_RET
MOVEM.L D0-D1/A4,-(A7)
LEA H_00EBAE(PC),A4
MOVE.L 6(A4),D0
MOVE.L 10(A4),D1
CMP.L 6(A6),D0
BNE.S LM4_TLMN
CMP.L 10(A6),D0
BEQ.S LM4_DOIT
LM4_TLMN CMP.L 30(A6),D0
BNE.S LM4_IS76
CMP.L 34(A6),D1
BNE.S LM4_IS76
LM4_DOIT CMP.L #0,26(A4)
BNE.S LM4_76A4
MOVE.L 26(A6),26(A4)
BRA.S LM4_IS76
LM4_76A4 CMP.L #0,76(A4)
BNE.S LM4_IS76
MOVE.L 26(A6),76(A4)
LM4_IS76 CMP.L #0,76(A6)
BNE.S LM4_UNDO
MOVE.L 26(A6),76(A6)
LM4_UNDO MOVEM.L (A7)+,D0-D1/A4
MOVE.W #0,D7
LM_4_RET RTS
*
H_011DC0 MOVEA.L A6,A4
CLR.B +00089(A4)
LEA +00030(A4),A0
LEA H_0120A4(PC),A5
BSR.L H_011C04
CMPI.W #+000,D7
BNE.S H_011E12
MOVE.L +00026(A4),D0
CLR.L D1
MOVE.B +00020(A4),D1
MOVE.L +00022(A5),D5
BSR.L H_011EF8
CMPI.W #+000,D7 CODE FOR LODMGR - fn 4 LMREQMEM
BNE.S H_011E0A
SUBA.L #$00000008,A6
MOVE.L +00026(A5),+00004(A6)
MOVE.L A6,+00026(A5)
ADDA.L #$00000008,A6
H_011E0A MOVE.L A6,+00026(A4)
BRA.S H_011E16
H_011E12 MOVE.W #$70FF,D7
H_011E16 CMPI.W #+000,D7
BEQ.S H_011E24
MOVE.B #$70,+00089(A4)
H_011E24 MOVE.W D7,+00090(A4)
RTS END OF CODE FOR LODMGR - fn 4 LMREQMEM
*
LM_5_LMRETMEM EQU * CODE FOR LODMGR - fn 5 LMRETMEM
H_011E2A MOVEA.L A6,A4
CLR.B +00089(A4)
LEA +00030(A4),A0
LEA H_0120A4(PC),A5
BSR.L H_011C04
CMPI.W #+000,D7
BNE.S H_011E92
MOVEA.L +00026(A4),A6
MOVEA.L A6,A0
SUBA.L #$00000008,A0
LEA +00026(A5),A1
H_011E54 CMPA.L (A1),A0
BEQ.S H_011E6A
CMPI.W #+000,(A1) CODE FOR LODMGR - fn 5 LMRETMEM
BEQ.S H_011E6A
MOVEA.L (A1),A1
LEA +00004(A1),A1
BRA.S H_011E54
H_011E6A CMPI.L #$00000000,(A1)
BEQ.S H_011E8A
MOVEA.L +00004(A0),A2
BSR.L H_011F52
CMPI.W #+000,D7
BNE.S H_011E96
MOVE.L A2,(A1)
H_011E86 BRA.S H_011E96
H_011E8A MOVE.W #$7071,D7 CODE FOR LODMGR - fn 5 LMRETMEM
H_011E8E BRA.S H_011E96
H_011E92 MOVE.W #$70FF,D7
H_011E96 CMPI.W #+000,D7
BEQ.S H_011EA4
MOVE.B #$72,+00089(A4)
H_011EA4 MOVE.W D7,+00090(A4)
RTS END OF CODE FOR LODMGR - fn 5 LMRETMEM
*
LM_6_LMINQMEM EQU * CODE FOR LODMGR - fn 6 LMINQMEM
H_011EAA MOVEA.L A6,A4
CLR.B +00089(A4)
LEA +00030(A4),A0
LEA H_0120A4(PC),A5
BSR.L H_011C04
CMPI.W #+000,D7
BNE.S H_011EE0
MOVE.L +00022(A5),D5
BSR.L H_011FA6 *+00222
CMPI.W #+000,D7
BNE.S H_011EDC *+00012
MOVE.L D1,+00084(A4)
MOVE.L D2,+00080(A4)
H_011EDC BRA.S H_011EE4
H_011EE0 MOVE.W #$70FF,D7 CODE FOR LODMGR - fn 6 LMINQMEM
H_011EE4 CMPI.W #+000,D7
BEQ.S H_011EF2
MOVE.B #$73,+00089(A4)
H_011EF2 MOVE.W D7,+00090(A4)
RTS
H_011EF8 CMPI.L #$00000008,D0
BGE.S H_011F04
MOVEQ #008,D0
H_011F04 SUBA.L #$00000014,A7
MOVEA.L A7,A6
MOVE.W #$0000,D7 CODE FOR LODMGR - fn 6 LMINQMEM
H_011F14 MOVE.B #$00,+000(A6,D7.W)
ADDQ.W #1,D7
H_011F1C CMPI.W #+019,D7
BLE.S H_011F14
MOVE.L D0,+00004(A6)
MOVE.L D1,+00008(A6)
MOVEQ #005,D4 GETMEM
TRAP #00 $0 SYSCALL
DC.W $0039 MEM_MGR
NOP
NOP
H_011F34 CMPI.W #+000,D7 CODE FOR LODMGR - fn 6 LMINQMEM
BNE.S H_011F44
MOVEA.L +00012(A6),A6
BRA.S H_011F4A
H_011F44 MOVEA.L #$00000000,A6
H_011F4A ADDA.L #$00000014,A7
RTS
H_011F52 CLR.W D7
CMPA.L #$00000000,A6
BEQ.S H_011FA4
MOVEM.L A0,-(A7)
SUBA.L #$00000008,A6
MOVEA.L (A6),A0 CODE FOR LODMGR - fn 6 LMINQMEM
ADDA.L #$00000008,A6
CMPA.L #$00000000,A0
BEQ.S H_011FA0
MOVEA.L A6,A0
SUBA.L #$00000014,A7
MOVEA.L A7,A6
MOVE.L A0,+00012(A6)
CLR.L +00004(A6)
CLR.L +00008(A6) CODE FOR LODMGR - fn 6 LMINQMEM
MOVEQ #006,D4 GIVMEM
TRAP #00 $0 SYSCALL
DC.W $0039 MEM_MGR
BRA.L H_011F94
BRA.S H_011F9A
H_011F94 CMP.W #$6012,D7
BNE.S H_011F9A
MOVE.W ERR_6012(PC),D7
H_011F9A ADDA.L #$00000014,A7
H_011FA0 MOVEM.L (A7)+,A0
H_011FA4 RTS
H_011FA6 SUBA.L #$00000014,A7
MOVEA.L A7,A6
MOVE.W #$0000,D7
H_011FB6 MOVE.B #$00,+000(A6,D7.W)
ADDQ.W #1,D7 CODE FOR LODMGR - fn 6 LMINQMEM
H_011FBE CMPI.W #+019,D7
BLE.S H_011FB6
MOVEQ #007,D4 INQMEM
TRAP #00 $0 SYSCALL
DC.W $0039 MEM_MGR
NOP
NOP
H_011FCE MOVE.L +00016(A6),D1
MOVE.L +00012(A6),D2
ADDA.L #$00000014,A7
RTS
H_011FDE MOVEM.L A0,-(A7)
MOVEA.L A6,A0 CODE FOR LODMGR - fn 6 LMINQMEM
CLR.W D7
H_011FE6 CMPA.L #$00000000,A0
BEQ.S H_012006
CMPI.W #+000,D7
BNE.S H_012006
LEA +00008(A0),A6
MOVEA.L +00004(A0),A0
BSR.L H_011F52
BRA.S H_011FE6
H_012006 MOVEM.L (A7)+,A0
RTS END OF CODE FOR LODMGR - fn 6 LMINQMEM
*
*****************************************************************************
NEW_SC63 EQU * CODE FOR FMTNAM SysCall 63
H_01200C MOVEA.L A6,A2
TRAP #00 $0 SYSCALL GBasPtr
DC.W $0034 GBasPtr
MOVEA.L +00016(A5),A5
MOVEA.L +00400(A5),A0
H_01201A CMPI.B #+032,(A0)
BNE.S H_012026
MOVE.B (A0)+,D0
BRA.S H_01201A
H_012026 MOVEA.L A0,A1 CODE FOR FMTNAM SysCall 63
H_012028 MOVE.B (A0)+,D5
BSR.L H_011A3A
CMPI.W #+002,D7
BNE.S H_012028
SUBA.L #$00000001,A0
MOVEA.L A0,A3
SUBA.L A1,A0 CODE FOR FMTNAM SysCall 63
CMPA.L #$00000008,A0
BGT.S H_01209A
MOVE.W A0,D0
SUBQ.W #1,D0
SUBA.L #$00000008,A7
MOVEA.L A7,A4
MOVE.L #' ',(A4)
MOVE.L #' ',+00004(A4)
MOVE.W #$0000,D1
BRA.S H_012072
H_01206A MOVE.B +000(A1,D1.W),+000(A4,D1.W)
ADDQ.W #1,D1
H_012072 CMP.W D0,D1 CODE FOR FMTNAM SysCall 63
BLE.S H_01206A
MOVEA.L A4,A0
BSR.L H_01191A
CMPI.W #+001,D7
BHI.S H_012090
MOVE.L (A4),(A2)
MOVE.L +00004(A4),+00004(A2)
MOVE.L A3,+00400(A5)
H_012090 ADDA.L #$00000008,A7
BRA.S H_01209C
H_01209A MOVEQ #255,D7
H_01209C MOVE.L D7,+00032(A7)
RTS CODE FOR FMTNAM SysCall 63
H_012150 EQU *+00000174
H_0120D0 EQU *+00000046
H_0120C0 EQU *+00000030
H_0120BE EQU *+00000028
H_0120BC EQU *+00000026
H_0120B8 EQU *+00000022
H_0120B4 EQU *+00000018
H_0120B0 EQU *+00000014
H_0120AC EQU *+00000010
H_0120A8 EQU *+00000006
H_0120A4 EQU *+00000002
H_0120A2 DCB.W 00087,+00000
*
**************************************************************************
ROM_SAVE EQU *
LEA.L $0ABCDEF,A0
TRAP #5
LEA.L $0ABCDEF,A0
TRAP #0
DC.W 60 MODADRCK
S_FC1C24 DC.W $2678 MOVEA.L $0A14,A3
DC.W $0A14
LEA +00416(A3),A6
MOVEA.L A6,A5
MOVE.W #$0049,D0
S_FC1C34 CLR.B (A5)+
DBF D0,S_FC1C34
LEA +00746(A3),A5
MOVE.W #$000F,D0
S_FC1C42 CLR.B (A5)+
DBF D0,S_FC1C42
TRAP #00 $0 SYSCALL
DC.W $000F FmtDib*
CMPI.W #+002,D7
BEQ.S S_FC1C60
CMPI.W #+003,D7
BGT.S S_FC1C5C
MOVE.W #$0184,D7
S_FC1C5C BRA.L S_FC1DF8
S_FC1C60 TRAP #00 $0 SYSCALL
DC.W $0010 NxTok*
CMPI.B #+044,+00411(A3)
BNE.L S_FC1DF4
TRAP #00 $0 SYSCALL
DC.W $0010 NxTok*
CMPI.B #+003,+00411(A3)
BNE.L S_FC1DF4
MOVEA.L +00412(A3),A1
TRAP #00 $0 SYSCALL
DC.W $0010 NxTok*
CMPI.B #+044,+00411(A3)
BNE.L S_FC1DF4
TRAP #00 $0 SYSCALL
DC.W $0010 NxTok*
CMPI.B #+003,+00411(A3)
BNE.L S_FC1DF4
MOVEA.L +00412(A3),A2
S_FC1CB6 TRAP #00 $0 SYSCALL
DC.W $0010 NxTok*
CMPI.B #+013,+00410(A3)
BEQ.S S_FC1D08
CMPI.B #+044,+00411(A3)
BNE.L S_FC1DF4
TRAP #00 $0 SYSCALL
DC.W $0010 NxTok*
CMPI.B #+003,+00411(A3)
BNE.L S_FC1DF4
MOVE.L +00412(A3),D0
LSR.L #1,D0
BCS.L S_FC1E04
MOVEA.L +00412(A3),A0
CMPA.L A0,A1
BGT.S S_FC1CF0
CMPA.L A0,A2
BGT.S S_FC1CF4
S_FC1CF0 BRA.L S_FC1E04
S_FC1CF4 TRAP #00 $0 SYSCALL NxTok*
DC.W $0010 NxTok*
CMPI.B #+013,+00411(A3)
BNE.L S_FC1DF4
MOVE.B #$01,+00049(A6)
S_FC1D08 MOVE.W #$8800,+00016(A6)
SUBA.L A1,A2
ADDQ.L #1,A2
MOVE.L A2,D0
MOVE.L D0,D1
CMPI.W #+21337,+00046(A6)
BNE.S S_FC1D3C
CMPI.B #+083,+00048(A6)
BNE.S S_FC1D3C
DIVU #$0100,D0
ANDI.L #$0000FFFF,D0
ADDQ.L #2,D0
MOVE.L D0,+00066(A6)
ORI.W #$1000,+00016(A6)
S_FC1D3C ORI.W #$0040,+00016(A6)
MOVE.B #$01,D5
TRAP #06 $6 IOMGR6/SYSIO
DC.W $0001 OPEN
BRA.L S_FC1DFE
S_FC1D4E MOVE.B +00049(A6),D0
LEA +00746(A3),A6
LEA +00490(A3),A4
CMPI.B #+001,D0
BNE.S S_FC1D6C
MOVE.B #$16,(A4)
MOVE.W #$0005,+00008(A6)
BSR.S S_FC1DBC
S_FC1D6C MOVEA.L A1,A0
MOVE.L #$0000FFFF,D2
S_FC1D74 CMP.L D1,D2
BLE.S S_FC1D7A
MOVE.W D1,D2
S_FC1D7A BSR.S S_FC1DA6
MOVE.L A0,+00004(A6)
MOVE.W D2,+00008(A6)
BSR.S S_FC1DDA
ADDA.L #$0000FFFF,A0
SUBI.L #$0000FFFF,D1
BGT.S S_FC1D74
S_FC1D94 DC.W $4DF8,$0000 LEA $0000,A6
MOVE.B #$01,D5
TRAP #06 $6 IOMGR6/SYSIO
DC.W $0002 CLOSE
BRA.L S_FC1DFE
S_FC1DA4 BRA.L NEW_SV_EXIT
S_FC1DA6 MOVE.B #$03,(A4)
MOVE.W D2,D0
MOVE.B D0,+00006(A4)
ROR.W #8,D0
MOVE.B D0,+00005(A4)
MOVE.W #$0007,+00008(A6)
S_FC1DBC MOVE.L A0,D0
ROL.L #8,D0
MOVE.B D0,+00001(A4)
ROL.L #8,D0
MOVE.B D0,+00002(A4)
ROL.L #8,D0
MOVE.B D0,+00003(A4)
ROL.L #8,D0
MOVE.B D0,+00004(A4)
MOVE.L A4,+00004(A6)
S_FC1DDA CLR.W +00010(A6)
MOVE.B #$01,D5
TRAP #06 $6 IOMGR6/SYSIO WRITE
DC.W $0004 WRITE
BRA.L S_FC1DEC
S_FC1DEA RTS
S_FC1DEC ADDQ.L #4,A7
TRAP #00 $0 SYSCALL
DC.W $000C PrtErr*
BRA.S S_FC1D94
S_FC1DF4 MOVE.W #$0101,D7
S_FC1DF8 TRAP #00 $0 SYSCALL
DC.W $0009 CPRTERR
BRA.S NEW_SV_EXIT
S_FC1DFE TRAP #00 $0 SYSCALL
DC.W $000C PrtErr*
BRA.S NEW_SV_EXIT
S_FC1E04 LEA S_FC1E36,A6
S_FC1E0A TRAP #00 $0 SYSCALL
DC.W $0013 PrtErMsg*
BRA.S NEW_SV_EXIT
S_FC1E10 DC.B 'ENDING ADDRESS IS TOO LOW OR TOO HIGH',$D
S_FC1E36 DC.B 'INVALID TRANSFER ADDRESS',$D,$0
DS.W 0
NEW_SV_EXIT EQU *
*
**************************************************************************
LIST
UNHYPE EQU *
LEA.L $FEDCBA,A0
TRAP #0 SYSCALL
DC.W 60 MODADRCK
*
INIT_DONE EQU *
*
TRAP #0 SYSCALL
DC.W 48 SUPMODE
LEA $43B0,A0 Clear CTRL-Break and CTRL-NumLock ...
MOVE.W #0,(A0)
*
TRAP #00 $0 SYSCALL
DC.W $002B Exit
* END OF CODE FOR ROM_SAVE
*
NOLIST
**************************************************************************
MODULES EQU *
BSR.L CLSH
*
QUERY EQU *
MOVEA.L #$0ABCDEF,A0
TRAP #5
MOVEA.L #$0ABCDEF,A0
TRAP #0
DC.W 60 MODADRCK
Q_00E0DC SUBA.L #$000000AE,A7
MOVEA.L A7,A4
MOVE.W #173,D7
Q_00E104 MOVE.B #$00,+000(A4,D7.W)
DBRA D7,Q_00E104
LEA +00030(A4),A6
TRAP #00 $0 SYSCALL
DC.W $003F 2-FmtNam
CMPI.W #+65535,D7
BNE.S Q_00E152
CLR.B D0
TRAP #00 $0 SYSCALL
DC.W $001B GStat
TRAP #00 $0 SYSCALL
DC.W $0010 NxTok*
CMPI.B #+013,+00011(A5)
BNE.S Q_00E13E
BSR.S Q_00E168
BRA.S Q_00E156
Q_00E13E LEA Q_00E3D2(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
LEA Q_00E3ED(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0013 PrtErMsg*
Q_00E14E BRA.S Q_00E156
Q_00E152 BSR.L Q_00E1DC
Q_00E156 ADDA.L #$000000AE,A7
LEA Q_00E588(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
BRA.L NEW_SV_EXIT
Q_00E168 MOVE.B #$01,+00020(A4)
MOVEA.L A4,A6
MOVEQ #002,D4 INQLOAD
TRAP #00 $0 SYSCALL 2
DC.W $0040 2-LodMgr
NOP
NOP
Q_00E17A CMPI.W #+000,D7
BNE.S Q_00E1C4
LEA +00030(A4),A0
LEA Q_00E589(PC),A1
MOVE.B #' ',(A1)+
MOVE.B #' ',(A1)+
MOVE.W #$0000,D0
Q_00E19A CMPI.B #+032,(A0)
BGE.S Q_00E1AC
MOVE.B #'.',(A1)+
ADDQ.L #1,A0
BRA.S Q_00E1AE
Q_00E1AC MOVE.B (A0)+,(A1)+
Q_00E1AE ADDQ.W #1,D0
Q_00E1B0 CMPI.W #+007,D0
BLE.S Q_00E19A
MOVE.B #$0D,(A1)
LEA Q_00E589(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
BRA.S Q_00E168
Q_00E1C4 MOVE.W +00038(A4),D0
LEA Q_00E42F(PC),A0
ADDQ.L #6,A0
BSR.L Q_HEXDO
LEA Q_00E42F(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
RTS
Q_00E1DC MOVE.B #$00,+00020(A4)
MOVEA.L A4,A6
MOVEQ #002,D4 INQLOAD
TRAP #00 $0 SYSCALL
DC.W $0040 2-LodMgr
NOP
NOP
Q_00E1EE CMPI.W #+000,D7
BNE.L Q_00E2B2
MOVE.L +00040(A4),D0
LEA Q_00E44A(PC),A6
BSR.L Q_00E2D8
MOVE.L +00044(A4),D0
LEA Q_00E465(PC),A6
BSR.L Q_00E2D8
LEA Q_00E588(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
MOVE.L +00048(A4),D0
LEA Q_00E482(PC),A6
BSR.L Q_00E2D8
MOVE.L +00052(A4),D0
LEA Q_00E49D(PC),A6
BSR.L Q_00E2D8
LEA Q_00E588(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
LEA Q_00E564(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
MOVE.L +00056(A4),D0
LEA Q_00E4BA(PC),A6
BSR.L Q_00E2D8
LEA Q_00E588(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
LEA Q_00E564(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
MOVE.L +00060(A4),D0
LEA Q_00E4D7(PC),A6
BSR.S Q_00E2D8
LEA Q_00E588(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
MOVE.L +00064(A4),D0
LEA Q_00E4F4(PC),A6
BSR.S Q_00E2D8
MOVE.L +00068(A4),D0
LEA Q_00E50F(PC),A6
BSR.S Q_00E2D8
LEA Q_00E588(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
MOVE.L +00072(A4),D0
LEA Q_00E52C(PC),A6
BSR.S Q_00E2D8
BSR.S Q_00E2BC - COMPUTE ACQUIRED MEMORY
LEA Q_00E547(PC),A6
BSR.S Q_00E2D8
LEA Q_00E588(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
BRA.S Q_00E2BA
Q_00E2B2 LEA Q_00E40F(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
Q_00E2BA RTS
Q_00E2BC CLR.L D0
LEA 026(A4),A1
** MOVE.L SSTACK(PC),A3
* LEA SUP_STACK(PC),A3
Q_00E2C2 CMPI.L #$00000000,(A1)
BEQ.S Q_00E2D6
ANDI.L #$0FFFFFE,(A1) PREVENT ADDR TRAP - REPAIR IS SCREWY
MOVEA.L (A1),A1
ANDI.L #$0FFFFFE,(A1) REPAIR IS SCREWY
ADD.L (A1),D0
LEA +00004(A1),A1
BRA.S Q_00E2C2
Q_00E2D6 RTS
Q_00E2D8 MOVEM.L A0/A6,-(A7)
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
LEA Q_00E589(PC),A0
BSR.S Q_DOHEX
LEA Q_00E589(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
MOVEM.L (A7)+,A0/A6
RTS
Q_DOHEX EQU *
BSR.S SM_DOHEX
MOVE.B #$04,(A0)+
RTS
SM_DOHEX EQU *
Q_00E2F6 MOVEM.L D0-D2/D7/A1,-(A7)
LEA HEX_DIGITS(PC),A1
CLR.L D7
MOVE.W #$0001,D2
Q_00E306 ROL.L #4,D0
MOVE.B D0,D1
ANDI.W #$000F,D1
CMPI.B #+000,D7
BNE.S Q_00E334
CMPI.B #+000,D1
BNE.S Q_00E326
MOVE.B #' ',(A0)+
BRA.S Q_00E338
Q_00E326 MOVE.B #'$',(A0)+
MOVE.B +000(A1,D1.W),(A0)+
MOVEQ #255,D7
Q_00E330 BRA.S Q_00E338
Q_00E334 MOVE.B +000(A1,D1.W),(A0)+
Q_00E338 ADDQ.W #1,D2
Q_00E33A CMPI.W #+008,D2
BLE.S Q_00E306
CMPI.B #+000,D7
BNE.S Q_00E35A
SUBA.L #$00000002,A0
MOVE.B #'<',(A0)+
MOVE.B #'0',(A0)+
MOVE.B #'>',(A0)+
Q_00E35A MOVEM.L (A7)+,D0-D2/D7/A1
RTS
Q_HEXDO MOVEM.L D0-D2/A1,-(A7)
LEA HEX_DIGITS(PC),A1
MOVE.W #$0064,D2
BSR.S Q_00E3A2
BSR.S Q_00E3B8
MOVE.W #$000A,D2
BSR.S Q_00E3A2
BSR.S Q_00E3B8
ANDI.W #$000F,D0
MOVE.B +000(A1,D0.W),(A0)+
MOVEM.L (A7)+,D0-D2/A1
RTS
Q_00E3A2 MOVE.W #$FFFF,D7
Q_00E3A6 CMPI.B #+000,D0
BLT.S Q_00E3B4
MOVE.B D0,D1
ADDQ.W #1,D7
SUB.B D2,D0
BRA.S Q_00E3A6
Q_00E3B4 MOVE.B D1,D0
RTS
Q_00E3B8 ANDI.W #$000F,D7
CMPI.B #+000,D7
BNE.S Q_00E3CC
MOVE.B #' ',(A0)+
BRA.S Q_00E3D0
Q_00E3CC MOVE.B +000(A1,D7.W),(A0)+
Q_00E3D0 RTS
Q_00E3D2 DC.B 'Usage: QUERY [modulename]',$D
Q_00E3ED DC.B 'Invalid Module Name',$D
Q_00E401 DC.B 'NAME TOO LONG',$D
Q_00E40F DC.B 'Module Not Found',$D
Q_00E420 DC.B 'INTERNAL ERROR',$D
Q_00E42F DC.B ' Module(s) Found.',$D
Q_00E44A DC.B ' TEXT SEGMENT ADDRESS = ',$4
Q_00E465 DC.B ' TEXT SEGMENT SIZE = ',$4
Q_00E482 DC.B ' DATA SEGMENT ADDRESS = ',$4
Q_00E49D DC.B ' INITIALIZED DATA SIZE = ',$4
Q_00E4BA DC.B ' BSS SIZE = ',$4
Q_00E4D7 DC.B ' STACK SIZE = ',$4
Q_00E4F4 DC.B ' SYMBOL TABLE ADDRESS = ',$4
Q_00E50F DC.B ' SYMBOL TABLE SIZE = ',$4
Q_00E52C DC.B ' ENTRY POINT ADDRESS = ',$4
Q_00E547 DC.B ' ACQUIRED MEMORY = ',$4
Q_00E564 DC.B ' . . . . . . . . . . . . . . . . .',$4
Q_00E589 EQU *+1
Q_00E588 DC.B $D,' ',$D
DC.W +00000
BCHG D0,D4 $0144
* END OF CODE FOR QUERY
*
**************************************************************************
POOLS EQU *
BSR.L CLSH
*
**************************************************************************
SYSMAP EQU *
SM_0E000 EQU *
SM_0E034 EQU *
MOVEA.L #$0ABCDEF,A0
TRAP #5 SUPMODE
MOVEA.L #$0ABCDEF,A0
TRAP #0 SYSCALL
DC.W 60 MODADRCK
SM_0E0D4 MOVEQ #007,D4 INQMEM
MOVE.L #'USRM',D5
LEA SM_0E33A(PC),A6
TRAP #0 SYSCALL
DC.W $0039 MEM_MGR
BRA.L SM_0E1AE
SM_0E102 MOVE.L SM_0E342(PC),D0
LEA SM_0E24B(PC),A0
BSR.L SM_DOHEX(PC)
MOVE.L SM_0E346(PC),D0
LEA SM_0E297(PC),A0
BSR.L SM_DOHEX(PC)
MOVE.L SM_0E34A(PC),D0
LEA SM_0E2E3(PC),A0
BSR.L SM_DOHEX(PC)
MOVEQ #007,D4 INQMEM
MOVE.L #'SYSM',D5
LEA SM_0E33A(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0039 MEM_MGR
BRA.L SM_0E1AE
SM_0E148 MOVE.L SM_0E342(PC),D0
LEA SM_0E272(PC),A0
BSR.L SM_DOHEX(PC)
MOVE.L SM_0E346(PC),D0
LEA SM_0E2BE(PC),A0
BSR.L SM_DOHEX(PC)
MOVE.L SM_0E34A(PC),D0
LEA SM_0E30A(PC),A0
BSR.L SM_DOHEX(PC)
TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVE.L +00012(A5),D0
LEA SM_0E32F(PC),A0
BSR.L SM_DOHEX(PC)
LEA SM_0E230(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
LEA SM_0E27C(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
LEA SM_0E2C8(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
LEA SM_0E314(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
BRA.S SM_0E1B2
SM_0E1AE TRAP #00 $0 SYSCALL
DC.W $000C PrtErr*
SM_0E1B2 BRA.L NEW_SV_EXIT
SM_0E272 EQU *+00000066
SM_0E230 DC.B ' TOTAL USER MEMORY '
SM_0E24B DC.B ' TOTAL SYSTEM MEMORY ',$D
SM_0E2BE EQU *+00000066
SM_0E27C DC.B ' TOTAL FREE USER MEMORY '
SM_0E297 DC.B ' TOTAL FREE SYSTEM MEMORY ',$D
SM_0E30A EQU *+00000066
SM_0E2C8 DC.B ' LARGEST CONTIGUOUS BLOCK '
SM_0E2E3 DC.B ' LARGEST CONTIGUOUS BLOCK ',$D
SM_0E32F EQU *+00000027
SM_0E339 EQU *+00000037
SM_0E314 DC.B ' END OF RAM ',$D,$0
DS.W 0
SM_0E34A EQU *+00000016
SM_0E346 EQU *+00000012
SM_0E342 EQU *+00000008
SM_0E33A DCB.W 00012,+00000
BCHG D0,D4 $0144
WORDS37 DCB.W 00037,+00000
*
**************************************************************************
COLDBOOT EQU *
MOVEA.L #$0ABCDEF,A0
TRAP #5
NOP
NOP
MOVEQ.L #0,D0
MOVEA.L D0,A0
MOVEA.L (A0)+,A7
MOVEA.L (A0),A0
JMP (A0)
BSR.L INIT_DONE
*
**************************************************************************
O_LOADB EQU *
MOVEA.L #$0ABCDEF,A0
TRAP #5
MOVEA.L #$0ABCDEF,A0
TRAP #0
DC.W 60 MODADRCK
TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L +00016(A5),A1 16(A5) = USRPAG ($D400)
MOVE.B #$FF,+01298(A1) MAGIC BYTE - TELLS LOAD TO DO BIN
JSR H_00EC66(PC)
TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L +00016(A5),A1
CLR.B +01298(A1) CLEAR MAGIC BYTE
BRA.L UNHYPE
*
**************************************************************************
RESIDENT EQU *
BSR.L CLSH
*
**************************************************************************
COMMAND EQU *
MOVEA.L #$0ABCDEF,A0 supervisor mode
TRAP #5
MOVEA.L #$0ABCDEF,A0 turn off address checking
TRAP #0
DC.W 60 MODADRCK
MOVE.L #' ',D1
BSR.L INPUT_SUB
CMPI.L #' ',D1
BEQ.S GTO_RES
MOVEQ #2,D0 LOOKUP
TRAP #0 SYSCALL
DC.W 50 RES_CMD
CMP.W #0,D7
BEQ.S CMD__OK
GTO_RES BRA.S IN_RES no command in specific - list all
*
CMD__OK CMPA.L #0,A0 whereis a specific command
BEQ.S GTO_RES
MOVE.L A0,D0
LEA ALIASE(PC),A0
MOVE.L D1,(A0)
MOVE.L D2,4(A0)
LEA GUNK(PC),A0
BSR.L SM_DOHEX
MOVE.B #$D,(A0)
LEA.L ALIASE(PC),A6
TRAP #0 SYSCALL
DC.W 18 PRTMSG
BRA.L UNHYPE
* *
IN_RES MOVEA.L #$0ABCDEF,A0 |GET INTO SYSTEM MODE
TRAP #5 |
MOVEA.L #$0ABCDEF,A0 |
TRAP #0 | TURN OFF ADDRESS CHECKING
DC.W 60 MODADRCK |
LEA.L RES_C_MES(PC),A6
TRAP #0
DC.W 18
LEA.L CHAR13(PC),A6
TRAP #0
DC.W 18
LEA.L RES_CMD_TABLE(PC),A0
LEA.L WORDS37(PC),A6
LEA H_00EBA2(PC),A2
RES_LOOP EQU *
MOVEA.L A6,A1
MOVEQ.L #5,D0
IN_LOOP MOVE.L #' ',(A1)+
MOVE.L (A0)+,(A1)+
MOVE.L (A0)+,(A1)+
MOVE.L (A0)+,D1
CMPI.L #$000,D1
BNE.S RC_NOT_0
ADDQ.L #1,D0 is 0 = null entry, skipit!
SUBQ.L #6,A1
SUBQ.L #6,A1
RC_NOT_0 CMPI.L #-1,D1
DBEQ D0,IN_LOOP
MOVE.B #$D,(A1)+
TRAP #0 SYSCALL
DC.W 18 PRTMSG
CMPA.L A0,A2
BLS.S RES_OUT
CMPI.L #-1,D1
BNE.S RES_LOOP
RES_OUT BRA.L WHAT_PATH
RES_C_MES DC.B 'Resident commands are: '
CHAR13 DC.B $D
DS.W 0
*
****************************************************************************
RSTDSK EQU *
MOVEA.L #$0ABCDEF,A0
TRAP #5
MOVEA.L #$0ABCDEF,A0
TRAP #0
DC.W 60 MODADRCK
LEA RST_DIB(PC),A6
LEA FUNPKT(PC),A5
MOVE.W #16,(A5)
MOVE.L 0,2(A5)
MOVE.L #0,FP_ADD-RST_DIB-10(A6)
MOVE.L #0,FP_ADD-RST_DIB-6(A6)
MOVE.W #$C000,FP_ADD-RST_DIB-2(A6)
MOVE.L A5,FP_ADD-RST_DIB(A6)
MOVE.L #'#FD0',(A6)
MOVE.W #'0 ',4(A6)
MOVE.B #1,6(A6)
MOVEQ.L #73,D5
MOVEQ.L #3,D0
RSTLOOP EQU *
MOVEM.L D5/D7/A5/A6,-(A7)
TRAP #6
DC.W 1 OPEN
NOP
NOP
MOVEM.L (A7)+,D5/D7/A5/A6
MOVEM.L D5/D7/A5/A6,-(A7)
MOVE.W #16,(A5)
MOVE.L 0,2(A5)
EXG A5,A6
TRAP #6
DC.W 2 FUNC
NOP
NOP
MOVEM.L (A7)+,D5/D7/A5/A6
MOVE.W #16,(A5)
MOVE.L 0,2(A5)
EXG A5,A6
ADDI.B #1,4(A6)
ADDQ.L #1,D5
DBRA D0,RSTLOOP
BRA.L UNHYPE
FUNPKT DC.W 16,0,0,0
RST_DIB DC.B '#FD00 '
DC.B 1,0
DC.L 0,0
DC.W $C000
FP_ADD DC.L FUNPKT
DC.L 0,0
*
****************************************************************************
GET_NUM MOVEM.L D2-D5/A5/A6,-(A7)
MOVEQ #0,D0
TRAP #0
DC.W 27 GSTAT
CMPA.L #0,A5
BNE.S GN__PARSE
GN__ERR MOVEQ #0,D0
MOVE.B #13,D1
BRA.S GN__EX
GN__OK CMP.B #3,11(A5)
BEQ.S GN__OUT
MOVEQ #0,D0
CMP.B #13,11(A5)
BEQ.S GN__OUT2
CMP.B #0,11(A5)
BEQ.S GN__ERR
GN__PARSE TRAP #0
DC.W 16 NXTOK
MOVE.B 11(A5),D1
BRA GN__OK
GN__OUT MOVE.L 12(A5),D0
GN__OUT2 MOVE.B 11(A5),D1
MOVE.L 4(A5),A6
CMP.B #'-',-1(A6)
BNE.S GN__EX
NEG.L D0
GN__EX MOVEM.L (A7)+,D2-D5/A5/A6
RTS
*
****************************************************************************
BEEP EQU *
BSR GET_NUM
CMP.W #31,D0
BLS.S BEEP_OK
MOVE.W #31,D0
BEEP_OK MOVE.L D0,D2
MOVEA.L #$0ABCDEF,A0
TRAP #5
LEA LEDS_(PC),A0
MOVE.B #$FD,(A0)
MOVEQ.L #0,D0
MOVEQ.L #1,D1
BEEP_L MOVE.B #$FC,$0F00001
TRAP #0
DC.W 29 DELAY
DBRA D2,BEEP_L
BRA.L UNHYPE
*
****************************************************************************
HOWL MOVEA.L #$0ABCDEF,A0
TRAP #5
LEA LEDS_(PC),A0
MOVE.B #$FF,$0F00001
MOVE.B #$FF,(A0)
BRA.L UNHYPE
*
****************************************************************************
QUIET EQU *
SHUSH MOVE SR,D0
MOVEA.L #$0ABCDEF,A0
TRAP #5
LEA LEDS_(PC),A0
MOVE.B #$FD,(A0)
MOVE.B #$FD,$0F00001
MOVE D0,SR
RTS
****************************************************************************
* CODE BELOW AS POSITION INDEPENDENT CODE SO CAN BE MOVED TO CSOS
* SYSM MEMORY POOL
*
*TRAP 12 HANDLER
TRAPC EQU *
* If already in Supervisor state, just return
BTST.B #5,(A7)
BNE.S RTELOC
* Prep for switch to supervisor state, by updating stacked SR
ORI.W #$2000,(A7)
* SWITCH STACKS AND RETURN
SWSTACK EQU *
* Turn off interrupts for stack switch
ORI.W #$0700,SR
* save contants of A0 register & ESTABLISH ADDRESSING
MOVE.L A0,-(A7)
LEA.L A0SAVESX(PC),A0
MOVE.L (A7)+,(A0)
* save A1
MOVE.L A1,4(A0)
* get User's SP, and move SR, PC from SSP to USP data areas
MOVE.L USP,A1
MOVE.W (A7)+,12(A0)
MOVE.L (A7)+,8(A0)
MOVE.L 8(A0),-(A1)
MOVE.W 12(A0),-(A1)
* store SSP as USP
MOVE.L A7,USP
* restore User's SP as SP (now SSP)
MOVEA.L A1,A7
* restore A0 & A1
MOVEA.L 4(A0),A1
MOVEA.L (A0),A0
RTELOC RTE
DS.W 1
A0SAVESX DS.L 1
A1SAVESX DS.L 1
DS.L 1
SPTEMPSX DS.W 1
DS.L 1
*
*
*TRAP 11 HANDLER
TRAPB EQU *
* If already in USER state, just return
BTST.B #5,(A7)
BEQ.S RTELOC
* Prep for switch to USER state, by updating stacked SR
ANDI.W #$D0FF,(A7)
BRA.S SWSTACK
*
*****************************************************************************
SUBMIT BSR RESET_SUB_INDIC
MOVEA.L $0A14,A1
LEA $FC2674,A6
MOVE.B #$F6,D5
TRAP #06 IOMGR6/SYSIO
DC.W $0006 FUNC
BRA.L PRT_ERR_
SBFC258A EQU *
*SBFC258A BRA.S SBFC2592
*PRT_ERR_ TRAP #0 SYSCALL
* DC.W $0009 CPrtErr*
* BRA.L UNHYPE
SBFC2592 LEA +00762(A1),A6
MOVEQ #073,D0
SBFC259A CLR.B (A6)+
DBF D0,SBFC259A
LEA +00762(A1),A6
LEA +01092(A1),A5
MOVEQ #015,D0
SBFC25AC CLR.B (A5)+
DBF D0,SBFC25AC
LEA +01092(A1),A5
MOVE.B #$01,+00006(A6)
LEA +00836(A1),A2
MOVE.L A2,+00004(A5)
TRAP #00 $0 SYSCALL
DC.W $000F FmtDib*
CMPI.W #+002,D7
BNE.S SBFC25CE
BSR SET_SUB_INDIC
JMP $0FC25E4
SBFC25CE CMPI.W #+00260,D7
BNE.L SB_SYNTAX
MOVEQ #0,D3
SB_T_SUB LEA +00046(A6),A2
MOVE.B #'S',(A2)+
MOVE.B #'U',(A2)+
MOVE.B #'B',(A2)
SBFC25E4 ORI.W #$0040,+00016(A6)
MOVE.B #$01,+00006(A6)
MOVE.B #$F5,D5
TRAP #06 $6 IOMGR6/SYSIO
DC.W $0001 OPEN
BRA.L SBFC2648
LEA +00762(A1),A6
LEA +01092(A1),A5
BSR SET_SUB_INDIC
JMP $0FC25F6
SBFC2648 CMPI.W #10,D7
BEQ.S SB_ALT_DRV
CMPI.W #$8600,D7
BEQ.S SB_ALT_DRV
CMPI.W #$8500,D7
BEQ.S SB_CLOSE
SB_TRY_ LEA +00046(A6),A2
CMPI.B #'S',(A2)
BEQ.S SB_T_BAT
BRA.S SB_NEXT
SB_T_BAT MOVE.B #'B',(A2)+
MOVE.B #'A',(A2)+
MOVE.B #'T',(A2)
SB_CLOSE MOVE.B #$F5,D5
BSR.L SUB_CLOSE
LEA +00762(A1),A6
LEA +01092(A1),A5
MOVEQ #0,D7
BRA.S SBFC25E4
SB_ALT_DRV EQU *
SB_NEXT BSR.L DRV_SERCH
CMP.W #0,D7
BEQ SB_T_SUB
BRA PRT_ERR_
SB_SYNTAX MOVE.W #$0101,D7
PRT_ERR_ EQU *
TRAP #00 $0 SYSCALL
DC.W $0009 CPRTERR
BSR RESET_SUB_INDIC
BRA.L UNHYPE
*
*-------------------------------------------------------------------------
SET_SUB_INDIC EQU *
MOVEM.L D6/A0,-(A7)
MOVE SR,D6
TRAP #0 SYSCALL
DC.W 48 SUPMODE
LEA IS_SUBMIT(PC),A0
MOVE #$FF,(A0)
MOVE D6,SR
MOVEM.L (A7)+,D6/A0
RTS
*
*-------------------------------------------------------------------------
RESET_SUB_INDIC EQU *
MOVEM.L D6/A0,-(A7)
MOVE SR,D6
TRAP #0 SYSCALL
DC.W 48 SUPMODE
LEA IS_SUBMIT(PC),A0
MOVE #0,(A0)
MOVE D6,SR
MOVEM.L (A7)+,D6/A0
RTS
*
*****************************************************************************
MR_US_MESS DC.B 'Usage: MAKERES file [where file is any '
DC.B 'EXE file, becomes a resident command]',$D
DS.W 0
MR_USAGE LEA MR_US_MESS(PC),A6
BRA.L W_P_P
*
MAKRES EQU *
MOVEA.L #$0ABCDEF,A0
TRAP #5 SUPMODE
MOVEA.L #$0ABCDEF,A0
TRAP #0 SYSCALL
DC.W 60 MODADRCK
* BSR USRM_DOWN
MOVE.B #247,D5
BSR.L SUB_CLOSE
TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L +00016(A5),A3
LEA +00416(A3),A6
MOVEQ.L #0,D7
MOVEQ #073,D0
MRFC259A CLR.B (A6)+
DBF D0,MRFC259A
LEA +00416(A3),A6
MOVE.B #$01,+00006(A6)
TRAP #00 $0 SYSCALL
DC.W $000F FmtDib*
CMPI.W #+002,D7 fully spec'd filename
BEQ.S MRFC25E4
MRFC25CE CMPI.W #+00260,D7 filename w/o extension
BNE MR_USAGE
LEA 46(A6),A2
MOVE.B #'R',(A2)+
MOVE.B #'E',(A2)+
MOVE.B #'S',(A2)
MRFC25E4 LEA +00038(A6),A2
LEA 0,A0
MOVEQ #2,D0 LOOKUP
MOVE.L (A2)+,D1
MOVE.L (A2),D2
TRAP #0 SYSCALL
DC.W 50 RES_CMD
MOVEQ #0,D3
CMP.W #0,D7 - didn't find command
BNE.S MR_NOT_FND
CMPA.L #0,A0 - found command w/ dummy ep
BEQ.S MR_NOT_FND
MOVE.W #$4101,D7
BRA.S MR_GTO_PE
MR_NOT_FND EQU *
LEA 416(A3),A6
MOVE.B #247,D5
TRAP #0 SYSCALL
DC.W 14 LOADB
CMP.W #0,D7
BEQ.S MAK_RES_COOL
BSR DRV_SERCH
CMP.W #0,D7
BEQ.S MR_NOT_FND
CMP.B #'R',46(A6)
BNE.S MR_GTO_PE
MOVE.W #'EX',46(A6)
MOVE.B #'E',48(A6)
MOVEQ #0,D3
BRA MR_NOT_FND
MR_GTO_PE LEA H_00EC5C(PC),A0 SET "MAGIC" BYTE - FORCES CLEANUP
MOVE.B #$FF,(A0)
BRA.L PRT_ERR_
MAK_RES_COOL EQU *
MOVE.L A2,-(A7)
LEA 38(A6),A2
MOVE.L (A2)+,D1
MOVE.L (A2),D2
CMP.L #'DIR ',D1
BNE.S MR_OK_2
BRA SYSMAP
MR_OK_2 MOVE.L (A7)+,A0
LEA MR_MES(PC),A6
MOVE.L D1,(A6)
MOVE.L D2,4(A6)
MOVEQ.L #0,D7
MOVEQ.L #0,D0 ADD_CMD
TRAP #00 $0 SYSCALL
DC.W $0032 RES_CMD
CMP.W #0,D7
BNE MR_GTO_PE
LEA H_00EBAE(PC),A6
MOVE.W #173,D0
MR_Z_LCB MOVE.B #0,0(A6,D0.W)
DBRA D0,MR_Z_LCB
LEA MR_MES(PC),A6
TRAP #0
DC.W 18 PRTMSG
BRA SYSMAP
MR_MES DC.B ' now resident.',$D
*
****************************************************************************
HOME MOVEQ.L #255,D6
BRA.S IN_CLSH
CLSH MOVEQ.L #0,D6
IN_CLSH MOVE.B #249,D5
CLSH_LOOP LEA CLSH_PKT(PC),A6
TRAP #06 $6 IOMGR6/SYSIO
DC.W $0006 FUNC
NOP
NOP
ADDQ #2,D5
CMP.B #251,D5
BEQ.S CLSH_LOOP
CMP.B #$FF,D6
BEQ.S CLSH_OVER
JSR $0FC2886
CLSH_OVER RTS
*
CCN_PKT DC.W 3,0
CLSH_PKT DC.W 40,0,0,0,0
*
*****************************************************************************
CCNSL0 MOVE.B #250,D5
LEA CCN_PKT(PC),A6
TRAP #06 $6 IOMGR6/SYSIO
DC.W $0006 FUNC
NOP
NOP
BRA UNHYPE
*
*****************************************************************************
SP_ DC.B 'Usage: SETPATH Dklmn... [where klmn... = '
DC.B 'STRING OF DRIVE NUMBERS]',$0D
SET_PATH TRAP #0 SYSCALL
DC.W 48 SUP MODE
MOVEA.L #$0ABCDEF,A0
TRAP #0 SYSCALL
DC.W 60 MODADRCK
MOVE.L #' ',D1
BSR.L INPUT_SUB
ORI.L #' ',D1
CMP.L #' ',D1
BNE.S SP_DOIT
LEA SP_(PC),A6
BRA.S W_P_P
SP_DOIT LEA.L DS_(PC),A6
MOVE.L D1,(A6)
MOVE.L D2,4(A6)
MOVE.L #0,10(A6)
MOVEQ #07,D1
SP_CHECK CMP.B #'/',0(A6,D1.L)
BLS.S SP_BAD
CMP.B #'9',0(A6,D1.L)
BLS.S SP_GOOD
SP_BAD MOVE.B #' ',0(A6,D1.L)
SP_GOOD DBRA D1,SP_CHECK
WHAT_PATH LEA.L DS__(PC),A6
W_P_P TRAP #0 SYSCALL
DC.W 18 PRTMSG
BRA.L UNHYPE
*
DRV_SERCH CMPI.W #0,D7
BEQ.S DRV__SRCH
CMPI.W #0130,D7
BEQ.S DRV__SRCH
CMPI.W #10,D7
BEQ.S DRV__SRCH
CMPI.W #$8600,D7
BEQ.S DRV__SRCH
CMPI.W #$0151,D7
BEQ.S DRV__SRCH
RTS
DRV__SRCH EQU *
BREAKEXIT -- EXIT IF CTRL BREAK
MOVE.L A5,-(A7)
LEA.L DS_(PC),A5
MOVEQ #0,D7
CMP.W #13,D3
BLS.S DS_LOOKUP
DS_ZAP MOVEQ #0,D3
MOVE.L D3,10(A5)
DS_LOOKUP MOVE.B 0(A5,D3.W),(A6)
ADDQ.W #1,D3
CMP.B #0,(A6)
BEQ.S DS_BAD
CMP.B #13,(A6)
BEQ.S DS_BAD
CMP.B #' ',(A6)
BEQ DS_LOOKUP
CMP.W #15,D3
BHI.S DS_BAD
BRA.S DS_COOL
DS_BAD MOVE.W #0130,D7
MOVE.B #' ',(A6)
DS_COOL MOVE.B #' ',1(A6)
MOVE.B #' ',2(A6)
MOVE.B #' ',3(A6)
MOVE.B #' ',4(A6)
MOVE.B #' ',5(A6)
CMP.W #0,D7
BNE.S DS_OUT
BSR.L SUB_CLOSE
MOVEQ.L #0,D7
DS_OUT MOVE.L (A7)+,A5
RTS
DS__ DC.B 'Drive search list '
DS.W 0
DS_ DC.B '84501962 '
DC.W $2020
DS_0 DC.W 0,0
DC.B $D,$D,$D,$D
*
*-------------------------------------------------------------------------
G_NAME MOVEM.L D0/A4-A6,-(A7)
MOVEQ #0,D0
TRAP #0
DC.W 27
MOVE.L #' ',D1
MOVE.L #' ',D2
CMPA.L #0,A5
BNE.S NM_OK
NM_RET MOVEM.L (A7)+,D0/A4-A6
RTS
NM_OK TRAP #0
DC.W 16
CMP.B #0,11(A5)
BEQ NM_RET
CMP.B #13,11(A5)
BEQ NM_RET
CMP.B #1,11(A5)
BNE NM_OK
LEA TEMPGUNK(PC),A4
MOVEA.L 4(A5),A6
MOVEQ.L #0,D0
MOVE.L D1,(A4)
MOVE.L D1,4(A4)
NM_LEN MOVE.B 0(A6,D0.W),0(A4,D0.W)
ADDQ.L #1,D0
CMPI.B #',',0(A6,D0.W)
BEQ.S NM_OUT
CMPI.B #13,0(A6,D0.W)
BEQ.S NM_OUT
CMPI.W #8,D0
BCS.S NM_LEN
NM_OUT MOVE.L (A4),D1
MOVE.L 4(A4),D2
BRA NM_RET
TEMPGUNK DCB.B 10,' '
DC.W $0404
*
*-------------------------------------------------------------------------
INPUT_SUB MOVEM.L D0/D3/D7/A2-A6,-(A7)
BSR.S INP___SUB
MOVEM.L (A7)+,D0/D3/D7/A2-A6
RTS
INP___SUB TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L 016(A5),A3
LEA 416(A3),A6
MOVEQ.L #0,D7
MOVEQ #073,D0
ISFC259A CLR.B (A6)+
DBF D0,ISFC259A
LEA 416(A3),A6
MOVE.B #$01,+00006(A6)
TRAP #00 $0 SYSCALL
DC.W $000F FmtDib*
CMPI.W #110,D7
BEQ.S TRY_NXT
CMPI.W #184,D7
BEQ.S TRY_NXT
CMPI.W #0,D7
BEQ.S DO_DEV
CMPI.W #1,D7
BEQ.S DO_VOL
LEA 38(A6),A2
MOVE.L (A2)+,D1
MOVE.L (A2),D2
I_S_STORE LEA ALIASE(PC),A2
MOVE.L D1,(A2)
MOVE.L D2,4(A2)
RTS
*
*-------------------------------------------------------------------------
TRY_NXT TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L 016(A5),A3
LEA 416(A3),A6
LEA 490(A3),A5
LEA 746(A3),A4
TRAP #00 $0 SYSCALL
DC.W $0010 NxTok*
MOVE.L #' ',D1
MOVE.L D1,D2
BRA.S I_S_STORE
*
*-------------------------------------------------------------------------
DO_VOL LEA.L ALIASE(PC),A2
MOVEQ #5,D0
DO_VOL_2 MOVE.B 0(A6,D0.W),0(A2,D0.W)
DBRA D0,DO_VOL_2
MOVE.L (A2),D1
MOVE.W 4(A2),D2
SWAP D2
MOVE.W #' ',D2
BRA I_S_STORE
*
*-------------------------------------------------------------------------
DO_DEV LEA.L ALIASE(PC),A2
MOVEQ #4,D0
DO_DEV_2 MOVE.B 1(A6,D0.W),0(A2,D0.W)
DBRA D0,DO_DEV_2
MOVE.B #' ',5(A2)
MOVE.L (A2),D1
MOVE.W 4(A2),D2
SWAP D2
MOVE.W #' ',D2
BRA I_S_STORE
*
*****************************************************************************
AL_US_MES DC.B 'Usage: ALIAS command,alias [where command '
DC.B 'is any resident command]',$D
DS.W 0
ALIAS_USAGE LEA AL_US_MES(PC),A6
BRA W_P_P
ALIAS MOVEA.L #$0ABCDEF,A0 | SUPERVISOR MODE
TRAP #5 |
MOVEA.L #$0ABCDEF,A0 | TURN OFF ADDRESS CHECKING
TRAP #0 |
DC.W 60 MODADRCK |
ALIAS_01 BSR.L G_NAME
CMP.L #' ',D1
BEQ.S ALIAS_USAGE
LEA ALIASE(PC),A0
MOVE.L D1,(A0)
MOVE D2,4(A0)
ALIAS_5OK LEA 0,A0
MOVEQ #2,D0 LOOKUP
TRAP #0 SYSCALL
DC.W 50 RES_CMD
CMP.W #0,D7
BEQ.S ALIAS_2OK
LEA ALIASE(PC),A6
TRAP #0
DC.W 18 PRTMSG
AL_GTO_ERR BRA.L PRT_ERR_
ALIAS_2OK LEA.L ALIASADR(PC),A1
MOVE.L A0,(A1)
BSR.L G_NAME
CMPI.L #' ',D1
BNE.S ALIAS_6OK
MOVE.W #$0101,D7
BRA.S AL_GTO_ERR
ALIAS_6OK MOVEQ #0,D0 ADD_CMD
MOVEA.L ALIASADR(PC),A0
TRAP #0 SYSCALL
DC.W 50 RES_CMD
CMP.W #0,D7
BNE.L PRT_ERR_
* BRA.L UNHYPE
ALIAS_AG BSR.L G_NAME
CMPI.L #' ',D1
BNE.S ALIAS_7OK
BRA.L UNHYPE
ALIAS_7OK MOVEQ #0,D0 ADD_CMD
MOVEA.L ALIASADR(PC),A0
TRAP #0 SYSCALL
DC.W 50 RES_CMD
CMP.W #0,D7
BNE.L UNHYPE
BRA ALIAS_AG
ALIASE DCB.B 10,' '
GUNK DCB.B 10,' '
DC.B $D,$D
ALIASADR DC.L 0
*
*
SET_CRT MOVEA.L #$0ABCDEF,A0
TRAP #5
LEA.L CRT_CR(PC),A0
MOVE.B D0,(A0)
BRA UNHYPE
*
*****************************************************************************
INVERSE TRAP #0 SYSCALL
DC.W 55 INQCRTCR
ORI.B #$C,D0
TRAP #0 SYSCALL
DC.W 54 SETCRTCR
BRA SET_CRT
*
*****************************************************************************
NORMAL TRAP #0 SYSCALL
DC.W 55 INQCRTCR
ANDI.B #$FB,D0
ORI.B #8,D0
TRAP #0 SYSCALL
DC.W 54 SETCRTCR
BRA SET_CRT
*
*****************************************************************************
REVERSE TRAP #0 SYSCALL
DC.W 55 INQCRTCR
EORI.B #4,D0
ORI.B #8,D0
TRAP #0 SYSCALL
DC.W 54 INQCRTCR
BRA SET_CRT
*
*****************************************************************************
UNBLANK TRAP #0 SYSCALL
DC.W 55 INQCRTCR
ORI.B #8,D0
TRAP #0 SYSCALL
DC.W 54 INQCRTCR
BRA SET_CRT
*
*****************************************************************************
BLANK TRAP #0 SYSCALL
DC.W 55 INQCRTCR
ANDI.B #$F7,D0
TRAP #0 SYSCALL
DC.W 54 INQCRTCR
MOVE.W D0,D6
BSR GET_NUM
EXG D0,D6
CMP.W #0,D6
BNE SET_CRT
BRA.L INIT_DONE
*
*****************************************************************************
ATCHDRVB EQU *
MOVEA.L #$0ABCDEF,A0
TRAP #5 SUPMODE
LEA H_00EC5C(PC),A5
MOVE.B #$FF,(A5) "MAGIC" BYTE
TRAP #0 SYSCALL
DC.W 52 GBASPTR
MOVEA.L +00016(A5),A5
MOVE.B #$FF,1298(A5) ANOTHER "MAGIC" BYTE
JSR $0FC2988
BRA UNHYPE
*
CLOS_SUB MOVEA.L #0,A6
SUB_CLOSE MOVE.L A2,-(A7)
MOVE.L A6,-(A7)
MOVEA.L #0,A6
TRAP #6 SYSIO
DC.W 2 CLOSE
NOP
NOP
MOVEA.L (A7)+,A6
CMP.W #$8300,D7
BNE.S CLO_RET
MOVE.W #0,D7
CLO_RET MOVEA.L (A7)+,A2
RTS
*
SUB_OPEN MOVEM.L D0-D6/A0-A6,-(A7)
MOVEQ #0,D0
SUB_O MOVE.W #0,D7
TRAP #6 SYSIO
DC.W 1 OPEN
NOP
NOP
ADDQ.W #1,D0
CMPI.W #$8500,D7
BEQ.S CLO_OPEN
CMP.W #$8100,D7
BEQ.S CLO_OPEN
CMP.W #18,D7
BEQ.S CLO_OPEN
S_O_RET MOVEM.L (A7)+,D0-D6/A0-A6
RTS
CLO_OPEN BSR SUB_CLOSE
TST.W D7
BNE.S S_O_RET
CMP.W #3,D0
BLS SUB_O
BRA S_O_RET
*
*****************************************************************************
WBOOT TRAP #0 SYSCALL
DC.W 48 SUP MODE
JMP $0FC00A4
TOO_MANY DC.B 'TOO MANY CRASHES!',$D
DS.W 0
ALT_TRAP EQU * this prints out trap error message, but then
C_TOL_1 EQU *+2 instead of re-booting it does EXIT syscall
CMPI.B #5,$0EB2 (OR calls DEBUG if it is resident)
BCS.S A_T_FIRST
BRA COLDBOOT IF PAST TOLERANCE & CRASHED - COLDBOOT
A_T_FIRST EQU *
ADD.B #2,$0EB2
MOVE.L (A7)+,A0
CMPA.L #$FC096A,A0
BNE.S REG
MOVE.L (A7)+,A0
MOVEM.L D0-D7/A0-A7,-(A7)
SUBA.L #$0000000E,A7
MOVEA.L A7,A0
JSR $0FC0A66
SUBA.L #$00000050,A7
MOVEA.L A7,A6
MOVE.W +00082(A0),D0
MOVE.L #'FNC=',(A6)+
JSR $0FC0ABE
MOVE.W #' ',(A6)+
MOVE.L +00084(A0),D0
MOVE.L #'ADD=',(A6)+
JSR $0FC0AB0
MOVE.W #' ',(A6)+
MOVE.W +00088(A0),D0
MOVE.L #'INR=',(A6)+
JSR $0FC0ABE
MOVE.B #$0D,(A6)
JSR $0FC0A90
MOVEA.L A7,A6
TRAP #00 SYSCALL
DC.W $0012 PrtMsg*
BRA.S REG_CONT
REG MOVE.L (A7)+,A0
MOVEM.L D0-D7/A0-A7,-(A7)
SUBA.L #$0000000E,A7
MOVEA.L A7,A0
JSR $0FC0A66
SUBA.L #$00000050,A7
REG_CONT MOVEA.L A7,A6
CLR.L D0
TRAP #00 $0 SYSCALL
DC.W $001B GStat
MOVE.L $0FC0B60,(A6)+
MOVE.W $0FC0B64,(A6)+
MOVE.L D1,(A6)+
MOVE.L D2,(A6)+
MOVE.W $0FC0B66,(A6)+
CLR.L D0
MOVE.B D5,D0
JSR $0FC0AC6
MOVE.W #' ',(A6)+
MOVE.L +00078(A0),(A6)+
MOVEA.L #$0FC0B54,A5
** dbw MOVE.L (A5)+,(A6)+
DCB.W 00003,+11485
JSR $0FC0A90
MOVEA.L A7,A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
JSR $0FC0AE2
C_TOL_2 EQU *+2
CMPI.B #5,$0EB2 IF TOO MANY TRAPS - DISPLAY, THEN WARM BOOT
BCS.S A_T_RCVR NOT YET EXCEEDED TOLERANCE, TRY RECOVERY
LEA TOO_MANY(PC),A6
TRAP #00 SYSCALL
DC.W $0012 PrtMsg*
MOVEA.L #$0FC06A4,A6
TRAP #00 SYSCALL
DC.W $0013 PrtErMsg*
JMP $0FC007C
A_T_RCVR LEA.L A_T_RECOVER(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0012 PrtMsg*
MOVEQ #0,D0 try killing current task
TRAP #0 if we are SYSTEM task it will fail
DC.W 26 else it exits
MOVE.L #'DEBU',D1
MOVE.L #'G ',D2
MOVEQ.L #2,D0 LOOKUP
TRAP #0 SYSCALL
DC.W 50 RES CMD
CMPI.W #0,D7
BNE.S A_T_EXIT
CMPA.L #0,A0
BEQ.S A_T_EXIT
ANDI #0,SR - USER MODE, TRAPS ENABLED
MOVEA.L USP_SV_ADDR(PC),A7
JSR (A0)
TRAP #0
DC.W 48 SUP MODE
MOVEA.L SSP_SV_ADDR(PC),A7
PEA INIT_DONE(PC)
A_T_EXIT BRA TELL_TOL
A_T_RECOVER DC.B 'TRAP ERROR INTERCEPTED, CRASH AVERTED',$D
*
C_TOL_M DC.B 'REBOOT ON CRASH NUMBER $'
C_TOL_NUM DC.B ' '
DC.B ' CURRENT LEVEL IS '
C_LEV_NUM DC.B ' ',$D,$D
DS.W 0
*
*****************************************************************************
CRASH_TOL TRAP #0
DC.W 48 SUP MODE
BSR GET_NUM
CMP.B #13,D1
BEQ.S TELL_TOL
CMP.L #0,D0
BNE.S SET_TOL
TELL_TOL MOVEQ #0,D0
MOVE.W C_TOL_2(PC),D0
SUBQ.B #1,D0
LEA C_TOL_NUM(PC),A5
JSR $0FC61B0
MOVEQ #0,D0
MOVE.B $0EB2,D0
CMP.B #0,D0
BEQ C_T_T0
SUBQ.B #1,D0
C_T_T0 LEA C_LEV_NUM(PC),A5
JSR $0FC61B0
LEA C_TOL_M(PC),A6
BRA W_P_P
SET_TOL CMP.L #15,D0
BCS.S C_T_N_HI
MOVEQ #15,D0
C_T_N_HI ADDQ.W #1,D0
C_T_N_0 LEA C_TOL_1(PC),A5
MOVE.W D0,(A5)
LEA C_TOL_2(PC),A5
MOVE.W D0,(A5)
BRA TELL_TOL
*
*------------------------------------------------------------------------
KBD_LCB MOVEM.L D0-D7/A0-A6,-(A7)
MOVE SR,D2
TRAP #00 $0 SYSCALL
DC.W $0030 SUP MODE
LEA LCB_A6(PC),A3
MOVE.L A1,4(A3)
MOVE.L D0,12(A3)
MOVE.L D1,16(A3)
LEA USR_SV_ADR(PC),A4
MOVEA.L (A4),A5
LEA H_00EBAE(PC),A4
MOVE.L A4,(A3)
MOVE.L A4,8(A3)
MOVE.W #0173,D7
LCB_E61A MOVE.B #$00,+000(A4,D7.W)
DBRA D7,LCB_E61A
CMPA.L A1,A5 is it built-in command?
BCS.S LCB_BYE YES - return
MOVE.L D0,$1E(A4) not built-in; was made resident by MAKERES
MOVE.L D1,$22(A4) let's do up the LCB
MOVE.L D0,6(A4)
MOVE.L D1,10(A4)
MOVE.L #'USRM',22(A4)
LEA H_00EC5C(PC),A6
CLR.B (A6)
MOVEA.L A4,A6
MOVEQ #2,D4 INQLOAD can we fill in LCB?
TRAP #0 SYSCALL
DC.W 64 LOD_MGR
BRA.L NOT_MOD CAN'T FILL LCB!! -- ?? ERROR, PROCEED W/CAUTION
LEA LCB_A6(PC),A3
MOVE.L A6,(A3)
MOVE.W D2,-(A7)
BSR.S LCB_MV_CMD copy command line into msg buffer
MOVE.W (A7)+,D2
LEA B_UL(PC),A3
MOVE.B #4,(A3)
LCB_BYE MOVE D2,SR
MOVEM.L (A7)+,D0-D7/A0-A6
LEA LCB_A6(PC),A6
MOVEA.L 4(A6),A2 A2 = epa
MOVEA.L 8(A6),A4 A4 -> LCB
MOVE.L 12(A6),D0 D0/D1 = module name padded w/ blanks
MOVE.L 16(A6),D1
MOVEA.L (A6),A6 A6 -> LCB
RTS
LCB_A6 DC.L 0,0,0,0,0
NOT_MOD MOVEQ #0,D7
LEA H_00EBAE(PC),A4
MOVE.L A1,$28(A4)
CLR.B 88(A4)
BRA LCB_BYE
LCB_MV_CMD MOVEA.L A1,A2
TRAP #00 $0 SYSCALL
DC.W $0034 GBasPtr
MOVEA.L +00016(A5),A0
MOVE.L A1,412(A0)
LEA +01108(A0),A1
MOVE.L +00400(A0),D0
SUB.L A1,D0
MOVE.L D0,D3
LCB_FE0E MOVE.W D0,+00172(A4)
LEA +00092(A4),A5
MOVE.W #79,D0
LCB_FE22 MOVE.B +000(A1,D0.W),+000(A5,D0.W)
DBRA D0,LCB_FE22
MOVEA.L A4,A6
MOVE.B #0,$14(A6)
MOVEQ #3,D4 MODIFY
TRAP #0 SYSCALL
DC.W 64 LOD_MGR
NOP
NOP
LCB_FE64 RTS
NONONO MOVEA.L #$0ABCDEF,A0
TRAP #5
LEA.L H_00EC5C(PC),A5
MOVE.B #0,(A5)
BSR MAYBEGM
TRAP #0 SYSCALL
DC.W 52 GBASPTR
LEA 16(A5),A5
MOVE.B #0,1298(A5)
LEA.L H_00EBAE(PC),A5
MOVE.W #173,D0
NO_LOOP MOVE.B #0,0(A5,D0.W)
DBRA D0,NO_LOOP
BRA INIT_DONE
CMAGIC2 MOVEM.L D0-D7/A0-A6,-(A7)
LEA.L H_00EC5C(PC),A5
MOVE.B (A5),D7
TRAP #0 SYSCALL
DC.W 52 GBASPTR
LEA 16(A5),A5
OR.B 1298(A5),D7
BRA.S IMAGIC2
SMAGIC2 MOVEM.L D0-D7/A0-A6,-(A7)
MOVE.B #255,D7
BRA.S IMAGIC2
RMAGIC2 MOVEM.L D0-D7/A0-A6,-(A7)
MOVE.B #0,D7
IMAGIC2 MOVE SR,D0
MOVEA.L #$0ABCDEF,A0
TRAP #5
TRAP #0 SYSCALL
DC.W 52 GBASPTR
LEA 16(A5),A0
MOVE.B D7,1298(A0)
XMAGIC MOVE D0,SR
MOVEM.L (A7)+,D0-D7/A0-A6
RTS
SMAGIC1 MOVEM.L D0-D7/A0-A6,-(A7)
MOVE.B #255,D7
BRA.S IMAGIC2
RMAGIC1 MOVEM.L D0-D7/A0-A6,-(A7)
MOVE.B #0,D7
IMAGIC1 MOVE SR,D0
MOVEA.L #$0ABCDEF,A0
TRAP #5
LEA.L H_00EC5C(PC),A0
MOVE.B D7,(A0)
BRA XMAGIC
***************************************************************************
NO MOVE.L #'SCRN',D1
MOVE.L #'PRNT',D2
TRAP #0 SYSCALL
DC.W 45 KILL
BRA.L RESET_PR
*
****************************************************************************
SCHDRA_X MOVEA.L #$0FC41C6,A6
TRAP #0 SYSCALL
DC.W $12 PrtMsg
PT_MESS LEA P_T_(PC),A6
TRAP #0 SYSCALL
DC.W $12 PrtMsg
BRA INIT_DONE
P_T_ DC.B 'Program terminated.',$D
*
*****************************************************************************
HEXOF MOVEQ.L #0,D2
HEX_LOOP BSR GET_NUM
CMPI.B #13,D1
BEQ.S HEX_RET
ADD.L D0,D2
SUBA.L #12,A7
MOVE.L A7,A5
MOVE.B #'$',(A5)+
JSR $0FC61B0
MOVE.B #13,(A5)
MOVE.L A7,A6
TRAP #0
DC.W 18 PRTMSG
ADDA.L #12,A7
BRA HEX_LOOP
HEX_RET SUBA.L #16,A7
MOVE.L D2,D0
MOVE.L A7,A5
MOVE.L #'SUM=',(A5)+
MOVE.B #'$',(A5)+
JSR $0FC61B0
MOVE.B #13,(A5)
MOVE.L A7,A6
TRAP #0
DC.W 18 PRTMSG
ADDA.L #16,A7
RTS
*
*****************************************************************************
M_C_MESS DC.B 'Usage: MAKECMD name,address [enters name as '
DC.B 'command executing at address',$D
DS.W 0
M_C_USAGE LEA M_C_MESS(PC),A6
BRA W_P_P
MAKECMD MOVEA.L #$0ABCDEF,A0
TRAP #5
BSR G_NAME
CMPI.L #' ',D1
BEQ M_C_USAGE
MOVEM.L D1-D2,-(A7)
BSR GET_NUM
CMPI.B #13,D1
BEQ.S M_C_RET
MOVEA.L D0,A0
MOVEM.L (A7)+,D1-D2
* SUBA.L #40,A7
MOVEQ #1,D0
CMPA.L #0,A0
BEQ.S M_C_SC50
MOVEQ #0,D0
M_C_SC50 TRAP #0
DC.W 50
* ADDA.L #40,A7
M_C_RET BRA UNHYPE
*
*****************************************************************************
P_B_UNDO MOVEA.L PRTSC_VEC(PC),A0
MOVEA.L A0,A1
TRAP #0
DC.W 62
CMPA.L A0,A1
BNE UNHYPE
P_B_USAGE LEA P_B_MESS(PC),A6
BRA W_P_P
P_B_MESS DC.B 'Usage: PB (name) [IF name absent/not '
DC.B 'found, restores PrtSc; else PrtSc = name]',$D
DS.W 0
P_B_ MOVEA.L #$0ABCDEF,A0
TRAP #5
BSR G_NAME
CMPI.L #' ',D1
BEQ P_B_UNDO
LEA.L P_B_NAME(PC),A2
MOVE.L D1,(A2)+
MOVE.L D2,(A2)
MOVEQ #2,D0
TRAP #0
DC.W 50
CMP.W #0,D7
BNE P_B_UNDO
CMP.L #0,A0
BEQ P_B_UNDO
LEA.L KBD_CMD_INT(PC),A1
CMPA.L A1,A0
BEQ P_B_UNDO
LEA.L P_B_ADDR(PC),A1
MOVE.L A0,(A1)
LEA.L P_B_DOIT(PC),A0
TRAP #0 SYSCALL
DC.W 62 CHPRTSC change PRinT SCreen vector
BRA UNHYPE
P_B_ADDR DC.L 0
P_B_NAME DC.L 0,0
P_B_DOIT EQU *
MOVEM.L D0-D2/A6,-(A7)
MOVE.L #'SK ',D2
P_B_AG MOVE.L #'PBTA',D1
MOVE.W #$FF65,D0
LEA.L P_B_TASK(PC),A6
TRAP #0 SYSCALL
DC.W 25 GETPCB
CMP.B #0,D0
BNE.S P_B_NOGO
P_B_X MOVE.B D1,D0 FORCE NEW TASK READY
LEA.L P_B_PCBNO(PC),A6
MOVE.W D1,(A6)
TRAP #0 SYSCALL
DC.W 30 WAKEUP
MOVEM.L (A7)+,D0-D2/A6
RTS
P_B_NOGO CMP.B #$FF,D0
BNE P_B_AG
ADD.L #$0100,D2
CMP.L #'SZ ',D2
BCS P_B_AG
BRA P_B_X
P_B_PCBNO DC.W 0
*
P_B_TASK MOVE.L #246,D5
SUBA.L #0,A7
MOVEA.L A7,A6
MOVE.L #'#CON',(A6)
MOVE.W #' ',4(A6)
MOVE.W #$0101,6(A6)
MOVE.L #0,8(A6)
MOVE.L #0,12(A6)
MOVE.W #0,16(A6)
MOVE.L #0,18(A6)
MOVE.L #0,22(A6)
BSR SUB_OPEN
LEA.L CLSH_PKT(PC),A0
MOVE.L A0,18(A6)
MOVE.L #'#SCR',(A6)
MOVE.W #'N0',4(A6)
MOVE.W #$0001,6(A6)
MOVE.B #249,D5
BSR SUB_OPEN
LEA.L CLSH_PKT(PC),A0
MOVE.L A0,18(A6)
MOVE.L #'#CNS',(A6)
MOVE.W #'L0',4(A6)
MOVE.W #$0001,6(A6)
MOVE.B #250,D5
BSR SUB_OPEN
ADDA.L #30,A7
JSR $0FC2886 cls
MOVEA.L P_B_ADDR(PC),A6
LEA.L P_B_NAME(PC),A0
MOVE.L (A0)+,D0
MOVE.L (A0),D1
JSR (A6)
TRAP #0
DC.W 43
*
*****************************************************************************
FUNC BSR GET_NUM
ANDI.L #$0FF,D0
MOVE.L D0,D5
SUBA.L #512,A7
MOVEA.L A7,A6
FUNC_LOOP BSR GET_NUM
CMP.B #13,D1
BEQ.S FUNC_DOIT
MOVE.W D0,(A6)+
BRA FUNC_LOOP
FUNC_DOIT MOVE.W #0,(A6)+
MOVE.W #0,(A6)+
MOVEA.L A7,A6
TRAP #6
DC.W 6
BRA.L KBD_ERR_
ADDA.L #512,A7
RTS
*
*****************************************************************************
SM_VAL DC.L 0
SETSM TRAP #0 SYSCALL
DC.W 48 SUPMODE
BSR GET_NUM
LEA.L SM_VAL(PC),A0
MOVE.L D0,(A0)
BRA.S HBOOTS
*
*****************************************************************************
LIST
HBOOT TRAP #0 SYSCALL
DC.W 48 SUPMODE
LEA.L SM_VAL(PC),A0
MOVE.L #0,(A0)
HBOOTS MOVEQ #3,D1
* MOVEA.L #$0ABCDEF,A0 | TURN OFF ADDRESS CHECKING
* TRAP #0 |
* DC.W 60 MODADRCK |
HB_KILL MOVE.L D1,D0
TRAP #0 SYSCALL
DC.W 26 GIVPCB
ADDQ.W #1,D1
CMPI.W #16,D1
BCS HB_KILL
MOVEA.L PRTSC_VEC(PC),A0 | RESET PrtSc VECTOR
TRAP #0 SYSCALL |
DC.W 62 CHPRTSCR |
LEA.L CRTFPKT(PC),A6
MOVE.B #249,D5
TRAP #6
DC.W 6
NOP
NOP
JSR $0FC2886 cls
MOVE.L A7,-(A7)
SUBA.L #174,A7
MOVEA.L A7,A6
MOVE.L #87,D0
HBOOT_1 MOVE.W #0,(A6)+
DBRA D0,HBOOT_1
MOVEA.L A7,A6
HB_UL_L MOVE.B #1,20(A6) |
MOVE.L #2,D4 | UNLOAD ALL LOADED MODULES
TRAP #0 SYSCALL |
DC.W 64 LodMgr |
BRA.L HBOOT_OUT |
MOVE.W 38(A6),-(A7) |
MOVE.L #1,D4 |
TRAP #0 SYSCALL |
DC.W 64 LodMgr |
NOP
NOP
MOVE.W (A7)+,38(A6)
BRA HB_UL_L
HBOOT_OUT MOVEA.L USRM_PTR(PC),A0 |DIDDLE MEMORY CONTROL BLOCKS
MOVEA.L 12(A0),A1 | USRM block must be removed
MOVE.L #0,12(A0) | Re-Initialization will restore it
MOVE.L #'USRM',D5 | AFTER USRM destroyed, SYSM is
MOVE.L #2,D4 | hacked back to pre-CSOS 2 condition
MOVEM.L A0-A1,-(A7) |
TRAP #0 SYSCALL |
DC.W 57 MemMgr |
NOP |
NOP |
LEA.L SR_SAVE(PC),A0 |
MOVE.W #0,(A0) |
MOVEA.L SYSM_PTR(PC),A0 3D40 => A0
MOVEA.L 12(A0),A0 3C08 => A0
MOVEA.L (A0),A0 Beg Addr of SYSM => A0
CMPI.B #0,(A0) |
BEQ.S SYSM_OK |
MOVE.W #0,(A0) |
SYSM_OK MOVEM.L (A7)+,A0-A1 |
MOVE.L #0,(A0) |
MOVE.L A1,A0 |
MOVEQ.L #3,D0 |
HB_L2 MOVE.L #0,(A1)+ |
DBRA D0,HB_L2 |
MOVEA.L #$03BF0,A1 |
ADDQ.L #1,(A1) |
MOVE.L 4(A1),8(A0) |
MOVE.L A0,4(A1) |
MOVE.L #$0DC00,$0A08 |
MOVEA.L SYSM_PTR(PC),A0 |
MOVEA.L 12(A0),A0 |
MOVE.L (A0),D0 |
MOVE.L #0,A0 |
SUBQ.L #2,D0 |
CMP.L $0A0C,D0 |
BCS.S DON_T1 |
MOVE.L D0,$0A0C |
*
LEA.L INIT_DIE(PC),A0 | since memory control blocks hacked, there
MOVE.W #$4E71,(A0) | may be errors - IGNORE THEM FOR HBOOT
MOVE.W #$4E71,2(A0) | turn Bcc.L into two NOPs
DON_T1 MOVE.L SM_VAL(PC),D0 |HBOOT and new MODSYSM share code
CMP.L #0,D0 |if HBOOT only skip MODSYSM
BEQ.S DON_T |
TRAP #0 |
DC.W 7 OLD MODSYSM |
*
*
LEA $43B0,A0 Clear CTRL-Break and CTRL-NumLock ...
MOVE.W #0,(A0)
DON_T BRA.L BEG_RES_CODE(PC) when all done re-initialize CSOS v2
NOLIST
*
*****************************************************************************
SUP_MODE TRAP #0 SYSCALL
DC.W 48 SUPMODE
LEA.L SR_SAVE(PC),A0
MOVE.W #$2000,(A0)
BRA.L KBD_CMD_INT(PC)
*
* JMP $0FC3F24
USR_MODE TRAP #0 SYSCALL
DC.W 48 SUPMODE
LEA.L SR_SAVE(PC),A0
MOVE.W #0,(A0)
BRA.L KBD_CMD_INT(PC)
* JMP $0FC3F2E
*
T3LLMESS DC.B ' ',$D,$D
TELLMESS DC.B ' '
DC.W $2020,$0D0D
*
*****************************************************************************
TELL_SR MOVEQ #0,D0
MOVE SR,D0
MOVE.L #'SR ',D1
MOVE.L #'is $',D2
IN_TELL TRAP #0
DC.W 48
LEA.L TELLMESS(PC),A5
MOVEA.L A5,A6
MOVE.L D1,(A5)+
MOVE.L D2,(A5)+
JSR $0FC61B0
BRA W_P_P
*
*****************************************************************************
TELL_USP MOVE.L USR_SV_ADDR(PC),D0
MOVE.L #'USP ',D1
MOVE.L #'is $',D2
BRA IN_TELL
*
****************************************************************************
TELL_SSP MOVE.L SSR_SV_ADDR(PC),D0
MOVE.L #'SSP ',D1
MOVE.L #'is $',D2
BRA IN_TELL
*
****************************************************************************
TELL_SYSM MOVE.L SYSM_PTR(PC),D0
LEA.L T3LLMESS(PC),A5
MOVEA.L A5,A6
TRAP #0
DC.W 48
MOVE.L #'SYSM',(A5)+
MOVE.W #' ',(A5)+
MOVE.L #'MPD ',(A5)+
MOVEA.L D0,A0
JSR $0FC61B0
MOVE.L 12(A0),D0
LEA.L TELLMESS(PC),A5
MOVE.L #' ',(A5)+
MOVE.L #'MSP ',(A5)+
JSR $0FC61B0
BRA W_P_P
*
****************************************************************************
TELL_USRM MOVE.L USRM_PTR(PC),D0
LEA.L T3LLMESS(PC),A5
MOVEA.L A5,A6
TRAP #0
DC.W 48
MOVE.L #'USRM',(A5)+
MOVE.W #' ',(A5)+
MOVE.L #'MPD ',(A5)+
MOVEA.L D0,A0
JSR $0FC61B0
MOVE.L 12(A0),D0
LEA.L TELLMESS(PC),A5
MOVE.L #' ',(A5)+
MOVE.L #'MSP ',(A5)+
JSR $0FC61B0
BRA W_P_P
*
****************************************************************************
TELL_SPS TRAP #0
DC.W 48
LEA.L T3LLMESS(PC),A5
MOVEA.L A5,A6
MOVE.L #'USP ',(A5)+
MOVE.L #'is $',(A5)+
MOVE.L USR_SV_ADDR(PC),D0
JSR $0FC61B0
* LEA.L TELLMESS(PC),A5
* MOVE.W #' ',-2(A5)
MOVE.W #' ',(A5)+
MOVE.L #'SSP ',(A5)+
MOVE.L #'is $',(A5)+
MOVE.L SSR_SV_ADDR(PC),D0
JSR $0FC61B0
MOVE.W #$0D0D,(A5)+
BRA W_P_P
*
*-------------------------------------------------------------------------
OPEN_ EQU * DevName IN D0.L, D1 (high)
SUBA.L #30,A7 DTD IN D1 MIDLO, TRN IN D1 LO
MOVEA.L A7,A6 UNIT IN D5.B
SUBA.L #4,A7 D2 = -1 for byte I/O
MOVE.L D0,(A6)
MOVE.L D1,4(A6)
MOVE.L #0,8(A6)
MOVE.L #0,12(A6)
MOVE.W #0,16(A6)
MOVE.L #0,18(A6)
MOVE.L D2,22(A6)
TRAP #6
DC.W 1
NOP
NOP
MOVE.L 22(A6),D2
ADDA.L #34,A7
RTS
*-------------------------------------------------------------------------
FUNC_ EQU * D5.B = UNIT, A6.L = FUNCLIST
TRAP #6
DC.W 6
NOP
NOP
RTS
*-------------------------------------------------------------------------
BWRITE_ EQU * D0.B = BYTE, A6.L = ByteIOPTR
MOVEM.L D1,-(A7)
MOVEQ #0,D1
BW_LOOP TRAP #6
DC.W 9
BRA.L BW_ERROR
BW_RET MOVEM.L (A7)+,D1
RTS
BW_ERROR CMP.W #$8A00,D7
BNE BW_RET
ADDQ.W #1,D1
CMP #100,D1
BCS BW_LOOP
BRA BW_RET
*-------------------------------------------------------------------------
OPEN_PR EQU *
MOVE.L #'#PR ',D0
MOVE.W #' ',D1
SWAP D1
MOVE.W #0,D1
MOVE.L #0241,D5
MOVE.L #-1,D2
BSR OPEN_
CMP.W #0,D7
BNE.S PR_BYE
RTS
PR_MESS EQU *
MOVE.L A6,-(A7)
LEA.L PR_WARN(PC),A6
TRAP #0 SYSCALL
DC.W 18 PRTMSG
MOVE.L (A7)+,A6
RTS
PR_WARN DC.B 'Printer MUST be ON',$D
DS.W 0
*-------------------------------------------------------------------------
CLOSE_PR MOVE.L #0241,D5
PR_BYE BSR SUB_CLOS
TRAP #0
DC.W 43
*-------------------------------------------------------------------------
RESET_PR BSR OPEN_PR
SUBA.L #10,A7
MOVEA.L A7,A6
SUBA.L #4,A7
MOVE.W #30,(A6)
MOVE.L #0,2(A6)
BSR FUNC_
ADDA.L #14,A7
BRA CLOSE_PR
*
*****************************************************************************
LNFD BSR OPEN_PR
BSR GET_NUM
SUBQ.W #1,D0
BPL.S LNFD_OK
MOVEQ #0,D0
LNFD_OK SUBA.L #10,A7
MOVEA.L A7,A6
SUBA.L #4,A7
MOVE.W #26,(A6)
MOVE.L #0,2(A6)
BSR PR_MESS
LNFD_L BSR FUNC_
DBRA D0,LNFD_L
ADDA.L #14,A7
BRA CLOSE_PR
*
*****************************************************************************
RLNFD BSR OPEN_PR
BSR GET_NUM
ADD.W D0,D0
BPL.S RLNFD_OK
MOVEQ #0,D0
RLNFD_OK SUBA.L #10,A7
MOVEA.L A7,A6
SUBA.L #4,A7
BSR PR_MESS
MOVE.W #24,(A6)
MOVE.L #$2FFE4,2(A6)
MOVE.L #0,6(A6)
BSR FUNC_
MOVE.W #26,(A6)
MOVE.L #$20000,2(A6)
RLNFD_L BSR FUNC_
DBRA D0,RLNFD_L
ADDA.L #14,A7
BRA CLOSE_PR
*
*****************************************************************************
FMFD BSR OPEN_PR
MOVEA.L D2,A6
MOVEQ #12,D0
BSR PR_MESS
BSR BWRITE_
BRA CLOSE_PR
*
*****************************************************************************
KOLOR DC.W 0
KOLOR_MESS DC.B 'Usage: COLOR n [PrtSc color; 0=Red 1=Green 2=Blue 3=Black '
KOLOR_USAGE LEA.L KOLOR_MESS(PC),A6
BRA W_P_P
DO_KOLOR BSR GET_NUM
CMP.B #13,D1
BEQ.S KOLOR_USAGE
TRAP #0 SYSCALL
DC.W 48 SUPMODE
BSR.S KOLOR_SET
BRA UNHYPE
*
KOLOR_SET EQU *
ANDI.W #$0F,D0
LEA.L KOLOR(PC),A6
MOVE.W D0,(A6)
RTS
*
****************************************************************************
RED BSR OPEN_PR
SUBA.L #10,A7
MOVEA.L A7,A6
SUBA.L #4,A7
MOVE.W #6,(A6)
MOVE.L #0,2(A6)
BSR PR_MESS
BSR FUNC_
BSR FUNC_
ADDA.L #14,A7
TRAP #0
DC.W 48
LEA.L KOLOR(PC),A6
MOVE.W #0,(A6)
BRA CLOSE_PR
*
****************************************************************************
GREEN BSR OPEN_PR
SUBA.L #10,A7
MOVEA.L A7,A6
SUBA.L #4,A7
MOVE.W #6,(A6)
MOVE.L #$10000,2(A6)
BSR PR_MESS
BSR FUNC_
BSR FUNC_
ADDA.L #14,A7
TRAP #0
DC.W 48
LEA.L KOLOR(PC),A6
MOVE.W #1,(A6)
BRA CLOSE_PR
*
****************************************************************************
BLUE BSR OPEN_PR
SUBA.L #10,A7
MOVEA.L A7,A6
SUBA.L #4,A7
MOVE.W #6,(A6)
MOVE.L #$20000,2(A6)
BSR PR_MESS
BSR FUNC_
BSR FUNC_
ADDA.L #14,A7
TRAP #0
DC.W 48
LEA.L KOLOR(PC),A6
MOVE.W #2,(A6)
BRA CLOSE_PR
*
****************************************************************************
BLACK BSR OPEN_PR
SUBA.L #10,A7
MOVEA.L A7,A6
SUBA.L #4,A7
MOVE.W #6,(A6)
MOVE.L #$30000,2(A6)
BSR PR_MESS
BSR FUNC_
BSR FUNC_
ADDA.L #14,A7
TRAP #0
DC.W 48
LEA.L KOLOR(PC),A6
MOVE.W #3,(A6)
BRA CLOSE_PR
*
****************************************************************************
ANYCOLOR BSR OPEN_PR
SUBA.L #10,A7
MOVEA.L A7,A6
SUBA.L #4,A7
MOVE.W #6,(A6)
MOVE.L #$30000,2(A6)
BSR PR_MESS
BSR FUNC_
BSR FUNC_
ADDA.L #14,A7
TRAP #0
DC.W 48
LEA.L KOLOR(PC),A6
MOVE.W #8,(A6)
BRA CLOSE_PR
*
****************************************************************************
LFON BSR OPEN_PR
SUBA.L #10,A7
MOVEA.L A7,A6
SUBA.L #4,A7
MOVE.W #31,(A6)
MOVE.L #$10000,2(A6)
BSR PR_MESS
BSR FUNC_
BSR FUNC_
ADDA.L #14,A7
BRA CLOSE_PR
*
****************************************************************************
LFOFF BSR OPEN_PR
SUBA.L #10,A7
MOVEA.L A7,A6
SUBA.L #4,A7
MOVE.W #31,(A6)
MOVE.L #0,2(A6)
BSR FUNC_
BSR FUNC_
ADDA.L #14,A7
BRA CLOSE_PR
*
****************************************************************************
FFON BSR OPEN_PR
SUBA.L #10,A7
MOVEA.L A7,A6
SUBA.L #4,A7
MOVE.W #33,(A6)
MOVE.L #$10000,2(A6)
BSR FUNC_
BSR FUNC_
ADDA.L #14,A7
BRA CLOSE_PR
*
****************************************************************************
FFOFF BSR OPEN_PR
SUBA.L #10,A7
MOVEA.L A7,A6
SUBA.L #4,A7
MOVE.W #33,(A6)
MOVE.L #0,2(A6)
BSR FUNC_
BSR FUNC_
ADDA.L #14,A7
BRA CLOSE_PR
*
*
****************************************************************************
NEWPRTSC EQU *
ALTPRTSC EQU *
PRTSCBAC MOVEM.L D0-D2/A6,-(A7)
PRTSCBB0 MOVE.L #'SCRN',D1
MOVE.L #'PRNT',D2
MOVE.W #$FF64,D0
LEA PRTSCBD4(PC),A6
TRAP #00 $0 SYSCALL
DC.W $0019 GetPCB
CMP.W #01,D0
BEQ.S PRTSCBB0
MOVEM.L (A7)+,D0-D2/A6
RTS
* The code above launches the PrtSc task, the code below actually performs the
* PrtSc ...; modified to change ribbon color according to the color value in
* the KOLOR word. 0 .. 3 are valid, outside that range the color is NOT set
PRTSCBD4 EQU *
MOVEA.L #$0EC4,A0
MOVEA.L A0,A1
MOVEQ #001,D0
PRTSCBE4 MOVE.B #$00,(A1)+
ADDQ.L #1,D0
PRTSCBEA CMPI.L #$0000001A,D0
BLE.S PRTSCBE4
LEA (A0),A1
MOVE.L #'#PR ',(A1)+
MOVE.W #' ',(A1)+
MOVE.W #$0000,+00016(A0)
MOVEA.L A0,A6
ORI.W #$0040,+00016(A6)
MOVE.B #$0A,D5
TRAP #06 $6 IOMGR6/SYSIO
DC.W $0001 OPEN
BRA.L PRTSC_BAD
BRA.S PRTSCC2A
PRTSC_BAD JMP $0FC2DBE
*
PRTSCC2A EQU *
MOVEA.L #$01228,A0
MOVE.W #$0006,(A0)+ set color
MOVE.L A1,-(A7)
LEA.L KOLOR(PC),A1
CMP.W #4,(A1)
BCS.S KOLOR_OK
SUBA.L #2,A0
BRA.S ANY_KOLOR
KOLOR_OK MOVE.W (A1),(A0)+
ANY_KOLOR MOVE.L (A7)+,A1
JMP $0FC2C38
*
****************************************************************************
TYPE EQU *
TRAP #0 SYSCALL
DC.W 48 SUPMODE
LEA.L BUFADDR(PC),A1 DTCB has field in which buffer address is
* LEA.L TYPEBUF(PC),A2 specified, this loads it with correct (ie.
* MOVE.L A2,(A1) post-relocation) value
MOVE.L #$DD00,(A1)
MOVEQ.L #0,D0
TYPE_TRY EQU *
LEA.L FILEDIB(PC),A6
TRAP #0 SYSCALL
DC.W 15 FMTDIB
CMP.W #2,D7 is it unambiguous filename?
BEQ.S TYPE_GOTIT yes
ADDQ.L #1,D0
CMP.L #3,D0
BLT.S TYPE_TRY
*
TYPE_ERR EQU *
LEA.L TYPE_MSG_ERR(PC),A6
TRAP #0 SYSCALL
DC.W 18 PRTMSG*
TYPE_EXIT EQU *
BRA UNHYPE
*
TYPE_GOTIT EQU *
LEA.L BUFLEN(PC),A1
MOVE.W #16,(A1) set buffer length = 16 bytes
MOVE.W #0,2(A1) set buffer offset = 0
LEA.L FILEDIB(PC),A6
MOVEQ.L #10,D5 LUN = 10 for file
TRAP #6 SYSIO
DC.W 1 OPEN
BRA.L TYPE_ERR
*
MOVE.B FTYP(PC),D0
CMP.B #3,D0
BEQ.S TYPE_TEXT
LEA.L TYPE_NOT_TEXT(PC),A6
TRAP #0 SYSCALL
DC.W 18 PRTMSG*
MOVEQ.L #5,D2 | do 5 times
MOVEQ.L #0,D0 | ?50 mSec per unit delay
MOVEQ #3,D1 | delay 3 units
TYPE_BEEP_LOOP EQU *
MOVE.B #$FC,$0F00001 beep on
TRAP #00 SYSCALL
DC.W $001D Delay
DBRA D2,TYPE_BEEP_LOOP
MOVE.B #$FD,$0F00001 beep off
*
TYPE_TEXT EQU *
LEA.L CRTFPKT(PC),A6 Clear screen, Home cursor
MOVEQ.L #249,D5 LUN for CRT #SCRN0
TRAP #6 SYSIO
DC.W 6 FUNC
NOP long branch to error handler faked out by 2 NOPs
NOP
BSR RST_C_B reset Ctrl-Break
*
LEA.L BUFOFF(PC),A0
MOVEQ.L #0,D0
TYPE_LOOP EQU *
MOVE.L D0,(A0)
LEA.L TYPEDTCB(PC),A6
MOVEQ.L #10,D5
TRAP #6 SYSIO
DC.W 3 SREAD
BRA.L READ_ERR
*
BSR CHK_CB_CN
*
TYP_L1X MOVE.L D0,(A0)
LEA.L TYPEDTCB(PC),A6
MOVEQ.L #249,D5
TRAP #6 SYSIO
DC.W 4 SWRITE
BRA.L TYPE_ERR
*
BSR CHK_CB_CN
BRA TYPE_LOOP
*
READ_ERR EQU *
CMP.W #$085,D7
BNE.L TYPE_ERR
*
MOVE.W BUFOFF(PC),D1
* LEA.L TYPEBUF(PC),A1
LEA.L $DD00,A1
ADDQ.W #1,D1
MOVE.B #$0A,0(A1,D1)
MOVE.B #$0D,1(A1,D1)
MOVE.B #$0D,2(A1,D1)
ADDQ.W #2,D1
LEA.L BUFLEN(PC),A1
MOVE.W D1,(A1)
MOVEI.W #0,2(A1)
*
LEA.L TYPEDTCB(PC),A6
MOVEQ.L #249,D5
TRAP #6 SYSIO
DC.W 4 SWRITE
NOP
NOP
MOVEI.W #16,(A1)
MOVEI.W #0,2(A1)
MOVEI.L #0,(A6)
BRA.L TYPE_EXIT
*
*-----------------------------------------------------------------------
RST_C_B EQU * RESETS CTRL-BREAK INDICATOR BYTE
TRAP #0 SYSCALL
DC.W 48 SUPMODE
MOVEI.B #0,$43B0 Reset Ctrl-Break indicator
RTS
*
*
*-----------------------------------------------------------------------
RST_C_N EQU * RESETS CTRL-NUML INDICATOR BYTE
TRAP #0 SYSCALL
DC.W 48 SUPMODE
MOVEI.B #0,$43B1 Reset Ctrl-NumLock indicator
RTS
*
*
*-----------------------------------------------------------------------
CHK_CB_CN EQU * Checks CTRL-Break and CTRL-NumLock BYTES
* exit via UNHYPE if ctrl break
* freeze on Ctrl-NumLock
TRAP #0 SYSCALL
DC.W 48 SUPMODE
*
CHK_L2 EQU *
* CMP.B #$FF,$43B0 CTRL-Break Byte
DC.W $0C38,$00FF CMPI.B #$FF,$43B0 CHECK CTRL-Break BYTE
DC.W $43B0
BEQ.L UNHYPE
* CMP.B #$FF,$43B1 CTRL-NumLock Byte
DC.W $0C38,$00FF CMPI.B #$FF,$43B1 CHECK CTRL-NumLock Byte
DC.W $43B1
BNE.S CHCK_EXIT
MOVEM.L D0/D1,-(A7)
MOVEQ #0,D0
MOVEQ #1,D1
TRAP #00 $0 SYSCALL
DC.W $001D Delay
MOVEM.L (A7)+,D0/D1
BRA.S CHK_L2
CHCK_EXIT EQU *
RTS
*
**************************************************************************
SL_0E0AA MOVEM.L D0-D1/A1,-(A7)
LEA SL_0E0C4(PC),A1
SUBA.L D1,A1
SUBA.L D1,A1
SL_0E08E ANDI.L #$0000FFFF,D0
DIVU (A1)+,D0
ADDI.B #+048,D0
MOVE.B D0,(A0)+
SWAP D0
SUBI.W #+001,D1
BNE.S SL_0E08E
MOVEM.L (A7)+,D0-D1/A1
RTS
*-------------------------------------------------------------------------
SYSLEVEL EQU *
SL_0E000 EQU *
TRAP #0
DC.W 48 SUPMODE
TRAP #00 $0 SYSCALL SysLev
DC.W $0020 SysLev
LEA.L SL_0E050(PC),A0
MOVE.L D0,(A0)
CLR.L D0
MOVE.B SL_0E050(PC),D0
MOVEQ #002,D1
LEA.L SL_0E062(PC),A0
BSR SL_0E0AA
MOVE.B SL_0E051(PC),D0
LEA.L SL_0E06D(PC),A0
BSR SL_0E0AA
MOVEQ #004,D1
MOVE.W SL_0E052(PC),D0
LEA.L SL_0E07F(PC),A0
BSR SL_0E0AA
LEA.L SL_0E054(PC),A6
TRAP #00 $0 SYSCALL PrtMsg*
DC.W $0012 PrtMsg*
BRA UNHYPE
*
LIST
**************************************************************************
SWITCH_SCREENS EQU *
TRAP #0 SYSCALL
DC.W 55 INQCRTCR - INQuire CRT Control Register
EORI.B #1,D0
TRAP #0 SYSCALL
DC.W 54 SETCRTCR - SET CRT Control Register
BRA SET_CRT
*
**************************************************************************
SCREEN0 EQU *
TRAP #0 SYSCALL
DC.W 55 INQCRTCR - INQuire CRT Control Register
ANDI.B #$FE,D0
TRAP #0 SYSCALL
DC.W 54 SETCRTCR - SET CRT Control Register
BRA SET_CRT
*
**************************************************************************
SCREEN1 EQU *
TRAP #0 SYSCALL
DC.W 55 INQCRTCR - INQuire CRT Control Register
ORI.B #1,D0
TRAP #0 SYSCALL
DC.W 54 SETCRTCR - SET CRT Control Register
BRA SET_CRT
*
*-------------------------------------------------------------------------
* STORAGE FOR SYSLEVEL
*
SL_0E051 EQU *+01
SL_0E052 EQU *+02
SL_0E050 DC.L 0
*
SL_0E054 DC.B 'RELEASE LEVEL '
SL_0E062 DC.B '??, VERSION '
SL_0E06D DC.B '??, INTERNAL LEVEL '
SL_0E07F DC.B '??',$D,$D,$D,$D
DS.W 0
*
SL_0E0BA MOVE.L (A0),-(A3)
SL_0E0BC DC.W $3E8
SL_0E0BE DC.W 100
SL_0E0C0 DC.W +00010
SL_0E0C2 DC.W 0001
SL_0E0C4 DC.W 0000
*
****************************************************************************
* STORAGE FOR TYPE
*
TYPE_MSG_ERR DC.B 'TYPE: Error, aborting.',$D
TYPE_NOT_TEXT DC.B 'TYPE: FILE IS NOT A TEXT FILE!',$D
FILEDIB EQU *
FVOL DS.B 6
FDTD DC.B 1
FTRN DC.B 0
DC.L 0,0
DC.W 0
DC.L 0,0
FILEDIBX EQU *
DS.W 2
DC.L 0,0
FNAM DS.B 8
FEXT DS.B 3
FTYP DS.B 1
FACS DS.B 1
DC.B 0
DC.W 0
DC.L 0
DC.W 0
DC.L 0
DC.W 0
DC.L 0,0
*
CRTFPKT DC.W 6,0,3,0,40,0,0,0,0
*
TYPEDTCB EQU *
TYPESTA DS.B 1
DC.B 0,0,0
BUFADDR DC.L TYPEBUF this value is incorrect after relocation
BUFLEN DC.W 16
BUFOFF DC.W 0
*
TYPEBUF EQU *
DS.B 16
DC.B $D,$D
DC.L 0
*
END_RES_CODE EQU *
END START