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

about the debug.exe and its -a 1

Status
Not open for further replies.

maxcai

Programmer
Aug 17, 2003
5
CN
Why can't I use debug.exe in this way:
-a100
106C:0100 mov ax , ss:[100]
After my enter,it will come out with a error like below
^ Error
?

 
The program debug has only a simple assembly compiler, and it doesn't recognise the segment prefix here.
In truth I don't know how to do what you want, so I tried to find out how you could do it. I wrote the test program below and assembled it to a COM file.
Code:
assume cs:code

code segment
  org 100h
start:
  mov ax,ss:[100h]

code ends
end start
Then I debugged it...
Code:
c:\debug test.com
-g 100

AX=0000  BX=0000  CX=0004  DX=0000  SP=FFFE  BP=0000  SI=0000  DI=0000  
DS=1586  ES=1586  SS=1586  CS=1586  IP=0100   NV UP EI PL NZ NA PO NC 
1586:0100 36            SS:
1586:0101 A10001        MOV AX,[0100]        SS:0100=A136
-q
What I have learned...
1) Program is working, as SS=CS so at 100 is A1 36
2) The actual opcode values:
- SS overide prefix = 36
- MOV AX, moffs16* = A1, then 0001
These can be confirmed by a copy of pentiums opcode listing.
That probably hasn't answered your question though.
My advice to you is to use a different assembler to the in-built one in debug, and use debug only for *debugging*. :)

Adonai


 
Hang on a sec (!)
The code listing from "g 100" gives the game away!
The assembler is expecting the segment overide prefix as a separate opcode, therefore the code should be broken down into the following:
Code:
  ss:
  mov ax,[100]
Knew there was a way to do it in *debug*. :)
 
Thank you very much.
With your help.I now can figure it out.
This is the operation:
-a
106C:0100 es:
106C:0101 mov ax , [20]
106C:0104
^_^
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top