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