mirror of
https://github.com/iKarith/beneath-apple-dos.git
synced 2024-12-21 00:31:36 +00:00
93dd3e1ecd
I would not swear these dumped correctly using the procedure described in the README files.
160 lines
4.1 KiB
ArmAsm
160 lines
4.1 KiB
ArmAsm
SBTL 'D U M P -- TRACK DUMP UTILITY'
|
|
ORG $800
|
|
SKP 1
|
|
***********************************************************
|
|
* *
|
|
* DUMP:THIS PROGRAM WILL ALLOW ITS USER TO DUMP AN ENTIRE *
|
|
* TRACK IN ITS RAW FORM INTO MEMORY FOR EXAMINATION. *
|
|
* *
|
|
* INPUT: $02 = TRACK TO BE READ *
|
|
* *
|
|
* OUTPUT:$1000 = ADDRESS OF TRACK IMAGE *
|
|
* *
|
|
* ENTRY POINT: $800 *
|
|
* *
|
|
* PROGRAMMER: DON D WORTH 2/19/81 *
|
|
* *
|
|
***********************************************************
|
|
SKP 1
|
|
* ZPAGE DEFINITIONS
|
|
SKP 1
|
|
PTR EQU $0 WORK POINTER
|
|
TRACK EQU $2 TRACK TO BE READ/WRITTEN
|
|
A1L EQU $3C MONITOR POINTER
|
|
A2L EQU $3E MONITOR POINTER
|
|
PREG EQU $48 MONITOR STATUS REGISTER
|
|
SKP 1
|
|
* OTHER ADDRESSES
|
|
SKP 1
|
|
BUFFER EQU $1000 TRACK IMAGE AREA
|
|
LOCRPL EQU $3E3 LOCATE RWTS PARMLIST SUBRTN
|
|
RWTS EQU $3D9 RWTS SUBROUTINE
|
|
COUT EQU $FDED PRINT ONE CHAR SUBROUTINE
|
|
XAM EQU $FDB3 MONITOR HEX DUMP SUBRTN
|
|
SKP 1
|
|
* DISK I/O SELECTS
|
|
SKP 1
|
|
DRVSM0 EQU $C080 STEP MOTOR POSITIONS
|
|
DRVSM1 EQU $C081
|
|
DRVSM2 EQU $C082
|
|
DRVSM3 EQU $C083
|
|
DRVSM4 EQU $C084
|
|
DRVSM5 EQU $C085
|
|
DRVSM6 EQU $C086
|
|
DRVSM7 EQU $C087
|
|
DRVOFF EQU $C088 TURN DRIVE OFF AFTER 6 REVS
|
|
DRVON EQU $C089 TURN DRIVE ON
|
|
DRVSL1 EQU $C08A SELECT DRIVE 1
|
|
DRVSL2 EQU $C08B SELECT DRIVE 2
|
|
DRVRD EQU $C08C READ DATA LATCH
|
|
DRVWR EQU $C08D WRITE DATA LATCH
|
|
DRVRDM EQU $C08E SET READ MODE
|
|
DRVWRM EQU $C08F SET WRITE MODE
|
|
SKP 1
|
|
* RWTS PARMLIST DEFINITION
|
|
SKP 1
|
|
DSECT
|
|
RPLIOB DS 1 IOB TYPE ($01)
|
|
RPLSLT DS 1 SLOT*16
|
|
RPLDRV DS 1 DRIVE
|
|
RPLVOL DS 1 VOLUME
|
|
RPLTRK DS 1 TRACK
|
|
RPLSEC DS 1 SECTOR
|
|
RPLDCT DS 2 ADDRESS OF DCT
|
|
RPLBUF DS 2 ADDRESS OF BUFFER
|
|
RPLSIZ DS 2 SECTOR SIZE
|
|
RPLCMD DS 1 COMMAND CODE
|
|
RPLCNL EQU $00 NULL COMMAND
|
|
RPLCRD EQU $01 READ COMMAND
|
|
RPLCWR EQU $02 WRITE COMMAND
|
|
RPLCFM EQU $04 FORMAT COMMAND
|
|
RPLRCD DS 1 RETURN CODE
|
|
RPLRWP EQU $10 WRITE PROTECTED
|
|
RPLRVM EQU $20 VOLUME MISMATCH
|
|
RPLRDE EQU $40 DRIVE ERROR
|
|
RPLRRE EQU $80 READ ERROR
|
|
RPLTVL DS 1 TRUE VOLUME
|
|
RPLPSL DS 1 PREVIOUS SLOT
|
|
RPLPDR DS 1 PREVIOUS DRIVE
|
|
DEND
|
|
SKP 2
|
|
* USE RWTS TO POSITION THE ARM TO THE DESIRED TRACK
|
|
SKP 1
|
|
DUMP JSR LOCRPL LOCATE RWTS PARMLIST
|
|
STY PTR AND SAVE POINTER
|
|
STA PTR+1
|
|
SKP 1
|
|
LDA TRACK GET TRACK TO READ/WRITE
|
|
LDY #RPLTRK STORE IN RWTS LIST
|
|
STA (PTR),Y
|
|
SKP 1
|
|
LDA #RPLCNL NULL OPERATION
|
|
LDY #RPLCMD AND STORE IN LIST
|
|
STA (PTR),Y
|
|
SKP 1
|
|
LDA #0 ANY VOLUME WILL DO
|
|
LDY #RPLVOL
|
|
STA (PTR),Y
|
|
JSR LOCRPL RELOAD POINTER TO PARMS
|
|
JSR RWTS CALL RWTS
|
|
LDA #0
|
|
STA PREG FIX P REG SO DOS IS HAPPY
|
|
SKP 1
|
|
* PREPARE TO DUMP TRACK TO MEMORY
|
|
SKP 1
|
|
LDY #RPLSLT GET SLOT*16
|
|
LDA (PTR),Y
|
|
TAX
|
|
LDA DRVON,X KEEP DRIVE ON
|
|
LDA DRVRDM,X INSURE READ MODE
|
|
SKP 1
|
|
LDA #>BUFFER POINT AT DATA
|
|
STA PTR
|
|
LDA #<BUFFER
|
|
STA PTR+1
|
|
LDY #0
|
|
SKP 1
|
|
* START DUMPING AT THE BEGINNING OF A SECTOR ADDRESS
|
|
* FIELD OR A SECTOR DATA FIELD
|
|
SKP 1
|
|
LOOP1 LDA DRVRD,X WAIT FOR NEXT BYTE
|
|
BPL LOOP1
|
|
CMP #$FF AUTOSYNC?
|
|
BNE LOOP1 NO, DON'T START IN MIDDLE
|
|
LOOP2 LDA DRVRD,X WAIT FOR NEXT BYTE
|
|
BPL LOOP2
|
|
CMP #$FF TWO AUTOSYNCS?
|
|
BNE LOOP1 NOT YET
|
|
LOOP3 LDA DRVRD,X
|
|
BPL LOOP3
|
|
CMP #$FF STILL AUTOSYNCS?
|
|
BEQ LOOP3 YES, WAIT FOR DATA BYTE
|
|
BNE LOOP4 ELSE, START STORING DATA
|
|
SKP 1
|
|
* ONCE ALIGNED, BEGIN COPYING THE TRACK TO MEMORY.
|
|
* COPY AT LEAST TWICE ITS LENGTH TO INSURE WE GET IT
|
|
* ALL.
|
|
SKP 1
|
|
LOOPD LDA DRVRD,X WAIT FOR NEXT DATA BYTE
|
|
BPL LOOPD
|
|
LOOP4 STA (PTR),Y STORE IN MEMORY
|
|
INC PTR BUMP POINTER
|
|
BNE LOOPD
|
|
INC PTR+1
|
|
LDA PTR+1
|
|
CMP #$40 DONE AT LEAST A TRACK?
|
|
BCC LOOPD NO, CONTINUE
|
|
LDA DRVOFF,X TURN DRIVE OFF
|
|
SKP 1
|
|
* WHEN FINISHED, DUMP SOME OF TRACK IN HEX ON SCREEN
|
|
SKP 1
|
|
EXIT LDA #>BUFFER DUMP 800.8AF
|
|
STA A1L
|
|
LDA #<BUFFER
|
|
STA A1L+1
|
|
LDA #>BUFFER+$AF
|
|
STA A2L
|
|
LDA #<BUFFER+$AF
|
|
STA A2L+1
|
|
JMP XAM EXIT VIA HEX DISPLAY
|