Welcome, Guest. Please login or register.

Author Topic: Assembler question2  (Read 4016 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline PiR

  • Full Member
  • ***
  • Join Date: Apr 2003
  • Posts: 148
    • Show all replies
Re: Assembler question2
« on: April 07, 2003, 03:49:51 PM »
Hi Jose

Are you still interested in these flags?
Karlos gave you pretty good explanation, but ended just before the last, final word.
So, as said above, all numbers are really HEX values. The meaning of values actually depends only on the interpretation.
$FF can mean:
255 - unsigned char
-1 - signed char

After borring analysis you can find that:
adding and substracting is done exactly the same for signed and unsigned versions.
multiply and division are diffenet for signed and unsinged, so they have different commands.

So you have the same instruction for add (and substract). But when the counter overflows?

If you meant signed interpretation - check V flag
If you meant unsigned interpretation - check C flag

It is really that easy! Isn't it wonderfull on 68k? Adding and substracting is so easy that during signle operation 68k interprets value both as signed and unsigned and adjucts both flags for signed and unsigned interpretation, just in case it is needed.

If you're interested in 68k programming, want to know when these flags are updated, when not touched check this out:
Motorola 68k Programmers Guide
(Warning: 2338 kB)

Good luck

PS: Hi Karlos. I've finally signed up. Yes, thats me.  :-)