Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

altering registers

altering registers

altering registers

Executing a call instruction Never alters the contents of which register
a. CS
b. IP
c. SP
d. SS

Any help would be usefull


RE: altering registers

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.

RE: altering registers

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."

RE: altering registers


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!))

RE: altering registers

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close