Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
673B

  1. This file describe tricks that are used throughout the code and might need
  2. explanation.
  3. or a: Equivalent to "cp 0", but results in a shorter opcode.
  4. xor a: sets A to 0 more efficiently than ld a, 0
  5. and 0xbf: Given a letter in the a-z range, changes it to its uppercase value
  6. if it's already uppercased, then it stays that way.
  7. Z if almost always used as a success indicator for routines. Set for success,
  8. Reset for failure. "xor a" (destroys A) and "cp a" (preserves A) are used to
  9. ensure Z is set. To ensure that it is reset, it's a bit more complicated and
  10. "unsetZ" routine exists for that, although that in certain circumstances,
  11. "inc a \ dec a" or "or a" can work.