Assembly ideas / Precedence


LUMYDCTT uses Reverse Polish Notation (by Charles Leonard Hamblin) - a modified sort of the original Polish Notation (by Jan Lukasiewicz) - to evaluate the arithmetic and logic operations.

Order of operations

Priority Operator Key Meaning
1 ( Shift+8 (open round bracket) to enclose an operation
2 ) Shift+9 (close round bracket) to enclose an operation
3 ! Shift+4 (exclamation mark) NOT or NEG eg.: 1001 1110 -> 0110 0001
4 * AltGr+-, NumPad:* (asterix) multiplication
5 / Shift+6 (slash) division
6 & AltGr+C (ampersand) AND eg.: 1001 1110 & 0000 1111 => 0000 1110
7 << AltGr+í (double left angle bracket) SHL eg.: 1001 1110 << 2 => 0111 1000 (shift bits left by 2 = multiply by 4)
8 >> AltGr+Y (double right angle bracket) SHR eg.: 1001 1110 >> 3 => 0001 0011 (shift bits right by 3 = divide by 8)
9 + Shift+3, NumPad: + (plus sign) addition
10 - -, NumPad: - (minus sign) subtraction
11 | AltGr+W OR eg.: 1001 1110 | 0010 0000 => 1011 1110
12 ^ AltGr+3 (then press a key, eg. SPACE) XOR eg.: 1001 1110 ^ 0011 1000 => 1010 0110

So you can use the above operators almost everywhere: after variables, ORG, DB, DW, INCLUDE, CMAP, assembly mnemonics, etc.

Lives=8+2
LDA #(Lives-3*2)/2
STA $0C00

Special operations

Operation Meaning
LDA #'*'
Accumulator equals to the code of asterix (*=42)
INT=$0314
SCREEN=$0C00
INTERRUPT=$CE0E
.
SEI
LDA #<Interrupt
STA INT
LDA #>Interrupt
STA INT+1
CLI
.
Interrupt
LDA #'*'
STA SCREEN
JMP INTERRUPT
"LDA #<Interrupt" is "LDA #Interrupt & 255"

"LDA #>Interrupt" is "LDA #Interrupt >> 8"