Assembler (8080)
The assembly language of the Intel 8080, the April 1974 microprocessor behind the Altair 8800, CP/M and Altair BASIC, whose mnemonics and register model carried over into the 8085, the Z80 and x86.
Created by Intel Corporation (8080 designed by Federico Faggin, Masatoshi Shima and Stanley Mazor)
Assembler (8080) is the assembly language of the Intel 8080, an 8-bit NMOS microprocessor that Intel released in April 1974. The 8008 before it showed that a processor on a chip could work, and the 8080 made one practical. It had a 40-pin package, a 16-bit address bus covering 64 KB of memory, a stack in external memory, and TTL-compatible signals. It powered the MITS Altair 8800, the IMSAI 8080 and the early S-100 machines, and it was the original target of CP/M. Its assembly language became one of the most widely used programming notations of the early personal computer era. Its mnemonics (MOV, MVI, LXI, DAD, JNZ, CALL, RET) and its register model can still be traced through the 8085, the Zilog Z80 and the x86 family.
History and Origins
From the 8008 to the 8080
Intel’s first 8-bit processor, the 8008 (1972), used the instruction set of the Datapoint 2200 terminal. It was slow, and its 18-pin package forced addresses and data to share pins. Federico Faggin, who had led the 4004 design and became the primary architect of the 8080, reportedly heard complaints about it from customers while giving seminars. He proposed a successor in the spring of 1972. Intel’s management did not approve the project until that autumn. In November 1972 Faggin brought Masatoshi Shima over from Japan to do the detailed logic and circuit design under his direction. Stanley Mazor also worked on the architecture.
Shima finished the layout in August 1973, production began in December, and a working NMOS prototype was ready in January 1974. Intel released the 8080 in April 1974. Its launch advertisement, in the 15 April 1974 issue of Electronic News, was headlined “From CPU to software, the 8080 Microcomputer is here.” Intel was selling a programming environment along with the chip.
Source compatibility, not binary compatibility
The 8080 cannot run 8008 binaries. The opcodes were reassigned and the assembly mnemonics were redesigned, so the 8008’s LAB became the 8080’s MOV A,B. Intel still presented the 8080 as the 8008’s successor at the source level: its September 1975 8080 Microcomputer Systems User’s Manual says programs written for the 8008 can be assembled and executed on the 8080. This idea of an assembly-level migration path came back when Intel designed the 8086.
The tools of 1974–1975
Many early 8080 programs were not assembled on 8080 hardware. Intel’s approach followed the one it had used for the 8008. Programmers wrote code on a minicomputer or a time-sharing mainframe, assembled it there, and loaded the result into an Intellec development system or burned it into PROM. Intel’s March 1975 data sheet for MAC80, the MCS-80 cross assembler, describes it this way:
- It was written in ANSI standard FORTRAN IV, for “most large scale computing systems with a 32-bit or larger integer format.”
- It accepted “all 78 instruction mnemonics plus 10 pseudo-operators.”
- It allowed up to 499 labels and up to nine levels of nested conditional assembly and macro calls.
- It produced hexadecimal output for loading into an Intellec 8/Mod 80, or BNPF output for programming ROMs.
- It was available on Tymshare (U.S., U.K., France), General Electric (U.S., Canada), Honeywell Bull (Europe, Australia), United Computing Systems (U.S.), Dentsu (Japan) and Timesharing Ltd. (U.K., Belgium).
Alongside MAC80, Intel sold INTERP/80, an 8080 instruction set simulator written in FORTRAN IV (reportedly by Gary Kildall while he was consulting for Intel), and a PL/M compiler. The language was defined in Intel’s 8080 Assembly Language Programming Manual. Its Rev. B is dated February 1975 and Rev. C January 1976. Intel’s copyright claim on the mnemonics is widely cited as the reason the Z80 got a different assembly syntax; Zilog’s 1978 data catalog states that “all mnemonics copyright Intel Corporation 1977”.
Design of the Language
Registers and register pairs
8080 assembly exposes seven 8-bit working registers, a 16-bit stack pointer and a 16-bit program counter. The manual numbers the registers 0 to 7 but lets programmers use letters for them:
| Name | Number | Pair | Typical role |
|---|---|---|---|
| B, C | 0, 1 | B (BC) | Counters, 16-bit values |
| D, E | 2, 3 | D (DE) | 16-bit values, second pointer |
| H, L | 4, 5 | H (HL) | Memory pointer (M) and 16-bit accumulator |
| M | 6 | — | The memory byte addressed by HL |
| A | 7 | PSW (A + flags) | Accumulator |
A distinctive quirk is that a register pair is named by its first register only. LXI H,1234H loads HL, PUSH B pushes BC, DAD D adds DE to HL, and PUSH PSW pushes the accumulator together with the flag byte. The flags are Sign, Zero, Auxiliary Carry, Parity and Carry.
Intel deliberately made the registers specialized rather than general-purpose. HL is the only pair that can address memory in ordinary arithmetic and move instructions, through the pseudo-register M. BC and DE can address memory only through LDAX and STAX. Much of the craft of 8080 programming is deciding which value lives in HL at each moment.
Mnemonic scheme
Intel’s 8080 mnemonics encode the addressing mode in the opcode name itself, rather than in the operand syntax:
| Operation | Register form | Immediate form | Direct-address form |
|---|---|---|---|
| Load/move 8-bit | MOV r,r | MVI r,data | LDA addr / STA addr |
| Load 16-bit | — | LXI rp,data16 | LHLD addr / SHLD addr |
| Add | ADD r | ADI data | — |
| Add with carry | ADC r | ACI data | — |
| Compare | CMP r | CPI data | — |
Conditional jumps, calls and returns work the same way: JZ, JNZ, JC, JNC, JPE, JPO, JP and JM have matching Cxx call and Rxx return forms. The result is compact and regular for anyone who knows the pattern, but there are many mnemonics to learn.
Statement syntax
The 1975 manual defines a four-field fixed format: label, code, operand and comment. Its rules include:
- Labels are optional and one to five characters long. They must start with a letter,
@or?, and must end with a colon. - Numbers take a suffix for their base:
Bfor binary,OorQfor octal,Dor none for decimal, andHfor hexadecimal. - Expressions can use
+,-,*,/,MOD,NOT,AND,OR,XOR,SHLandSHR, evaluated in a stated precedence order. - Comments begin with a semicolon.
Pseudo-instructions and macros
Even in its 1975 form, Intel’s assembly language was a macro assembler language. The Rev. B manual documents these pseudo-instructions:
ORGsets the location counter.EQUdefines a permanent symbol andSETa redefinable one.DB,DWandDSdefine bytes, words and storage.IF/ENDIFprovide conditional assembly.MACRO/ENDMdefine macros.ENDmarks the end of the source.
A whole chapter covers “Programming with Macros”, including ready-made macros for indirect loads and indexed addressing, which the 8080 lacks in hardware. DW stores the least significant byte first, and the 8080 is little-endian in all of its 16-bit operations.
Code Examples
The decimal addition routine below is the programming example printed on Intel’s March 1975 MAC80 data sheet. It adds two 16-digit packed BCD numbers two digits at a time:
| |
It shows most of the language’s character in fourteen bytes. The two operands are addressed in two different ways: LDAX D and STAX D go through DE, and ADC M goes through HL. XRA A clears the carry flag as a side effect. DAA exists for exactly this kind of BCD arithmetic.
Under CP/M, a minimal “Hello, World!” program calls BDOS function 9, which prints a $-terminated string addressed by DE:
| |
Evolution
The 8085 (1976)
Intel introduced the 8085 in March 1976. It is binary compatible with the 8080 and adds only two documented instructions: RIM (Read Interrupt Mask) and SIM (Set Interrupt Mask). Intel’s later manuals therefore describe a single “8080/8085 assembly language”; the combined manual 9800301C is dated November 1978, and revision -04 May 1981. The 8085 also has undocumented 16-bit instructions. Wolfgang Dehnhardt and Villy M. Sorensen found them while writing an 8085 assembler, and some modern assemblers support them as an option.
The Z80 and the mnemonic split (1976)
Faggin left Intel in 1974 and co-founded Zilog. Zilog’s Z80 debuted in July 1976 and runs 8080 machine code. Reportedly because Intel claimed copyright on its mnemonics, Zilog wrote a new and more systematic assembly syntax for the same opcodes. In it, MOV A,M becomes LD A,(HL), LXI H,1234H becomes LD HL,1234H, and JNZ becomes JP NZ. For the rest of the 8-bit era, CP/M software existed in two dialects that assembled to identical bytes. Some assemblers, such as the modern Macroassembler AS, accept both spellings.
| 8080 (Intel) | Z80 (Zilog) | 8086 (Intel) |
|---|---|---|
MOV A,B | LD A,B | MOV AL,CH |
MVI A,5 | LD A,5 | MOV AL,5 |
LXI H,1234H | LD HL,1234H | MOV BX,1234H |
MOV A,M | LD A,(HL) | MOV AL,[BX] |
DAD D | ADD HL,DE | ADD BX,DX |
JNZ LOOP | JP NZ,LOOP | JNZ LOOP |
The bridge to x86 (1978–1981)
According to Stanley Mazor, the 8086’s architecture was designed so its assembly language closely resembled the 8080’s, and that many 8080 instructions map directly onto 8086 ones. The 8086 register mapping follows from this: A becomes AL, HL becomes BX, BC becomes CX, and DE becomes DX. Intel shipped CONV86, an ISIS-II tool that converted 8080/8085 assembly source into 8086 source; its operating instructions are dated March 1979. Digital Research later offered XLT86, which translated CP/M-80 .ASM files into .A86 source for CP/M-86. With these tools, CP/M-80 assembly programs could be ported to the new 16-bit processor at the source level.
Resident assemblers
As floppy-disk systems spread in the late 1970s, 8080 assembly moved from time-sharing cross assemblers to the microcomputer itself. Intel’s ISIS-II development systems ran a native 8080/8085 macro assembler. CP/M included Digital Research’s ASM, and Digital Research later added MAC and the relocating RMAC.
Current Relevance
No one designs new products around the 8080 today, but its assembly language is very much alive among hobbyists and in teaching:
- Emulation and retrocomputing. Altair 8800 and IMSAI 8080 replicas and emulators, CP/M emulators, and Space Invaders emulators all run genuine 8080 code. Writing an 8080 emulator is a popular first exercise in CPU emulation, because the instruction set is small and fully documented.
- Modern cross assemblers. Maintained multi-target assemblers still support the language. For example, Alfred Arnold’s Macroassembler AS supports the 8080/8085 (with an optional
8085UNDOCmode) and has aZ80SYNTAXswitch that accepts Zilog-style operands for 8080 code. - Clones. Many companies second-sourced or cloned the 8080, including AMD (Am9080), NEC, National Semiconductor, Mitsubishi and Soviet manufacturers (KR580VM80A). Code for machines built on these clones, such as the Soviet Radio-86RK, is written in the same assembly language.
Why It Matters
8080 assembly was the first programming language of the personal computer industry. The Altair’s first BASIC, CP/M, and the first generation of commercial microcomputer software were written in it, or first targeted it. Its register conventions and mnemonic style carried into the 8085. The Z80 re-spelled the same instruction set, and Intel built the 8086 so that 8080 source code could be translated to it mechanically. That design decision is one reason x86 assembly still has an accumulator called AL, a pointer register called BX, and a JNZ instruction. For anyone studying where the modern PC’s instruction set came from, the 8080 is the direct ancestor.
Timeline
Notable Uses & Legacy
Altair BASIC (Micro-Soft / MITS)
Microsoft's first product was an 8080 assembly language BASIC interpreter for the Altair 8800. It was developed and debugged on a PDP-10 running Paul Allen's emulator before the authors ever saw an Altair. Allen wrote the paper-tape bootstrap loader in 8080 machine language on the flight to the demonstration in Albuquerque.
CP/M (Digital Research)
Gary Kildall's disk operating system was created in 1974 for 8080 machines. It shipped with ASM, an 8080 assembler, and DDT, a debugger. Each hardware vendor adapted the machine-specific BIOS layer in 8080 assembly, which let the same CP/M applications run on many different S-100 and other 8080/Z80 computers.
Intel SDK-80 System Design Kit
Intel's 1975 single-board 8080 evaluation kit came with a ROM monitor. Intel published the complete assembler listing of that monitor as an appendix to the kit's documentation, making it an early worked example of production 8080 assembly.
Space Invaders (Taito, 1978)
Tomohiro Nishikado built Space Invaders on an Intel 8080 driving a bitmap display, designing his own hardware and development tools. Because the game's program is 8080 machine code, emulating its board is a common first project for people learning 8080 assembly and CPU emulation.
Altair 8800 and IMSAI 8080 microcomputers
The front-panel hobby machines of 1975 had no built-in software. Users toggled 8080 machine code in through switches, or assembled it by hand or with cross assemblers before loading it. This made 8080 assembly the first programming language for many personal computer owners.