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!

Something wrong with my Debug code?

Status
Not open for further replies.

MaxEd

Technical User
Jul 3, 2002
407
US
I get garbage when use it under windows 2000. I can't figure out why! Any help would be greatly appreciated. Thank you!

-------------
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
; DEBUG ROUTINE
PUSH CX ;PUSH REGISTERS IN REVERSE ORDER
PUSH AX
CALL NEWLINE
CALL NEWLINE
LEA DI,DEBUGAX ;DEBUGAX IS DEFINED IN DATA SEGMENT
MOV CX,9
CALL PUTSTRNG
MOV BH,1
POP AX
CALL PUTDEC ; PUT VALUE NEEDED IN AX
CALL NEWLINE
LEA DI,DEBUGCX ;DEBUGCX IS DEFINED IN DATA SEGMENT
MOV CX,9
CALL PUTSTRNG
MOV BH,1
POP AX
CALL PUTDEC ; PUT VALUE NEEDED IN AX
CALL NEWLINE

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;PROCEDURES TO
EXTRN CLEAR:FAR ;CLEAR SCREEN
EXTRN NEWLINE:FAR ;DISPLAY NEWLINE CHARACTER
EXTRN PAUSE:FAR ;PAUSE UNTIL KEY STROKE
EXTRN PUTDEC:FAR ;DISPLAY DECIMAL
EXTRN PUTSTRNG:FAR ;DISPLAY CHARACTER STRING
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;S T A C K S E G M E N T D E F I N I T I O N
;
STACK SEGMENT STACK
DB 256 DUP(?)
STACK ENDS
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;D A T A S E G M E N T D E F I N I T I O N
;
DATA SEGMENT
PAUSE_MSG DB ' ANY KEY CONTINUES'
DEBUGAX DB 'DEBUG-AX '
DEBUGCX DB 'DEBUG-CX '
DATA ENDS
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


 
Did you initialize ds?

What do the different external routines expect?

Do you have these routines? "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
AmKG,

I wrote this code and used MASM 6.1 (I think) to compile it. We're programming based on the Intel processor x86. I am new to assembly so I'm not sure what the external routines would expect. I thought that assmebly coding was prett standard for the Intel processor.
 
Assignment 1:
Find out what the 'CLEAR', 'NEWLINE', 'PAUSE', 'PUTDEC', and 'PUTSTRNG' need. At the very least, show their source code.

Assignment 2:
Did you, at any time, initialize the 'DS' register??? "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
I believe I did initalize it in the main moduel. The putstng and other things are part of an io.lib. I'm using masm 6.1
 
Are the Io.lib functions documented anywhere? Maybe you are violating some rule that the Io.lib functions require to run properly. "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top