intel-8080

How do I efficiently do signed comparisons on the 8080?

家住魔仙堡 提交于 2019-12-19 03:51:10
问题 I want to compare two 16-bit numbers and branch on the result: the equivalent of if (a<b) goto negative . I'm using an Intel 8080. The Z80 has a signed arithmetic overflow flag which can be used for this with some degree of effort. The standard code is: ld de, _left ld hl, _right ld a, e sub a, l ld a, d sbc a, h jp po, $+5 ; branch on overflow flag not set xor a, 0x80 ; flip sign bit jm negative ; actually do the test But the 8080 isn't a strict subset of the Z80, and the code above won't

What is the purpose of the reserved/undefined bit in the flag register?

為{幸葍}努か 提交于 2019-12-10 06:19:26
问题 In the flag register of Z80, 8080, 8085, and 8086 processors, what is the purpose of bits 1, 3, 5, which are documented as "reserved" or "undefined"? 回答1: These bits are unused; that is, no instruction explicitly sets them to any value. The designers decided that 5/6 flags was enough, and they just left the remaining bits of the flags register unused. They are documented as being "undefined" because it is not possible to know in advance which value will they have after any of the instructions

What is the purpose of the reserved/undefined bit in the flag register?

余生颓废 提交于 2019-12-05 12:26:21
In the flag register of Z80, 8080, 8085, and 8086 processors, what is the purpose of bits 1, 3, 5, which are documented as "reserved" or "undefined"? Konamiman These bits are unused; that is, no instruction explicitly sets them to any value. The designers decided that 5/6 flags was enough, and they just left the remaining bits of the flags register unused. They are documented as being "undefined" because it is not possible to know in advance which value will they have after any of the instructions are executed—the processor design is simpler that way, as opposed to setting them explicitly to 0

How do interrupts work on the Intel 8080?

我的未来我决定 提交于 2019-12-04 20:08:52
问题 How do interrupts work on the Intel 8080? I have searched Google and in Intel's official documentation (197X), and I've found only a little description about this. I need a detailed explanation about it, to emulate this CPU. 回答1: The 8080 has an Interrupt line (pin 14). All peripherals are wired to this pin, usually in a "wire-OR" configuration (meaning interrupt request outputs are open-collector and the interrupt pin is pulled high with a resistor). Internally, the processor has an

How do interrupts work on the Intel 8080?

时间秒杀一切 提交于 2019-12-03 12:54:09
How do interrupts work on the Intel 8080? I have searched Google and in Intel's official documentation (197X), and I've found only a little description about this. I need a detailed explanation about it, to emulate this CPU. The 8080 has an Interrupt line (pin 14). All peripherals are wired to this pin, usually in a "wire-OR" configuration (meaning interrupt request outputs are open-collector and the interrupt pin is pulled high with a resistor). Internally, the processor has an Interrupt Enable bit. Two instructions, EI and DI, set and clear this bit. The entire interrupt system is thus

How do I efficiently do signed comparisons on the 8080?

泪湿孤枕 提交于 2019-11-30 23:23:30
I want to compare two 16-bit numbers and branch on the result: the equivalent of if (a<b) goto negative . I'm using an Intel 8080. The Z80 has a signed arithmetic overflow flag which can be used for this with some degree of effort. The standard code is: ld de, _left ld hl, _right ld a, e sub a, l ld a, d sbc a, h jp po, $+5 ; branch on overflow flag not set xor a, 0x80 ; flip sign bit jm negative ; actually do the test But the 8080 isn't a strict subset of the Z80, and the code above won't work there --- on the 8080, arithmetic instructions set the P flag based on the parity of the result,