In the part 2, we will learn about controlling program
1. Operation Code consists of 2-4 alphabets such as MOV, SJMP, etc.
2. Operand is operated; it will be the set of alphabets that notify operation that will be one set or 2 sets. If there will be 2, it will have comma (,) like A, #20H, etc.
3. Comment is explanation the meaning of codes that will be preceded by semicolon (;).
The group of commands of mnemonic code, are divided into 4 main groups,
1. Logic, such as AND,OR,XOR,NOT
2. Mathematic such as INC,DEC,ADD,SUBB,MUL,DIV
3. Control to manage working
4. Processing as Boolean
|
The table of writing command doing with data |
|
|
How to do with data |
Examples |
|
1. Directly do at memory position |
MOV A,8CH |
|
Commands |
Examples |
Meanings |
|
MOV |
MOV A,R1 |
Using for transferring data from start to terminal. |
|
ADD |
ADD |
Using for adding data that will have A on the left, if Add R1, A <—- X wrong. |
|
ANL |
ANL A,R1 |
Is to And value, then keep at the terminal. |
|
CJNE |
CJNE A,#02H,OUT |
Is to do comparison, if the value isn’t be equal, it will skip working <– such as value A isn’t be equal with 02, it will skip at the line named OUT, if to be equal, will take value at P1. |
|
OUT |
OUT |
For sending to PC Port |
|
CLR |
CLR A |
For clearing data as zero |
|
INC |
INC R1 |
Increasing value –> R1=R1+1 |
|
DEC |
DEC R1 |
Decreasing value –> R1=R1-1 |
|
JNZ |
ADD P1,A |
Skipping to other Label, if A(Accumulator) isn’t be zero |
|
ROR |
ROR |
Moving data bit to the right, 1 bit 1 time 1=0001—>1000 |
|
ROL |
ROL |
Moving data bit to the left, 1 bit 1 time 1=0001—>0010 |
|
|
|
For looping working at Address 0123 |
|
INT20 |
INT 20 |
Show output on screen. |
|
INT21 |
INT 21 |
Getting value from keyboard. |
Programming to control Card I/O 8255 port in Debug
1. Type the word, Debug at C:\ then will get – on the below line.
2. then, type a, that will get data.
3. Type Code like this,
4. Press Enter 1 time, then type P or R, you will get for running program that continuously Enter, it will have result like this,

From the method I mentioned is experiment to easily program, but writing for real using, you have to write Editor so that you can keep and edit in the next time.