1 unsorted notes on UrAsm commands and quirks
6 EQU defines unique label (which cannot be redefined)
8 '=' assigns value to label (creating new label if necessary, or
9 redefining the existing one)
14 if label starts with '@@', it doesn't reset local labels.
16 if label starts with '.', it is a local label; all local
17 labels will be forgotten after new global label.
20 displaying expressions while assembling
21 =======================================
24 pring args on the second pass; can print strings and perform math
26 pring args on the first pass; can print strings and perform math
28 pring args on each pass; can print strings and perform math
32 the same as "DISPLAY*", but prins all numbers as hex values
38 SNA -- .sna, no autorun
39 RUNSNA -- .sna, with autorun
40 TAP, TAPE -- .tap, no autorun
41 RUNTAP, RUNTAPE -- .tap, with autorun (i.e. with BASIC loader)
42 BIN, RAW -- just a raw binary (or several binaries, one for each ORG)
43 DMB, RUNDMB -- DMB, DMB with autorun
44 NONE, NOTHING -- no output file
46 for tapes with autorun you can use "CLR" command to define BASIC "CLEAR".
51 MACRO downxx regpair, asret=0, asjp=0
90 "..label:" is label local to macro.
96 set current logical and physical destination address
106 physical code location is not changed, but logical code location set to "addr"
113 cannot be used in DISP
121 ALIGN, but for "DISP" blocks.
127 sets code entry point (for formats with autostart).
133 sets CLEAR addess for BASIC tap loader.
137 RESERVE address space (not implemented yet)
138 ===========================================
140 will automaticaly skip the given area (and insert all necessary
141 jumps) if assembled code will overlap.
143 *** NOT IMPLEMENTED YET!
148 INCBIN name [,maxlen]
149 include binary file "as-is", possibly with max length limit.
156 all non-local labels between those will be "exported" to the other
157 code as "mname.labelname".
165 duplicates given code fragment "cnt" times. nested DUPs are allowed.
168 conditional compilation
169 =======================
176 for "IF", all labels in "condexpr" must be defined.
177 for "IFX", any undefined label in "condexpr" turns it to 0 (false).
183 will add "val" to all data defined via:
185 and to *NUMBERS* (NOT strings) in DM, DZ, DX É DC
195 define 16-bit little-endian words
197 DEFine Reversed Words
198 =====================
200 define 16-bit big-endian words
203 DEFine repeated values
204 ======================
207 define repeated values
216 DEFine asciiZ strings
217 =====================
219 define string data, automatically adding zero byte after each one
222 DEFine high-bit-terminated string
223 =================================
225 define string data, automatically set highest bit on the last char of each one
228 DEFine byte-Counted strings
229 ===========================
231 define string data, automatically insert byte length before each one
234 known functions in expressions
235 ==============================
236 defined(xxx) -- is label "xxx" value defined?
237 known(xxx) -- is label "xxx" seen? (its value may be still undefined)
238 aligned256(xxx) -- xxx%256 == 0
239 sameseg(x0, x1) -- x0/256 == x1/256
240 align(xxx[, what]) -- align xxx by what, default what == 256
241 low(xxx) == low byte of xxx
242 high(xxx) == high byte of xxx
243 abs(xxx) == absolute value of xxx
244 bswap(xxx) -- swap bytes in 16-bit word
246 scraddr8x8(x, y, base=#4000) -- calculate screen address; coords are in chars
247 scraddr8x1(x, y, base=#4000) -- calculate screen address; x coord is char, y coord is pixel
248 scrattr8x8(x, y, base=#4000) -- calculate attribute address; coords are in chars
250 marg2str(argname) -- get macro argument name as string value; always lowercased
251 this is to use macro arguments in comparisons, like this:
252 IF marg2str(=regpair) == "hl"
255 note the '=' prefix. result of `marg2str()` will be lowercased.
257 strlen(str) == string length
260 you can use "[]" instead of "()" in math expressions.
265 start numeric literal with "0" to get octal.
266 you can end hex number with "h" instead of using prefix (but this is not recommended).
268 allowed number prefixes for hex numbers:
274 allowed number prefixes for bin numbers:
279 allowed number prefixes for octal numbers:
284 allowed number prefixes for decimal numbers:
290 two-char string literals as numbers
291 ===================================
292 two-char string literals (in single or double quotes) can be used
293 as numeric literals. the difference is:
295 "ab" -- 'a' will be in low (first) byte
296 'ab' -- 'a' will be in high (second) byte
301 you can use either "AF'" or "AFX" form for this.
306 you can separate multiple commands with colons:
311 math priorities (WARNING! NOT C!)
312 =================================
334 = (equality test, the same as '==')
337 <> (inequality test, the same as '!=')
346 logical '&&' É '||' are short-circuited.