Compilation of learning Notes---2.3 cs and IP

Source: Internet
Author: User

The 1,cs and IP are the two most critical levels in 8086CPU, indicating the address at which the CPU is currently reading instructions. Where CS represents the code segment register, and IP represents the instruction pointer register.

At any moment in a 8086PC machine, assuming that the content in CS is M,ip, N,8086CPU will read an instruction from the memory Mx16+n unit and execute it.

When the 8086CPU power on or reset, CS and IP is set to cs=ffffh,ip=0000h; When 8086PC is started, the CPU reads instructions from the memory ffff0h unit, and the instruction in the FFFF0H unit is the first instruction to be executed after powering up.

2, how to modify CS and IP

2.1 If we need to modify both CS and IP values, then we can use the JMP segment address: Offset address to achieve:

After the jmp 2ae3:3----------executed: CS = 2ae3h,ip=0003h,cpu will start reading instructions from 2ae33h;

Where the function of (JMP segment address: offset address) is: Modify CS with the segment address in the instruction, offset address to modify IP.

2.2 To modify the value of the IP only:

JMP Ax, before you execute: Ax = 1000h,cs=2000h,ip=0003h

After execution: ax=1000h, cs=2000h, ip=1000h

Where the function of (a valid register in JMP) is to modify the IP using the value in the Register;


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Compilation of learning Notes---2.3 cs and IP

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.