Assembly Language
The assembly language used by the simulator closely follows the original assembly language grammar defined in the 8080/8085 Assembly Language Progamming Manual released in 1971. Sim8085 assembler does add some improvements where the differences are small and provide convinience to the programmer. Read the chapter 2 of the manual for detailed explantion on the assembly language usage.
Syntax Summary
Source Line Format
Each line in the program should be in the following format.
Some of the lines may only have comments. Label or the Name part of the line is also optional.
Label/Name Field
Labels are always optional. An instruction label is a symbol name whose value is the location where the instruc- tion is assembled. A label may contain from one to six alphanumeric characters, but the first character must be alphabetic or the special characters ”?’ or ’@’. The label name must be terminated with a colon. A symbol used as a label can be defined only once in your program.
A name is required for the SET, EQU directives.
Operand Fields
The operand may use the following four types of information,
- Register
- Register pair
- Immediate Data
- 16-bit Address
There are multiple ways to specify these which are described below,
Hexadecimal Data
Each hexadecimal number must begin with a numeric digit (0 through 9) and must be followed by the letter H
or h
.
Decimal Data
Each decimal number may be identified by the letter D
immediately after its last digit or may
stand alone. Any number not specifically identified as hexadecimal, octal, or binary is assumed to be decimal.
Octal Data
Each octal number must be followed by the letter O
or the letter Q
.
ASCII Constant
One or more ASCII characters enclosed in single quotes define an ASCII constant. Two successive single quotes must be used to represent one single quote within an ASCII constant.
Labels Assigned Values
The SET and EQU directives can assign values to labels. In the following example,
assume that VALUE has been assigned the value 9FH; the two MVI
statements are equivalent:
Labels of Instruction or Data
The label assigned to an instruction or a data definition has as its value the address of the first byte of the instruction or data. Instructions elsewhere in the program can refer to this address by its symbolic label name.
Expressions
All of the operands discussed earlier can be combined by to form an expression. Details around expressions are discussed elsewhere.
Register Operands
Symbol | Meaning |
---|---|
A | Accumulator register |
B | Register B or register pair B and C |
C | Register C |
D | Register D or register pair D and E |
E | Register E |
H | Register H or register pair H and L |
L | Register L |
SP | Stack pointer register |
PSW | Program status word (Contents of A and status flags) |
M | Memory reference code using address in H and L |