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

Array problem

Status
Not open for further replies.

sdTech

Programmer
Oct 29, 2002
10
0
0
US
Hi

I want to display the index of the array but it just prints out crazy chareters...Please help



INCLUDE PCMAC.INC

.MODEL SMALL
.586 ;Allows pentinum instructions.
.STACK 100h
.DATA
D DB 501 DUP (1)
OutPut DB 'Cup number $'
OutPut1 DB ' has a marble.', 13, 10, '$'

.CODE


EXTRN PutDec : NEAR, GetDec : NEAR

temp PROC
_Begin
mov di, 0
mov cx, 2

Exchg: add di, cx ;increment di
not [D + di]
cmp di, 500 ;check di + cx s cup
jle Exchg
mov di, 0
inc cx
cmp cx, 501
jl Exchg

mov di, 1

Outp:
cmp [D + di], 1
je PrntO
inc di
cmp di, 500
jg Done
jmp Outp

PrntO:
_PutStr Output
mov ax, di
call PutDec
_PutStr Output1
inc di
cmp di, 500
jle Outp
Done:
_Exit 0

temp ENDP

END temp ; tell where to start execution

 
Where's the PutDec routine? "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
PutDec is the sub in util.lib...so cant view it...but i used it in other program and it worked. I also tested it again..and it worked fine...
 
How sure are you that the _Putstr macros, as well as the PutDec routine, don't trash di? "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Thanks AmKG, I solved this problem. It s not the macros or subs, but the length of the array
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top