77

From C64-Wiki
Jump to navigationJump to search

The zeropage address 77 ($4D in hexadecimal) is used by the routine in BASIC ROM that handles the three relational operators = ("equals"), < ("less than"), and > ("greater than"): These operators can be combined to form <= ("less than or equal to"), <> ("different from"), and >= ("greater than or equal to"), so when BASIC evaluates expressions including these symbols, or combinations of symbols, it uses the three least significant bits in address 77 to "flag" which of the three symbols it has encountered so far:

  • Bit 0 (weight 1) is set if the < is in the expression
  • Bit 1 (weight 2) is set if the = is in the expression
  • Bit 2 (weight 4) is set if the > is in the expression

Unfortunately, the routine clears this register in preparation for each evaluation of a term, so it is not possible from BASIC to "sneak PEEK" at the values it puts in this address...