0

Hi ,I am trying to count all characters in entered text ,putch and putint are macroses for printing int and char
What I am doing wrong
Thanks

.386
.model Flat
include Cs266.inc
.data
count DW 0FFH
.code
main:
mov BX,count
here:
getch
cmp EAX,-1
INC BX
je exit
putch EAX
jmp here
exit:
putint BX
Ret
end
2
Contributors
1
Reply
3
Views
7 Years
Discussion Span
Last Post by untio
0

Hi,
'je exit' exits from the loop when bx is equal to zero, je acts like jz. May be you want to write:
inc bx
cmp eax, -1
Because in you code 'cmp eax, -1' has no effect.
Cheers.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.