Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > 16 bit dos debu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 19 Topic 4532 of 4824
Post > Topic >>

16 bit dos debug options?

by Pop Tart <spamtrap@[EMAIL PROTECTED] > Feb 19, 2008 at 03:34 PM

hello,

what are my options for 16-bit debugging in DOS?  I'm assembling with 
masm, linking with link16.

DEBUG program misinterprets my source, I think.  After my first int 21h 
(in the paste below), debug trace shows two NOP's then a call to 
elsewhere.

I've seen others write about Codeview debugger, but apparently I don't 
have it (cv.exe?) and can't find it for download.

Thanks, and here's the program, with a paste-in of the debug trace output 
after the first int 21h.

;===============BEGIN DEBUG OUTPUT===========================
; this below appears after 1st int 21h
00A7:107C 90 NOP
-t

AX=716C BX=0000 CX=0000 DX=0001 SP=01FA BP=0000 SI=000A DI=0000
DS=0B55 ES=0B3E SS=0C90 CS=00A7 IP=107D NV UP DI PL NZ NA PO NC
00A7:107D 90 NOP
-t

AX=716C BX=0000 CX=0000 DX=0001 SP=01FA BP=0000 SI=000A DI=0000
DS=0B55 ES=0B3E SS=0C90 CS=00A7 IP=107E NV UP DI PL NZ NA PO NC
00A7:107E E8E000 CALL 1161
-t

AX=716C BX=0000 CX=0000 DX=0001 SP=01F8 BP=0000 SI=000A DI=0000
DS=0B55 ES=0B3E SS=0C90 CS=00A7 IP=1161 NV UP DI PL NZ NA PO NC
00A7:1161 1E PUSH DS
-t
;===============END DEBUG OUTPUT========================

;==============BEGIN PROGRAM, (Kip Irvine 13.3.6)=================
TITLE Read a text file (main.asm)

...model small
...stack 200h
...386

...data
BufSize = 5000
infile BYTE "infile.txt",0
outfile BYTE "outfile.txt",0


inHandle WORD ?
outHandle WORD ?
buffer BYTE BufSize DUP(?)
bytesRead WORD ?

...code
main PROC
mov ax, @[EMAIL PROTECTED]
 ds, ax
;open the input file
mov ax, 716Ch
mov bx, 0 ;mode = read only
mov cx, 0 ;normal attribs
mov dx, 1 ;action open
mov si, offset infile
int 21h
jc Quit
mov inHandle, ax

;read the input file
mov ah, 3fh ;fn for reading
mov bx, ax ;prev handle returned in ax,
mov to bx for read
mov cx, BufSize ; bytes to read
mov dx, offset buffer ;variable that rcvs read-in
int 21h
jc Quit
mov bytesRead, ax ;bytes read from ax

; display the buffer
mov ah, 40h ;fn = write file or
device
mov bx, 1 ;console output
mov cx, bytesRead ; number of bytes
mov dx, offset buffer ;pointer
int 21h
jc Quit ; quit if error

;Close the file
mov ah, 3Eh ;fn close file
mov bx, inHandle ;input handle
int 21h
jc Quit

;Create the output file
mov ax, 716Ch ;extended create or open
mov bx, 1 ;mode = write-only
mov cx, 0 ;normal attrib
mov dx, 12h ;action:
create/truncate (10h + 2h)
mov si, offset outfile ;pointer to name
int 21h
jc Quit
mov outHandle, ax ;save handle

;Write buffer to new file ;same as to console, but to file
mov ah, 40h ;fn write file or
device
mov bx, outHandle ;handle to output file
mov cx, bytesRead ;number of bytes
mov dx, offset buffer ;pointer to buffer for writing out
int 21h
jc Quit

;Close the file
mov ah, 3Eh ;fn close file
mov bx, outHandle ;handle
int 21h
S
;terminate sequence

Quit:
mov ah, 4ch
int 21h
main EndP
END main
;===================END (KIP IRVINE PROGRAM, 13.3.6)==============

-- 
Thanks,
Pop Tart
 




 19 Posts in Topic:
16 bit dos debug options?
Pop Tart <spamtrap@[E  2008-02-19 15:34:31 
Re: 16 bit dos debug options?
Terence <spamtrap@[EM  2008-02-19 14:19:19 
Re: 16 bit dos debug options?
Jim Leonard <spamtrap  2008-02-19 14:40:38 
Re: 16 bit dos debug options?
"H. Peter Anvin"  2008-02-19 17:47:52 
Re: 16 bit dos debug options?
Frank Kotler <spamtra  2008-02-20 01:05:12 
Re: 16 bit dos debug options?
"camille@[EMAIL PROT  2008-02-24 22:50:24 
Re: 16 bit dos debug options?
Frank Kotler <spamtra  2008-02-25 11:36:52 
Re: 16 bit dos debug options?
ArarghMail802NOSPAM <s  2008-02-19 18:23:59 
Re: 16 bit dos debug options?
Brian Phillips <spamt  2008-02-19 20:09:57 
Re: 16 bit dos debug options?
Brian Phillips <spamt  2008-02-19 20:07:27 
Re: 16 bit dos debug options?
Jim Leonard <spamtrap  2008-02-20 10:10:54 
Re: 16 bit dos debug options?
Pop Tart <spamtrap@[E  2008-02-22 09:41:11 
Re: 16 bit dos debug options?
"Alexei A. Frounze&q  2008-02-20 00:58:48 
Re: 16 bit dos debug options?
Brian Phillips <spamt  2008-02-20 10:11:23 
Re: 16 bit dos debug options?
ArarghMail802NOSPAM <s  2008-02-20 20:34:52 
Re: 16 bit dos debug options?
Pop Tart <spamtrap@[E  2008-02-22 20:31:52 
Re: 16 bit dos debug options?
"Alexei A. Frounze&q  2008-02-22 14:58:51 
Re: 16 bit dos debug options?
Jim Leonard <spamtrap  2008-02-25 11:31:44 
Re: 16 bit dos debug options?
Bill <spamtrap@[EMAIL  2008-04-09 14:51:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 4:45:42 CDT 2008.