-
Notifications
You must be signed in to change notification settings - Fork 30
/
equates.mu4
30 lines (26 loc) · 1.37 KB
/
equates.mu4
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
| This file is part of muforth: https://muforth.dev/
|
| Copyright 2002-2024 David Frech. (Read the LICENSE for details.)
forth decimal
| .equates. contains chip equates and any other constants that should be
| visible to both the assembler and target compiler. When used interactively,
| or in the assembler, these push their value. When used in a target colon
| word, these compile literals.
|
| .csr. contains definitions only of the CSRs. They are in a separate chain
| so that it is possible for the disassembler to map from an address of a CSR
| to its name. If we put them in with the other equates we would never know
| if we found a CSR or something else with the same value.
|
| However, to make this less annoying for authors of token consumers, we
| chain .equates. to .csr. so that we can search *both* by searching
| .equates. However, when the disassembler looks for its match, it can start
| at the head of the .csr. and will only see those. So we get both ease and
| precision.
sealed .csr. ( definitions of CSRs)
.csr. chain .equates. ( chip equates and other constants for target)
( Defining words for equates and CSRs.)
: csr ( offset) current preserve .csr. definitions constant ;
: equ ( offset) current preserve .equates. definitions constant ;
: vector ( offset) equ ;
: aka .equates. chain' execute ; ( for making synonyms)