zasm - Z80 Assembler

Source files

Expressions

The assembler has an Source files: Expressionsexpression evaluator which supports various formats for numbers and operations with Expressions: Operatorspriority order. You may also use brackets, but don't start an Source files: Expressionsexpression for an immediate value with an opening bracket. The assembler thinks that an Source files: Expressionsexpression which starts with an opening bracket indicates direct memory addressing. If you really need to start an immediate value Source files: Expressionsexpression with brackets, precede it with the '+' monadic Expressions: Operatorsoperator.

$ (dollar sign)

The Expressions: $ (dollar sign)dollar sign '$' refers to the logical address of the first byte of the current instruction. The logical address may differ from the physical location if you have used the Pseudo instructions: orgorg Source files: Pseudo instructionspseudo instruction to move the logical origin.

Number literals

12345    decimal number
$1234    hexadecimal number
1234h    hexadecimal number
%1010    binary number
1010b    binary number
'ab'     note: 'b' goes to the lower address, 'a' to the higher

Operators

The following Expressions: Operatorsoperators are recognized and listed in order of precedence:

brackets            ( ... )
monadic Expressions: Operatorsoperators   + - ~           plus sign, minus sign, 2's complement
shifting            << >>           shift left or right; left operand is target
boolean             & | ^           bitwise and, or, xor
mult/div            * / \ %         multiply, divide, remainder, remainder
add/sub             + -             add, subtract
comparisions        > < >= <= = <>  greater than etc.; result is $0000 or $FFFF

Valid HTML   Valid CSS