content
1. Assembly and Machine Language
Fourth, assembly common sense and instruction set
1. Assembly and Machine Language
Assembly language is a programming language that works directly on top of hardware.
Machine language is a collection of machine instructions
Second, CPU
The CPU contains three instruction types: data transfer, arithmetic and logic operations, branch jumps
Data transfer: load (memory to register) and store (register to memory)
Arithmetic and logic operations: integer operations, floating point operations, binary logic operations
branch Jump: Conditional jump, unconditional jump
There are three kinds of buses between the CPU and the chip: address, control, data
The width of the address bus determines the maximum capacity of the memory space.
The width of the data bus determines the maximum speed of data transfer.
The width of the control bus determines the CPU's ability to control external devices.
Third, the register
1,8086CPU
This chapter takes 8086CPU as an example to introduce the usage of registers.
The 8086CPU has 14 registers, all of which are 16-bit.
4 general purpose registers: AX, BX, CX, DX
4 segment registers: CS, DS, ES, SS
6 non-segment registers: IP, SI, DI, SP, BP, PSW
2, general register
4 general-purpose registers: AX, BX, CX, DX can be split into 2 8-bit registers, AH, AL, BH, BL, CH, CL, DH, DL, the upper 8 bits and the lower 8 bits are calculated independently and cannot be carry.
AX is the accumulator, BX is the base register, CX is the counter, and DX is the data register.
3,CS、IP
cs is the code segment, ip is the instrution pointer
cs and ip indicate the address of the cpu read instruction.
After reading the command, ip is automatically incremented by 1.
4,DS、ES、SI、DI
ds is used to store the segment address of the data to be accessed
es is the additional segment register
si is the source index register
di is the destination register
5,SS、SP、BP、PSW
ss is the segment address at the top of the stack
sp is the top of the stack pointer
bp is the pointer register
psw is the program status register
Fourth, assembly common sense and instruction set
Five, the memory address
Six, transfer instructions
Seven, else