The first lesson: How does a computer work? "Notes

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.