britlion wrote:Was working for me too.
Boriel, I assume that XOR is used like AND and OR and NOT ?
XOR is the LOGICAL (not bitwise) one. Works like AND, OR, NOT. It's rarely seldom used (I've only seen it implemented in XBASIC). Basically, it checks if only one of the two given conditions is true. For more than two conditions, you should use parenthesis, etc...
IF X > 5 AND NOT (y < 10) OR NOT (X > 5) AND y < 10 THEN
You can write now:
IF X > 5 XOR y < 10 THEN
Which not only is shorter to write, but also faster to run (and take less memory).
Britlion wrote:How about align? I assume it moves code up to the next 256 byte block (staggeringly useful stuff, that).
What's the syntax and working for that?
The syntax is ALIGN n (N an expression, mostly an integer number).
;; Aligns the code to start at 256 * n
;; (0, 256, 512, ...)
britlion wrote:Does it just leave a blank space?
(Can we work out how much?)
It leaves "undefined" (usually 0-filled) bytes. The amount of bytes wasted depends on your code position. It simply fills the space until your next code is aligned. This is useful for some speed up optimizations (mostly in x86 architectures). In Z80, for drawing sprites, there's a trick (apenao is using it for his sprites routine). Aligning the code in a 256 boundary (might waste up to 255 bytes!), can speed up read/write memory transfers, since every INC HL and INC DE could be replaced by INC L and INC E respectively which are some t-states faster.
britlion wrote:Do we automatically get an @label to reference the point - or do we start the block after the align with one?
How do we work out what page it is? @label/256?
Just use a label following the ALIGN N sentence. This label will be a the beginning of your aligned block. You can also use that label in numerical expressions such as MYLABEL / 256.