forked from jblang/bbcbasic-z80
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathram.asm
101 lines (93 loc) · 2.2 KB
/
ram.asm
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
; TITLE BBC BASIC (C) R.T.RUSSELL 1984
;
;RAM MODULE FOR BBC BASIC INTERPRETER
;FOR USE WITH VERSION 2.0 OF BBC BASIC
;*STANDARD CP/M DISTRIBUTION VERSION*
;(C) COPYRIGHT R.T.RUSSELL 31-12-1983
;
include "constants.inc"
PUBLIC ACCS
PUBLIC BUFFER
PUBLIC LINENO
PUBLIC TOP
PUBLIC PAGE
PUBLIC LOMEM
PUBLIC FREE
PUBLIC HIMEM
PUBLIC RANDOM
PUBLIC COUNT
PUBLIC WIDTH
PUBLIC ERL
PUBLIC ERR
PUBLIC ERRTRP
PUBLIC ERRTXT
PUBLIC TRACEN
PUBLIC AUTONO
PUBLIC INCREM
PUBLIC LISTON
PUBLIC DATPTR
PUBLIC FNPTR
PUBLIC PROPTR
PUBLIC STAVAR
PUBLIC OC
PUBLIC PC
PUBLIC DYNVAR
PUBLIC ERRLIN
PUBLIC TIMESTOREL
PUBLIC TIMESTOREH
PUBLIC TIMESTOREL1
PUBLIC SOUND_ENABLED
PUBLIC QUEUE_CMDBUF
PUBLIC QUEUE_CMDBUFED
PUBLIC QUEUE_CMD_WORK
PUBLIC TICKFREQ
;
SECTION DATA
ALIGN 256
;
;n.b. ACCS, BUFFER & STAVAR must be on page boundaries.
;
ACCS: DEFS 256 ;STRING ACCUMULATOR
BUFFER: DEFS 256 ;STRING INPUT BUFFER
STAVAR: DEFS 27*4 ;STATIC VARIABLES
OC EQU STAVAR+15*4 ;CODE ORIGIN (O%)
PC EQU STAVAR+16*4 ;PROGRAM COUNTER (P%)
DYNVAR: DEFS 54*2 ;DYN. VARIABLE POINTERS
FNPTR: DEFS 2 ;DYN. FUNCTION POINTER
PROPTR: DEFS 2 ;DYN. PROCEDURE POINTER
;
PAGE: DEFS 2 ;START OF USER PROGRAM
TOP: DEFS 2 ;FIRST LOCN AFTER PROG.
LOMEM: DEFS 2 ;START OF DYN. STORAGE
FREE: DEFS 2 ;FIRST FREE-SPACE BYTE
HIMEM: DEFS 2 ;FIRST PROTECTED BYTE
;
LINENO: DEFS 2 ;LINE NUMBER
TRACEN: DEFS 2 ;TRACE FLAG
AUTONO: DEFS 2 ;AUTO FLAG
ERRTRP: DEFS 2 ;ERROR TRAP
ERRTXT: DEFS 2 ;ERROR MESSAGE POINTER
DATPTR: DEFS 2 ;DATA POINTER
ERL: DEFS 2 ;ERROR LINE
ERRLIN: DEFS 2 ;"ON ERROR" LINE
RANDOM: DEFS 5 ;RANDOM NUMBER
COUNT: DEFS 1 ;PRINT POSITION
WIDTH: DEFS 1 ;PRINT WIDTH
ERR: DEFS 1 ;ERROR NUMBER
LISTON: DEFS 1 ;LISTO & OPT FLAG
INCREM: DEFS 1 ;AUTO INCREMENT
TIMESTOREL: ; Store current time tick high 16 bits
DEFW 0
TIMESTOREH: ; Store current time tick low 16 bits
DEFW 0
TIMESTOREL1: ; Store current time tick high 16 bits - INTERNAL TIME COUNTER
DEFB 0
SOUND_ENABLED:
DEFB 0 ; Assigned to 1 if HBIOS sound driver found
QUEUE_CMDBUF:
DEFS QUEUED_CMD_SIZE * QUEUED_CMD_CNT, 0
QUEUE_CMDBUFED: EQU $
QUEUE_CMD_WORK:
DEFW 0 ; POINTS TO ITEM IN QUEUE_CMDBUF - THE CURRENTLY UNDER CONSTRUCTION CMD
TICKFREQ:
DEFB 0