User guide

Ways of specifying a numerical value
When you need to specify a value, say a constant or an address, you can use:
Base 16 (hex):
&12 This is the Acorn way.
$12 This is the Pascal / Commadore way.
0x12 This is the C way.
The DOS (“12h”) and VisualBasic (“$H12”) forms are not supported.
Base 10 (denary):
123 As expected...
Base 2 (binary):
%1100 The Acorn way.
To recap, prefix with ‘&’ for hex and ‘%’ for binary. No prefix is necessary for denary numbers.
You can also use ‘$’ and/or ‘0x’ to prefix hex values if you are used to doing it that way. Note that the C
style, if you’ve never used C before, is ‘0x’ which is zero-ecks (not oh-ecks).
Alternatively, in the case of addresses, simply define a label and then use the name of the label. For example:
.never_ending
JMP never_ending
In-line calculations
When you are assigning values, such as:
LDX #43
you can also use calculations. Calculations are marked using square brackets. Within these square brackets
you can enter a sum which is evaluated left-to-right, like:
LDX #[12+42-11] ; evaluates to be 43!
The available mathematical operators are:
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus (remainder after division)
6502asm user guide – prerelease version
page 10