Browse Source

added RAMDOS

master
Michael Steil 1 month ago
parent
commit
9def99f281
4 changed files with 5240 additions and 0 deletions
  1. 2
    0
      RAMDOS/a.src
  2. 225
    0
      RAMDOS/macros.src
  3. 5009
    0
      RAMDOS/ramdos12.src
  4. 4
    0
      README.md

+ 2
- 0
RAMDOS/a.src View File

@@ -0,0 +1,2 @@
1
+        .include macros
2
+        .include ramdos12

+ 225
- 0
RAMDOS/macros.src View File

@@ -0,0 +1,225 @@
1
+	.subttl	16 bit macro definitions
2
+;
3
+ram	.macro %a,%b
4
+	.ifdef %a
5
+	.messg multiple definitions -> curram
6
+	.else
7
+%a	= curram
8
+	.ifb <%b>
9
+curram = curram+1
10
+	.else
11
+curram = curram+%b
12
+	.endif
13
+	.endif
14
+	.endm
15
+
16
+zpage	.macro %a,%b
17
+	.ifdef %a
18
+	.messg multiple definitions -> curram
19
+	.else
20
+%a	= curzpg
21
+	.ifb <%b>
22
+curzpg = curzpg+1
23
+	.else
24
+curzpg = curzpg+%b
25
+	.endif
26
+	.ifgt curzpg-$100
27
+	ERROR- too many zero page variables.....
28
+	.endif
29
+	.endif
30
+	.endm
31
+;
32
+;
33
+;	double precision macros
34
+;
35
+;
36
+ldd	.macro	%a
37
+	lda %a		; x,a <= %a
38
+	ldx %a+1
39
+	.endm
40
+;
41
+std	.macro %a
42
+	sta %a		; %a <= x,a
43
+	stx %a+1
44
+	.endm
45
+;
46
+cpd	.macro %a
47
+	cpx %a+1	; compare x,a with %a
48
+	.ifn >%a
49
+	bne *+5
50
+	.else
51
+	bne *+4
52
+	.endif
53
+	cmp %a
54
+	.endm
55
+;
56
+;
57
+cpi	.macro %a
58
+	cpx #>%a	; compare x,a with #%a
59
+	bne *+4
60
+	cmp #<%a
61
+	.endm
62
+;
63
+ldi	.macro %a	
64
+mactmp	= %a
65
+	lda #<mactmp	; x,a <= #%a
66
+	ldx #>mactmp
67
+	.endm
68
+;
69
+;
70
+incd	.macro %a
71
+	inc %a		; inc double precision %a
72
+	.ifn >%a
73
+	bne *+5
74
+	.else
75
+	bne *+4
76
+	.endif
77
+	inc %a+1
78
+	.endm
79
+;
80
+decd	.macro %a
81
+	pha		; dec double precision %a
82
+	lda %a
83
+	.ifn >%a
84
+	bne *+5
85
+	.else
86
+	bne *+4
87
+	.endif
88
+	dec %a+1
89
+	dec %a
90
+	pla
91
+	.endm
92
+;
93
+add	.macro %a
94
+	clc
95
+	addc %a
96
+	.endm
97
+;
98
+addc	.macro %a
99
+	adc %a
100
+	pha
101
+	txa
102
+	adc %a+1
103
+	tax
104
+	pla
105
+	.endm
106
+;
107
+addi	.macro %a
108
+mactmp	= %a
109
+	clc
110
+	adc #<mactmp
111
+	pha
112
+	txa
113
+	adc #>mactmp
114
+	tax
115
+	pla
116
+	.endm
117
+;
118
+sbd	.macro %a
119
+	sec
120
+	sbdc %a
121
+	.endm
122
+;
123
+sbdc	.macro %a
124
+	sbc %a	
125
+	pha
126
+	txa
127
+	sbc %a+1
128
+	tax
129
+	pla
130
+	.endm
131
+;
132
+cmpdr	.macro %a,%b,%r	; double compare %a to %b using .%r
133
+	ld%r %a+1
134
+	cp%r %b+1
135
+	.ifn >%a
136
+	.ifn >%b
137
+	bne *+2+3+3
138
+	.else
139
+	bne *+2+3+2
140
+	.endif
141
+	.else
142
+	.ifn >%b
143
+	bne *+2+2+3
144
+	.else
145
+	bne *+2+2+2
146
+	.endif
147
+	.endif
148
+	ld%r %a
149
+	cp%r %b
150
+	.endm
151
+;
152
+cpa 	.macro %a
153
+	cmp %a
154
+	.endm
155
+;
156
+phd	.macro
157
+	pha
158
+	txa
159
+	pha
160
+	.endm
161
+;
162
+pld	.macro
163
+	pla
164
+	tax
165
+	pla
166
+	.endm
167
+;
168
+adad	.macro %a
169
+	clc
170
+	adc %a
171
+	sta %a
172
+	.ifn >%a
173
+	bcc *+5
174
+	.else
175
+	bcc *+4
176
+	.endif
177
+	inc %a+1
178
+	.endm
179
+;
180
+zchk	.macro %a
181
+	lda %a
182
+	ora %a+1
183
+	.endm
184
+;
185
+;
186
+;	entry name,value
187
+;		creates a symbol whose name is equal to name_*
188
+;		where * is a single char rangeing from 0-9,a-z.
189
+;		the value of the symbol is defined in the second arg.
190
+;
191
+;	table	name,directive,modifier
192
+;	
193
+;		creates n lines of code where n is the number of times
194
+;		entry was called.
195
+;		name is the name of the table symbols used in entry.
196
+;		directive is the directive for the line ( include the . )
197
+;		modifier optionally may contain ">" or other chars to
198
+;		to be immediately prepended to symbol name.
199
+;
200
+;
201
+entry	.macro	%table,%value
202
+	flag = 0
203
+	.irpc	%c,0123456789abcdefghijklomp
204
+	.ife	flag
205
+	.ifndef %table_%c
206
+	%table_%c = %value
207
+	flag = 1
208
+	.endif
209
+	.endif
210
+	.endr
211
+	.ife flag
212
+	*** ERROR *** entry macro overflow %table
213
+	.endif
214
+	.endm
215
+;
216
+table	.macro %table
217
+	.irpc	%c,0123456789abcdefghijklmnop
218
+	.ifdef %table_%c
219
+	.byte <%table_%c
220
+	.endif
221
+	.endr
222
+	.endm
223
+;
224
+
225
+

+ 5009
- 0
RAMDOS/ramdos12.src
File diff suppressed because it is too large
View File


+ 4
- 0
README.md View File

@@ -123,6 +123,10 @@ The Commodore 1571 DOS source (3.0, 1986), updated version (310654-05). Extracte
123 123
 
124 124
 The Commodore 1581 DOS source (10.0, 1987), original version (318045-01). Extracted from 1581-source.d81 from Steve Gray's [Dennis Jarvis Page](http://6502.org/users/sjgray/dj/) and converted to LF line breaks.
125 125
 
126
+## RAMDOS
127
+
128
+The C64/C128 RAMDISK DOS V4.3 source (1987). Extracted from [ramdos.zip](http://www.zimmers.net/anonftp/pub/cbm/src/drives/ramdos.zip). This is a version of Commodore DOS running on the C64/C128 for using a REU (RAM Expansion Unit) as a RAM disk.
129
+
126 130
 # Credits
127 131
 
128 132
 This repository is maintained by Michael Steil, mist64@mac.com

Loading…
Cancel
Save