Newbie Still Doesn't Understand Code
#12
For any operation affection the Zero flag, number having the highest bit set (bit 7) can be considered negative.

It depends what you do with the number. Doing 255 + 1 will equal doing -1 + 1. It's $FF in both cases and the result is 0. The carry flag is set here. Doing 1 minus 2 will equal 1 but the carry will be cleared. It depends what you do with the carry (BSC, BCC).

Short story, $FF can equal minus 1.
Reply


Messages In This Thread
RE: Newbie Still Doesn't Understand Code - by dn - 09-21-2016, 12:06 PM
RE: Newbie Still Doesn't Understand Code - by madsiur - 10-06-2016, 01:44 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Dark Knight FF6 SNES vs GBA code differences? Royaken 2 2,583 11-01-2019, 07:32 PM
Last Post: Royaken
  Newbie Question - Granting Playable Character Status Immunity Turbotastic 2 3,625 04-04-2017, 07:28 PM
Last Post: Turbotastic
  Newbie Finally Figures Something Out (NOT a help request) Turbotastic 8 10,097 09-29-2016, 08:32 AM
Last Post: Tenkarider
  asm hacking: "faking" short jumps from your code (in a new bank) to old code Eggers 2 3,904 04-16-2016, 07:18 PM
Last Post: madsiur
  A newbie's question Lateblooming 12 11,275 04-08-2016, 06:08 AM
Last Post: Lateblooming
  Trying to understand subroutines Kugawattan 24 22,719 12-08-2015, 10:48 PM
Last Post: Kugawattan
  Hexadecimal code doesn't match with Invoke Battle? Kugawattan 3 3,942 12-06-2015, 06:03 PM
Last Post: Kugawattan
  Magic Control Code sleepydude 16 14,312 09-19-2015, 02:41 PM
Last Post: Tenkarider
  Sprite Armor Code Royaken 2 3,575 05-30-2015, 11:26 AM
Last Post: Catone
  How do I add magic?(newbie help) Pingurules 5 5,798 03-19-2014, 06:33 PM
Last Post: madsiur

Forum Jump:


Users browsing this thread: 1 Guest(s)