We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS

Half-Carry Flag: Difference between revisions

From SnesLab
Jump to: navigation, search
(added bit position)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
The '''Half-carry flag''' (H) exists on the [[SPC700]], as bit 3 of the [[Program Status Word]].  It applies to the bottom 4 bits of the accumulator.
The '''Half-carry flag''' (H) is bit 3 of the [[S-SMP]]'s [[program status word]].  It applies to the bottom 4 bits of the [[accumulator]], meaning it is set whenever bit 3 of an [[ALU]] operation carries over into bit 4.  It is also set when there has not been any borrow.
 
It is cleared by [[CLRV]], but there is no [[SETV]] command to set it.
 
Whenever H is set, the [[overflow flag]] is set as well.
 
Both [[DAA]] and [[DAS]] examine the half-carry flag.


[[Category:ASM]]
[[Category:ASM]]
[[Category:SPC700]]
[[Category:SPC700]]
[[Category:Flags]]
[[Category:Flags]]
=== See Also ===
* [[Decimal Mode]]
* [[Carry Flag]]
* [[BCD]]


=== References ===
=== References ===
* https://problemkaputt.de/fullsnes.htm#snesapuspc700cpuoverview
* https://problemkaputt.de/fullsnes.htm#snesapuspc700cpuoverview
* [https://archive.org/details/SNESDevManual/book1/page/n184 Page 3-8-6 of Book I] of the official Super Nintendo development manual

Latest revision as of 19:00, 15 August 2024

The Half-carry flag (H) is bit 3 of the S-SMP's program status word. It applies to the bottom 4 bits of the accumulator, meaning it is set whenever bit 3 of an ALU operation carries over into bit 4. It is also set when there has not been any borrow.

It is cleared by CLRV, but there is no SETV command to set it.

Whenever H is set, the overflow flag is set as well.

Both DAA and DAS examine the half-carry flag.

See Also

References