In an engineering college microprocessor lab there is a green board with a hex keypad and a row of seven-segment displays: an 8085 trainer kit. To run a program on it you do not type words. You press 2 0 0 0, then NEXT, then 3 E, NEXT, 0 5, NEXT, C 6, NEXT, 0 3, and so on, one hex byte at a time, and finally press GO. The display shows 08. That is all a program is to the chip: a row of bytes in memory, which it fetches one after another and obeys. The English-looking line MVI A,05H is for you. The processor never sees it.
So how do those bytes come to mean something? Who decides that 3E means "put the next byte in the accumulator"? And how do you write a loop with nothing but a keypad of sixteen keys? This chapter answers those questions on the 8085, the chip whose architecture you have just taken apart. Every answer in it can be checked: what does ADC do, what is the flag after CMP, how many T-states does this loop take, how do you configure an 8255 with the control word 90H.
By the end you will be able to turn a line of assembly into its bytes and read bytes back into instructions. You will know the 8085 instruction set by groups (data transfer, arithmetic, logic and rotate, branch, stack and machine control), with each instruction's size, T-states and effect on the flags, and you will write and trace four classic programs: add two numbers, sum a block, copy a block and find the largest. You will time a delay loop with a formula. And you will drive an I/O chip, the 8255, with a control word you work out yourself.
We go in seven parts. Part 1 is the language itself: bytes, mnemonics and the rules of an assembly line. Parts 2 to 5 take the instruction groups in turn. Part 6 puts them together into four programs. Part 7 connects the processor to the outside world through ports and the 8255.