We’re rewarding the question askers & reputations are being recalculated! Read more.

Hot answers tagged

94

The General Advice Answer For a failure that happens so quickly (at most 89 instructions) I'd recommend simply looking at what your emulator does at each instruction and determine if did everything correctly. If the error occurs after thousands or millions of instructions then it would be more fruitful to compare it against an 8080 emulator that gets the ...


46

For the most part the Z-80 extends the 8080 instruction set. If we consider just the 8080 instructions themselves there are a few incompatibilities: Overflow flag. On the 8080 bit 2 of the flags register only reports the parity of the accumulator after an ALU operation. On the Z-80 it reports parity for logical operations and overflow for arithmetic ...


42

8086 was designed to make asm source porting from 8080 easy (not the other direction). It is not binary compatible with 8080, and not source-compatible either. 8080 is not an x86 CPU. 8080 is a more distant ancestor that had some influence on the design of 8086, but it's not the same architecture. As an analogy, all x86 CPUs are the same genus but ...


38

In the case of the Z80, the ALU is only 4 bits wide. That's no problem, since the internals of the CPU are controlled by a program internal to the processor, called the microprogram (or microcode), which is responsible for piping data around in the necessary way to execute some instruction. So if the Z80 gets an instruction like ADD HL, BC, the microprogram ...


36

How did 8 bit processors such as the Z80 and 8080 perform 16 bit arithmetic? Same way one adds multiple digit numbers on paper. One digit (-pair) at a time and iterating over all digits while incooperating any carry. With(in) a CPU the chunks are ALU sized units like 4/8/16 or 32 bit. As with paper based addition this method can be used for numbers of ...


32

Did bit one of the Intel 8080's Flags register, the bit between the carry and parity flags, get set to one on startup? TL;DR: No, as there is no flag register on the 8080. Only separate flags. The 'filler' bits (1, 3, 5) only get their values when PUSH PSW is executed. Long Read: The 8080 does not have a flag register, but like its predecessor the 8008, ...


31

The definition of "instruction" and "OP code" (aka operation code) is a bit fuzzy because it depends on how humans view the CPU. So the designers and their marketing department mostly get to pick the numbers. Operation code is the easier of the two: it is the number of different valid instruction byte sequences, excluding those parts of the instruction that ...


29

An instruction set can be considered as a Huffman coding of an idealised instruction stream. So the question is really asking which CPUs have a good balance of short encodings for common tasks to longer encodings for rare tasks. However, it is not sufficient to just look at the encoding of individual instructions because a RISC instruction generally does ...


25

I thought the i8080 had 8 16-bit IN ports and 8 16-bit OUT ports. The 8080 does not have any I/O Ports. It's a microprocessor, not a microcontroller. (Maybe the system you're playing with does have these 8+8 ports, but they are always external to the CPU) The 8080 features a 16 bit data/program address space and an 8 bit I/O i/o address space. Or in other ...


22

Space Invaders uses a simple display format where bytes are read from memory in order via an address counter, and shifted out via a shift register. Timing is controlled by discrete hardware. The video hardware has priority over the CPU. When it needs to read a byte it asserts the 8080's READY signal, giving it exclusive access to the memory bus. This can be ...


21

To supplement @PeterCordes's excellent answer, I thought it would be worth going into the details of exactly how close to source code compatible the two processors are -- for example, how easy would it be to use textual substitutions (e.g. macros) to automatically translate 8080 code to 8086 code, and what the limitations would be. The first point would be ...


20

It was very common to build CPUs out of TTL logic prior to the 4004, 8080 and the 6800. This was the standard way to build later minicomputers. Examples are the Data General NOVA, Xerox Alto and TI-990. Also, if a company needed a processor for, say, a CNC machine or a video game (Vectorbeam), it wasn't unusual for them to build a unique processor from TTL. ...


19

This document calls out some differences: http://www.msxarchive.nl/pub/msx/mirrors/hanso/datasheets/chipsz80leventhal3.pdf Z80 uses P flag for 2's complement overflow, where 8080 does not DAA instruction corrects both subtraction as well as addition on Z80, but addition only on 8080. Z80 rotate instructions clear the AC flag, but the 8080 does not. Also, ...


18

Overflow doesn't mean what you think. That flag exposes the internal ALU carry from bit 6 -> bit 7. It's needed when you are handling the most significant byte of a 2-complement number, because you can't use the carry for that purpose here: it's jumbled by the MSB sign bit. When you don't add or subtract 2-complement numbers (MSB isn't meant as sign bit but ...


18

