notes on literal numbers. thanks marshall!
This commit is contained in:
parent
872261f9fc
commit
6e6a6aef77
|
@ -325,6 +325,12 @@ you can see the hexadecimal values of the ascii characters in the following tabl
|
|||
|
||||
=> https://wiki.xxiivv.com/site/ascii.html ascii table
|
||||
|
||||
### literal numbers
|
||||
|
||||
note that the literal numbers that we wrote, 0100, 18 and 68, are written in hexadecimal using either 4 digits corresponding to two bytes, or 2 digits corresponding to one byte.
|
||||
|
||||
in uxntal we can only write numbers that are 2 or 4 hexadecimal digits long. if, for example, we were only interested in writing a single hexadecimal digit, we would have to include a 0 at its left.
|
||||
|
||||
## assembled rom
|
||||
|
||||
we can see that the assembler reported that our program is 5 bytes in size:
|
||||
|
@ -576,6 +582,8 @@ define a PRINT-DIGIT macro that takes a number (from 0 to 9) from the stack, and
|
|||
%PRINT-DIGIT { } ( number -- )
|
||||
```
|
||||
|
||||
remember that the number would have to be written as a complete byte in order to be valid uxntal. if you wanted to test this macro with e.g. number 2, you would have to write it as 02.
|
||||
|
||||
# instructions of day 1
|
||||
|
||||
these are the instructions we covered today:
|
||||
|
|
Loading…
Reference in New Issue