-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbasiced.s65
More file actions
136 lines (91 loc) · 3.18 KB
/
basiced.s65
File metadata and controls
136 lines (91 loc) · 3.18 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
.include "submodules/beeb/include/beeb.s65"
;-------------------------------------------------------------------------
; Valid ROMs:
; BUILD_TYPE==0: BBC Micro
; BUILD_TYPE==1: BBC Micro HI
; BUILD_TYPE==2: BBC Master MOS 3.50 relocatable ($8000 version) (runs
; as-is, but only really makes sense in conjunction with a bit of DIY
; so that the MOS can find its relocation bitmap)
; BUILD_TYPE==8: Electron
; BUILD_TYPE==9: Electron HI (untested)
;-------------------------------------------------------------------------
; Not valid ROMs:
; BUILD_TYPE==3: BBC Master MOS 3.50 relocatable ($b800 version) (only
; used to generate the relocation bitmap)
; BUILD_TYPE==4: assembled at $3800 (useable for testing routines from
; BASIC in the host processor)
;-------------------------------------------------------------------------
HI_ADDRESS = $b800
.if BUILD_TYPE==0
RELOCATABLE=false
HI=false
ELECTRON=false
SVC_BASE=$8000
LANG_BASE=$8000
.elsif BUILD_TYPE==1
RELOCATABLE=false
HI=true
ELECTRON=false
SVC_BASE=$8000
LANG_BASE=HI_ADDRESS
.elsif BUILD_TYPE==2
RELOCATABLE=true
HI=false
ELECTRON=false
SVC_BASE=$8000
LANG_BASE=$8000
.elsif BUILD_TYPE==3
RELOCATABLE=true
HI=false
ELECTRON=false
SVC_BASE=$8000
LANG_BASE=HI_ADDRESS
.elsif BUILD_TYPE==4
RELOCATABLE=false
HI=false
ELECTRON=false
; the ROM ought to fit (at least, in Mode 7...) starting from $3c00,
; but the TOC and/or extra debug junk might push the size past 16K.
SVC_BASE=$3800
LANG_BASE:= $3800
.elsif BUILD_TYPE==8
RELOCATABLE=false
HI=false
ELECTRON=true
SVC_BASE=$8000
LANG_BASE=$8000
.elsif BUILD_TYPE==9
RELOCATABLE=false
HI=true
ELECTRON=true
SVC_BASE=$8000
LANG_BASE=HI_ADDRESS
.endif
;-------------------------------------------------------------------------
.include "zp.s65"
.include "workspace.s65"
.include "cmds.s65"
.include "shared_constants.s65"
.include "mainpart.s65"
*=0
.dsection zp
; Zero page unused by BASIC:
; 1/2 = $4f... - see BASIC ROM user guide
; 4 = $4c... - not quite clear? see http://8bs.com/basic/memory.htm
; 4.32 = $4f... - see https://github.com/hoglet67/BBCBasic4r32/blob/master/disassembly/Basic432.asm
; So $60 should be fairly safe...
*=$60
.dsection basic_unused_zp
; language zero page runs up to $8f, but it would be
; nice to leave $70...$8f free as BASIC reserves that
; for user stuff. Then you can go BASIC->BE->BASIC
; safe in the knowledge that this region will be
; preserved.
;
; (if this error is ever hit, there are options...)
.cerror *>=$70,"too much zero page use"
*=SVC_BASE
.dsection service
.logical LANG_BASE+*-SVC_BASE
.dsection language
.here