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