Integer overflow: Difference between revisions

m
Line 2,670:
=={{header|Z80 Assembly}}==
===Zilog Z80===
The <code>P</code> flag represents overflow after an arithmetic operation, and bit parity after a bitwise or logical operation. Arithmetic operations will result in overflow if the 7F0x7F-800x80 boundary is crossed (or in the case of 16-bit math, the 0x7FFF-0x8000 boundary.) One quirk of the Z80 instruction set is that program counter relative jumps cannot be done based on overflow; only calls, returns, and jumps to fixed memory locations are allowed. In other words, the instructions <code>JR PE, label</code> and <code>JR PO, label</code> <i>do not exist.</i>
 
There are no assembler mnemonics for overflow specifically, so we must borrow the ones for parity.
1,489

edits