Assembly language basic instruction set
Assembly language is languages that must be learn in order to become a good programmer. This post is special for the people whose want to learn assembly language for IBM computer. Below is some of the example of instruction set.
1) MOV -->Move data
Move the value of 100 into the AX, thus AX will have 100 after the execution of the instruction set.
2) JMP -->unconditional Jump
It is use to transfer the programs to the Instruction Pointer (IP) that you want to execute. For example JMP 100 mean jump to the IP 100.
3) CMP -->Compare
Must use with others instruction like JE, JZ, JNE, JNZ. Use to compare two values.
4) JE/JZ,JNE/JNZ-->Jump if equals/zero, Jump if not equals/not zero
CMP instruction set must be first then only use this instruction set. Jump to the Certain IP that you set.
5) SHL-->Shift algebraic left
Shift bit to left.
For example:
MOV AX, 0002
SHL AX, 1; mean shift 1 bit to the left “The value of AX is 4”
SHL AX, 1; 2nd time “The value of AX will be 8”
SHL AX, 1; 3rd time “The value of AX will be 16”
First step let change the 0002 to binary --> 0000 0000 0000 0010 B
Second step, the 1st time SHL execute shift 1 bit to the left AX= 0000 0000 0000 0100 B
Third step, the 2nd time SHL execute shift 1 bit to the left AX =0000 0000 0000 1000 B
Fourth step, the 3rd time SHL execute shift 1 bit to the left AX= 0000 0000 0001 0000 B
Then change the value from binary to decimal.
Here I will just explain the basic information about the assembly language Instruction set. If you want to know more about the Assembly language I Recommended you this book:
IBM PC Assembly Language and Programming (5th Edition) Peter Abel
Comments
Post a Comment