I cannot speak about Pokémon in particular, but as a programmer for ~30 years, I'll answer thus: either laziness, incorrect assumption, or surprise. Laziness After an operation that overflows, you need to write extra code to check for the overflow, and then decide what to do about it. That's extra time, and extra work. Incorrect assumption (Often ...


18

The other answers explain it from a software perspective. Here is the hardware perspective, which may explain why it is another "address space". The 8080 has 16 pins for the address bus A0-A15, 8 pins for the data bus D0-D7, and pins DBIN and !WR to time reads and writes. The processor re-uses the data bus to output information ("processor state") about ...


17

The 8080 is not a microcontroller, but a microprocessor, so it had no special provision for LCD displays, as modern microcontroller may have, except maybe for the ability to use packed BCD numbers. It had no in-built host peripherals that would support protocols like RS232 or SPI. You don't mention what kind of LCD display your college used, so this is only ...


17

Hmm, an interesting question to be sure. It certainly would have been possible to make something like a 4004 style microprocessor from TTL chips. In fact, when Intel made their microprocessor, the first in the world, they chose not to pursue a patent for it, because they felt that there was no invention there; it was obvious for someone to go and combine the ...


16

The 8085, which came out two years after the 8080, rapidly became more popular for most applications because it required only +5 V power (as opposed to +5/-5/+12 V) and less external support circuitry. (Today there are a number of 8085 single-board computer designs available, such as glitchworks and OMEN; 8080 designs exist but seem few and far between.) ...


15

Here is an homebrew / educational computer made of LSI / MSI chips : http://www.kenbak-1.net/index.htm Designed in 1971 256 bytes of memory made of MOS shift registers.


15

What is the difference here between "Instructions" and "OP Codes"? Instruction: A directive for a certain action, like ADD, SUB or MOV as a whole. OP-Code: The Encoding of an instruction as seen by the CPU. For example, the Z80 has 1 ADD instruction and 20 ADD op-codes. In my experience, the two terms are either used interchangeably to refer to a ...


15

I'm actually not aware of any major 8080 test suites; everything I've ever found has been for the Z80 rather than its parent. That aside, I'd heavily suggest you don't discard the CP/M solutions you've found as they're usually pretty trivial to set up as test cases without any of the main substance of a CP/M environment. For example, to run the CP/M ...


13

Were there any Intel 8080 based home computers? Yes, but the number is rather small, as at the point when the idea of a home computer as we know it today (and you describe) became popular, better 'versions' of the 8080 were already available, most notably the 8085 and Z80. Importantly for low cost computer design, they did away with -5 and +12V supply, thus ...


12

The Xerox Alto A 1972 machine, officially introduced in March 1973. It had multi-chip CPU built around the 74181 IC. The 74181 represents an evolutionary step between the CPUs of the 1960s, which were constructed using discrete logic gates, and today's single-chip CPUs or microprocessors. - Wikipedia The Xerox Alto had a mouse-driven GUI (yep, a real ...


12

What you describe sounds like the PC Elevator: The PC Elevator 386 is a coprocessor-type accelerator board. The system's native CPU remains available for any programs that are sensitive to speed or timing. Software commands (Up for the faster 386 mode and Down for the slower speed) make speed selection simple. Initial startup via the Up command requires ...


12

I've found three programs which together make up quite a comprehensive test suite. 8080/8085 CPU Diagnostic, version 1.0, by Microcosm Associates Diagnostics II, version 1.2, CPU test by Supersoft Associates 8080/8085 CPU Exerciser by Ian Bartholomew and Frank Cringles The assembly of the Microcosm tests, and compiled COM programs of the other two tests ...


12

Midway's port of Western Gun, known as Gun Fight in the West is the first arcade game that used a microprocessor (the same Intel 8080 used with Space Invaders). The original Western Gun release in Japan used Taito's Transistor-Transistor Logic chip (possibly one in the 7400 chipset family, as used on many of Taito's boards). Dave Nutting made the decision to ...


12

by using CARRY flag. Bignum (its common name for any large number lib like arbitrary size integer/fixed point/floating point numbers) algorithms do the same thing (compute m*n bit operations using only n bit operations) for more info see Cant make value propagate through carry So operations like +,- are done by sequencing from LSW to MSW (where word is the ...


12

Preface: The question sounds as if you're missing a basic understanding of interfacing and communication between different chips/systems. At the core it can't be answered without a whole course in digital electronics 101. So I can only try to give some hints to understand the various concepts presented. I've come across a couple of projects that manage to ...


12

How do you compare two signed numbers in z80 assembly? Signed arithmetics - this includes compare - uses the Overflow flag (P/V) to signal any over/underflow. To decode it has to be seen in relation with the sign flag. This is a two step process: Step 1: Test for equal. If Z flag is set then V (value compared) is equal to A If Z flag is reset then Vr is ...


Only top voted, non community-wiki answers of a minimum length are eligible