Uxntal Memory
There are 64kb of addressable memory. Roms are always loaded at 0x0100, which is the address of the Reset Vector and where evaluation begins. During boot, the stacks, device and addressable memories are zeroed. During a soft-reboot, the content of the zero-page is preserved.
Shared | Memory | RAM | Data | 64kb pages |
---|---|---|---|---|
Private | Stacks | Working Stack | Data | 256 bytes |
Pointer | 1 byte | |||
Return Stack | Data | 256 bytes | ||
Pointer | 1 byte | |||
IO | Devices | Data | 256 bytes |
The device page and stacks are located outside of addressable memory.
- An Absolute Padding, like |100 moves the program generation to an address specified by a number or label.
- A Relative Padding, like $18 moves the program generation by a distance specified by a number or label.
|18 @width
|100 @on-reset ( -> )
;buffer/end BRK 02 18
|200 @buffer $width &end
Memory is big-endian, when writing or reading a short from memory, the position is that of the high-byte. The low-byte of a short written at 0xffff wraps to 0x0000.
#12 #0200 STA 0x0200=12 #3456 #0400 STA2 0x0400=34, 0x0401=56 #0400 LDA 34
The zero-page is the memory located below 0x0100, its purpose is to store variables that will be accessed often, or needs to be preserved across a soft-reboot. It is sligthly faster to read and write from the zero-page using the LDZ and STZ opcodes as they use only a single byte instead of a short. This memory space cannot be pre-filled in the rom prior to initialization. The low-byte of a short written at 0xff wraps to 0x00.
#1234 #80 STZ2 0x0080=12, 0x0081=34 #81 LDZ 34
incoming uxntal syntax uxntal syntax