.cr 8080 To load the 8080 cross overlay .cr 8085 To load the 8085 cross overlay
We're going way back in time with the 8080 and the 8085 microprocessors.
They are the ancestors of our today's Pentium processors.
The 8080 was the brain of the MITS Altair 8800, considered to be the world's first personal computer by many.
If you take a look at the 8080's programming model you may find some striking similarities with the Pentium.
From a software point of view there is only a small difference between the 8080 and 8085.
In fact the main difference is that the 8085 has 2 extra instructions to deal with its serial input and serial output pins and interrupt system.
Apart from that the 8085 uses less cycles to complete most of its instructions, making it faster than the 8080 using the same clock speed.
Because of these small differences I describe these two processor types on the same page.
The hardware differences between the two processors are more spectacular. You'd better use a 8085 if you plan to use either of the 2 processors because it is much easier to interface with.
The infamous Altair 8800
The programming model in the picture below shows the most important registers of the 8080/8085 processor. I only include a little summary about the features of the 8080/8085's programming model here. It is not my intention to make the original documentation obsolete, so please refer to the original documentation for further details.
The Accumulator is the most important register for 8 bit arithmetic operations.
Its standard name is A, which is a reserved word.
The Accumulator and the Flag register PSW form one single 16-bit register. PUSH and POP treat the Accumulator and PSW as one pair of registers called PSW, where A is the MSB and PSW is the LSB.
The PSW contains 5 system flags:
|Bit 7||S||Sign Flag|
|Bit 6||Z||Zero Flag|
|Bit 5||0||Always 0|
|Bit 4||ACY||Auxiliary Carry Flag|
|Bit 3||0||Always 0|
|Bit 2||P||Parity Flag|
|Bit 1||1||Always 1|
|Bit 0||C||Carry Flag|
Apart from the Accumulator the 8080/8085 is equipped with 6 additional general purpose 8-bit registers. These registers can be concatenated to form three 16-bit register pairs. Especially the HL pair is used as a data pointer to transfer data to and from memory and it can be used for a limited number of 16-bit arithmetic functions.
The stack on an 8080/8085 can be located anywhere in RAM memory, pointed to by the stack pointer SP. Every time something is pushed on to the stack, the SP pointer is decremented, so the stack is growing down in memory.
Stack operations are always performed with registers pairs.
A register pair is referenced by the name of the MSB register: B, D or H.
The only exception is PSW, which in fact is the LSB register of the AF pair.
A push on the stack, whether it comes from the PUSH instruction, a subroutine call, or interrupt has the following sequence:
Naturally a POP from the stack has just the opposite effect:
The program counter PC is normally incremented after fetching each instruction or operand byte during program execution. The only way you can change this behaviour is with the jump, call and return instructions. Also interrupts can change the program counter's value.
SB-Assembler Version 3 can show you the cycle times of each instruction when the TON list flag is switched on.
The numbers presented are the number of T states the processor needs to execute the instruction.
For conditional instructions 2 times are given. The lowest values are when the condition is false, while the highest times are for when the condition is true.
The SB-Assembler 8080 and 8085 cross overlays have a few reserved words.
Reserved words are all register names.
You better avoid these reserved words when you assign your own labels.
E.g. don't call your labels PSW, or A or H.
If you do use the reserved words as label names you may expect unpredictable behaviour of the assembler sooner or later. Please note that the assembler will not warn you if you try to assign a label with a reserved name!
Reserved names can not be used in expressions, like label names can. An Undefined label error will be reported if you do try to use a reserved word in an expression because it is treated as a normal label in this case.
Here's the list of all reserved words:
A, B, C, D, E, H, L, M, SP, PSW
Originally the 8 possible restart vectors are numbered from 0 to 7 in other 8080 assemblers.
This is a little inconvenient, because you can't let the restart vector point to the appropriate vector address by using its label name.
Therefore I've added another addressing format to the RST instructions. Not only can you use the original addressing format, using a number from 0 to 7, but you can also use the appropriate vector addresses as well. The list below shows the relation between the vector address and interrupt number.
|Vector Address||Interrupt Number|
Please note that the value of the operand after an RST instruction may not be any other value than 0 to 7, $08, $10, $18, $20, $28, $30 or $38. Any other value will result in a Out of range error to be reported.
Two things are set while initializing the 8080 and 8085 overlays every time one of them is loaded by the .CR directive.
There are some differences between the SB-Assembler and other assemblers for the 8080/8085 processor. These differences require you to adapt existing source files before they can be assembled by the SB-Assembler. This is not too difficult though, and is the (small) price you have to pay for having a very universal cross assembler.