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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i clear ax and bx?

Status
Not open for further replies.

delivery

Technical User
Nov 4, 2003
2
US
hi
as per peter nortons assembly language book for the ibm pc, i added ax to bx twice and need to subtract the same numbers twice-
-i did the subtraction once and then got lost as to what do.
when i tried to start from the begining, ax and bx had the same numbers still in them--how do i clear ax and bx?
Also, is the debug.exe in my windows mellinum edition in a p3 the same debug.exe referenced in the 1989 book that i am learning from?
thanks in advance
 
I am a little confused as to what you are trying to accomplish. If you mean clear ax and bx as in set them to 0, then you would just use the 'mov' opcode, ie:
Code:
  mov ax,0
  mov bx,0
The debug you are using would probably be an upgraded version to 'fit in' with the new OS better, but all the commands such as 'a' and 'g' are the same. You should be able to use it in the same way as described in your book.
NB: Type ? in debug to get a listing of all commands.
:)


The mind is like a parachute - it works better when open...
 
other common approaches are
xor ax, ax
sub ax, ax
Pros and cons either way. These change the flags, but something like mov eax, 0 is quite a lot of bytes of instruction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top