An instruction is a statement that becomes executable when the program is assembled and compiled. The assembler translates instructions into machine language bytes and is loaded and executed by the CPU at runtime.
A directive has four components:
- Label (optional)
- Instruction mnemonic (required)
- Operands (usually required)
- Comments (optional)
The locations of different parts are arranged as follows:
[label: ] mnemonic [operands] [;comment]
Now understand each section separately, starting with the label fields.
mov transmit command mov a,b put b data into a
mov: register, data
mov: register, register
mov: register, memory unit
mov: segment register, memory unit
mov: memory unit, register
mov: memory unit, segment register
mov: segment register, register
mov: register, segment register
add summation instruction add a,b a=a+b
add: register, data
add: register, register
add: memory unit, register
add: register, memory unit
subsub subtraction instruction sub a,b a=a-b
sub: register, data
sub: register, register
sub: memory unit, register
sub: register, memory unit
jmp transfer instruction, modify CS and IP registers
jmp: Segment address: Offset address Modify CS with segment address Modify IP with offset address
jmp: register, modify the IP only using the content of the register
Summarize
The above is a detailed explanation of the assembly language instructions mov, add, sub, and jmp introduced to you by the editor. I hope it will be helpful to everyone!