07-16-2010, 09:05 AM
britlion Wrote:Was working for me too.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...
Boriel, I assume that XOR is used like AND and OR and NOT ?
Instead of:
Code:
IF X > 5 AND NOT (y < 10) OR NOT (X > 5) AND y < 10 THEN
...
END IF
Code:
IF X > 5 XOR y < 10 THEN
...
END IF
Britlion Wrote:How about align? I assume it moves code up to the next 256 byte block (staggeringly useful stuff, that).The syntax is ALIGN n (N an expression, mostly an integer number).
What's the syntax and working for that?
Code:
;; Aligns the code to start at 256 * n
;; (0, 256, 512, ...)
ALIGN 256
britlion Wrote:Does it just leave a blank space?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.
(Can we work out how much?)
britlion Wrote:Do we automatically get an @label to reference the point - or do we start the block after the align with one?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.
How do we work out what page it is? @label/256?