some rewording
This commit is contained in:
parent
584f0776f7
commit
d65289c61f
|
@ -412,8 +412,8 @@ the second line has several things going on:
|
||||||
|
|
||||||
reading the program from left to right, we can see the following behavior:
|
reading the program from left to right, we can see the following behavior:
|
||||||
|
|
||||||
* number 68 is pushed down onto the stack by the LIT instruction
|
* the LIT instruction pushes number 68 down onto the stack
|
||||||
* number 18 is pushed down onto the stack by the LIT instruction
|
* the LIT instruction pushes number 18 down onto the stack
|
||||||
* the DEO instruction takes the top element from the stack (18) and uses it as a device address
|
* the DEO instruction takes the top element from the stack (18) and uses it as a device address
|
||||||
* the DEO instruction takes the top element from the stack (68) and uses it as a byte to output
|
* the DEO instruction takes the top element from the stack (68) and uses it as a byte to output
|
||||||
* the DEO instruction outputs the byte to the device address, leaving the stack empty
|
* the DEO instruction outputs the byte to the device address, leaving the stack empty
|
||||||
|
@ -541,6 +541,8 @@ our "hello program" would look like the following, using the new runes we just l
|
||||||
#0a #18 DEO ( newline )
|
#0a #18 DEO ( newline )
|
||||||
```
|
```
|
||||||
|
|
||||||
|
the "raw" in the name of this rune indicates that it's not literal, i.e. that it doesn't add a LIT instruction.
|
||||||
|
|
||||||
### runes for labels
|
### runes for labels
|
||||||
|
|
||||||
even though right now we know that #18 corresponds to pushing the console write device address down onto the stack, for readability and future-proofing of our code it is a good practice to assign a set of labels that would correspond to that device and sub-address.
|
even though right now we know that #18 corresponds to pushing the console write device address down onto the stack, for readability and future-proofing of our code it is a good practice to assign a set of labels that would correspond to that device and sub-address.
|
||||||
|
@ -575,7 +577,7 @@ none of this would be translated to machine code, but aids us in writing uxntal
|
||||||
|
|
||||||
the rune for referring to literal address in the zero page or i/o address space, is . (dot), and a / (slash) allows us to refer to one of its sublabels.
|
the rune for referring to literal address in the zero page or i/o address space, is . (dot), and a / (slash) allows us to refer to one of its sublabels.
|
||||||
|
|
||||||
remember: it being a "literal address" rune implies that it will add a LIT instruction before the corresponding address :)
|
remember: as a "literal address" rune it will add a LIT instruction before the corresponding address :)
|
||||||
|
|
||||||
we could re-write our "hello program" as follows:
|
we could re-write our "hello program" as follows:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue