You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ The Nibble Knowledge CPU has 8 instructions which are split into two different t
28
28
* STR: Store the nibble in the accumulator to the specified memory address.
29
29
30
30
31
+
31
32
### Pseudo instructions ###
32
33
To aid in disassembly a new metadata format for binary files is now included in the assembler as of v1.1.0.
33
34
* INF - the information section must start with this, and this should be the first instruction of any file.
@@ -81,6 +82,13 @@ Labels when referenced in instructions can be used in two forms:
81
82
82
83
An example of usage would be "LOD sum[F]", which loads the memory address pointed to by "sum" plus the offset of "F" (15 in decimal) into the accumulator.
83
84
85
+
### Address of operations ###
86
+
As all programs built by AS4 are assumed to be static, non-relocatable binary files, the addresses pointed by labels can be calculated at assemble time and used statically. The form is below:
87
+
* &(LABEL[OFFSET])[ADDRESS_OFFSET]
88
+
* LABEL[OFFSET] is the same as for the standard label usage. &() indicates this is an address of operation, and [ADDRESS_OFFSET] is what 4-bit portion of the 16-bit address you want. Both [OFFSET] and [ADDRESS_OFFSET] are optional, without them an offset of zero is assumed.
89
+
90
+
This loads a corresponding value from the table of static values - for example, if the address of the label "Carmen" is 0x00FE, and you use the address of operation LOD &(Carmen)[1], you would load "0xF" into the accumulator; which is the same as using the instruction LOD N_[F] when the N_ static number series is defined.
91
+
84
92
### Comments ###
85
93
Comments in AS4 start with a semicolon, ";" or an octothorp, "#".
/* If it is, then take stock of both the address it was referenced. If a label is referencing a label, we need to move 1 nibble back (as there is no instruction, just 4 nibbles). Cheaper than doing an if below. */
116
115
unsigned short intinstaddress= (*unknownlabels)[i].addr- ((*unknownlabels)[i].type&1);
117
116
/* And the address the label points to plus the requested offset. We need to add one nibble if it is an instruction referencing a nibble as we moved one back above. */
0 commit comments