NoRAL

No-Register Assembly Language - A simple assembly-style language based on a hypothetical processor that has no internal registers. Created by User:DMC

General Concept

 * All volatile memory is external to the processor
 * Addresses are 16 bit, stored big endian
 * Memory is 8 bits
 * Instructions use 0, 1, or 2 memory references
 * m1 - first memory reference
 * m2 - second memory reference
 * xxx m1 m2 - 3 letter mnemonic, arguments separated with spaces
 * Program listings are in hex
 * It’s okay to write self-modifying code (maybe even necessary)
 * # comment with ‘#’ as first character in a line
 * Turing complete: No, only 64k addressable memory

Addressing modes

 * Implied: (brk, nop, ret)
 * Absolute: 2 byte address
 * Immediate: 1 byte (sto)
 * Indirect: mvi

Hello World!\n
sto 0100 48 sto 0101 65 sto 0102 6c sto 0103 6c sto 0104 6f sto 0105 2c sto 0106 20 sto 0107 57 sto 0108 6f sto 0109 72 sto 010a 6c sto 010b 64 sto 010c 21 brk
 * 1) just store all the ascii values in screen memory
 * 1) brk only necessary if the next memory location is not zero

Output: Program Counter:  0234 Zero Flag:          00 Carry Flag:         00 Stack Pointer:      00 +-Screen Display-+ |Hello, World! | |                                | |                                | |                                | |                                | |                                | |                                | |                                | ++

Clear screen
sto 1000 20 mov 0100 1000 inc 0206 jpz 0212 jmp 0204 brk

Output: Program Counter: 0213 Zero Flag:         01 Carry Flag:        01 Stack Pointer:     00

External resources

 * NoRAL – Interpreter in Python 3