×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

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

Something wrong with my Debug code?

Something wrong with my Debug code?

Something wrong with my Debug code?

(OP)
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
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


RE: Something wrong with my Debug code?

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

RE: Something wrong with my Debug code?

(OP)
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.

RE: Something wrong with my Debug code?

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

RE: Something wrong with my Debug code?

(OP)
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

RE: Something wrong with my Debug code?

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

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