This lesson mainly on the computer operating principle and assembly language is briefly introduced.
Von Joyman Architecture is the storage program Computer , that is, the program written in memory, by the CPU through the bus from memory to read a program, according to the contents of the program to perform specific steps.
When the CPU reads the instruction, it uses the register IP to refer to the next instruction (an EIP if it is a 32-bit system)
The register of the CPU is divided into general register, segment register, status register
Four ways of addressing:
movl%eax,%edx edx=eax Register addressing
MOVL $0x123,%edx edx=0x123 Immediate Addressing
movl 0x123,%edx edx=* (int32_t*) 0x123 Direct addressing
MOVL (%EBX),%edx edx=* (int32_t*) ebx Indirect Addressing
MOVL 4 (%EBX),%edx edx=* (int32_t*) (ebx+4) variable address
Understanding PUSHL, POPL, call 0x12345, ret commands
Note: IP registers can not be arbitrarily modified, only through call, RET and other commands to change!
The return value of the function is returned to the upper-level function by default using the EAX register store
The first lesson: How does a computer work? "Notes