-
Notifications
You must be signed in to change notification settings - Fork 85
/
mon.cmd
91 lines (91 loc) · 1.49 KB
/
mon.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
.PAGE 'MON.CMD'
;
;
; DISK MONITOR 2040 V1.0
;
; THIS MONITOR ALLOWS YOU TO
; PEEK AND POKE THE DISK
;
; MONITOR COMMANDS ARE :
;
; $R - READ T,S,D,B
; $W - WRITE T,S,D,B
; $G - GET DISK MEMORY IMAGE TO PET
; $P - PUT PET MEMORY IMAGE TO DISK
; $V - VIEW DISK MEMORY
; $: - MODIFY DISK MEMORY
; $> - DIRECT DISK COMMAND
; $T - TRACE FILE LINKS
; $I - INIT JOB HEADER
;
;
; THIS ADDS ITSELF TO THE PET
; MONITOR
;
;
START LDA #<DSKMON
STA ERRJMP ; UPDATE PET MONITOR
LDA #>DSKMON
STA ERRJMP+1 ; INDIRECT ERROR
;
BRK
; DISK MON 1.0 2/10/80
;
DSKMON CMP #'$' ;TEST IF '$'
BEQ DSKMN
JMP ERROR ; BAD COMMAND
;
DSKMN JSR RDOC ; ENTRY FROM PET MONITOR ON A '$' SYMBOL
;
CMP #SPC ; IGNORE SPACE
BEQ DSKMN
;
DSK002 LDX #NUMCMD-1 ; COMMAND TABLE LOOKUP INDEX
DSK003 CMP CMDTBL,X
BNE DSK004
;
TXA
ASL A ; 2*INDEX FOR COMMAND JUMP ADDRESS
TAX
;
LDA JMPTBL+1,X
PHA
LDA JMPTBL,X ; PUSH RETURN ADDRESS AND THE RTS ON IT
PHA
RTS ; OFF TO THE COMMAND
;
DSK004 DEX
BPL DSK003
;
JMP ERROR ; BAD COMMAND PRINT '?
;
;
; COMMAND LIST
CMDTBL .BYTE 'RWGPV:>ITFD'
; $R: READ
; $W: WRITE
; $G: GET
; $P: PUT
; $V: VIEW
; $:: ALTER DISK MEMORY
; $>: DIRECT DISK COMMAND
; $I: INIT JOB HEADER
; $T: TRACE FILE LINKS
; $F: FETCH SECTOR TO MEMORY
; $D: DUMP MEMORY TO DISK
;
;
JMPTBL .WORD READ-1
.WORD WRITE-1
.WORD GET-1
.WORD PUT-1
.WORD VIEW-1
.WORD ALTER-1
.WORD WEDGE-1
.WORD INIT-1
.WORD TRACE-1
.WORD FETCH-1
.WORD DUMP-1
;
;
.END