Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

altering registers

Status
Not open for further replies.

rangerboat

Technical User
Oct 1, 2001
1
US
Executing a call instruction Never alters the contents of which register
a. CS
b. IP
c. SP
d. SS

Any help would be usefull

Thanks
rangerboat
 
The correct choice depends on whether you are using a far procedure call or a near procedure call. For a far procedure call CS and EIP (... "IP" in your list) are preserved, and in a near procedure call just EIP is preserved.

 
Hmm... I dunno... but what EXACTLY is the question??

"Which register is saved??"
"Which register is not changed??"


Anyway, to answer the second question:
All of them are changed in a Far Call
Only CS is not changed in a Near Call

SS and SP are not changed in a Far Jump
SS, SP, and CS are not changed in a Near Jump "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Greetinx!

There is instruction in 8086 assembly only, mov cs,ax, which do intersegment jump. To execute far jumps, you should use calls or jumps instruction, what uses cs-register.
To force changing systems register you can use excange values through stack. For exapmle:
push ax
pop cs

Note: cs is 16-bit register, ax - 16-bit register too, but in protected mode processor usually uses 32-bit registers such as eax et cetera.
Happy programming!))
 
The correct answer is D, The Stack Segment Register. The CS and IP Regs are obvious, as they have to be changed to execute the call (CS and IP for a far call). The SP gets changed by all calls, as the program pushes the return address on the stack. But the SP will NEVER be changed by a call instruction. Many people will get confused by the the fact that windows sets different stack segments for different Modules, by this is executed by the operating system after the call is executed, not as a part of the Call itself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top