Forum Index | FAQ | New User | Login | Search

Make a New PostPrevious ThreadView All ThreadsNext Thread*Show in Threaded Mode


Subjectbit testing new Reply to this message
Posted byaravan72rs
Posted on07/13/06 09:46 AM



Hi all, this may be a noob question, but I just can seem to come up with a good answer. When writing an emulator, how do you test a result of a mathmatic operation to see if a half carry occurred so you can set the H flag (6809 cpu). I have looked at some source code, but the way they have checked for this is not readily apparent to me. Anyway, if anyone knows of a good way to test a result in c++ for a half carry, I would be interested in seeing it.

Thanks for the time




SubjectRe: bit testing Reply to this message
Posted bysmf
Posted on07/27/06 07:42 PM



mame does it by xor'ing the two values & the result together then anding with 16. as the half carry is 32 it then shifts the result left by 1.

smf






Previous ThreadView All ThreadsNext Thread*Show in Threaded Mode