Hi all,
I have a problem.
The ascci codes i type with nvoke InputXYZ go to _StringX, then to _StringY
and _StringZ. I type string numbers like "111", and "222", and "333"
(see the file out1.zip)
OutputXYZ should give: "111 X + 222 Y + 333 Z",0
but invoke StdOut, offset _OutBuffer gives me: "111 X + 222 Y" and never 333 Z.
Where is the bug ?
invoke InputXYZ, addr _NumberX, addr _captionX, addr _StringX
invoke InputXYZ, addr _NumberY, addr _captionY, addr _StringY
invoke InputXYZ, addr _NumberZ, addr _captionZ, addr _StringZ
call OutputXYZ
;print offset _OutBuffer
invoke StdOut, offset _OutBuffer
OutputXYZ proc
push esi
push edi
;
cld
mov edi, offset _OutBuffer
mov esi, offset _StringX
;
_OutputXYZ1: movzx eax, byte ptr [esi]
inc esi
;
cmp al, 0
je _OutputXYZ2
;
stosb
;mov byte ptr [edi], al
;inc edi
jmp _OutputXYZ1
_OutputXYZ2: mov eax, " X "
stosd
mov byte ptr [edi], "+"
inc edi
;....................................................
mov esi, offset _StringY
;
_OutputXYZ3: movzx eax, byte ptr [esi]
inc esi
cmp al, 0
je _OutputXYZ4
;
stosb
;mov byte ptr [edi], al
;inc edi
jmp _OutputXYZ3
_OutputXYZ4: mov eax, " Y "
stosd
mov byte ptr [edi], "+"
inc edi
;.....................................................
mov esi, offset _StringZ
;
_OutputXYZ5: movzx eax, byte ptr [esi]
inc esi
;
cmp al, 0
je _OutputXYZ6
;
;mov byte ptr [edi], al
;inc edi
stosb
;##########################
; THIS IS TO TEST
;##########################
print chr$( "HERE " )
print offset _OutBuffer
print chr$(13, 10)
inkey
;##########################
jmp _OutputXYZ5
_OutputXYZ6: mov eax, " Z "
stosd
mov byte ptr [edi], 0
pop edi
pop esi
ret
OutputXYZ endp
Anyone can help me ?
Thanks
RuiLoureiro
[attachment deleted by admin]
RuiLoureiro,
You're putting a null character into _OutBuffer here:
_OutputXYZ4: mov eax, " Y "
stosd
mov byte ptr [edi], "+"
Change it to: mov eax, " Y "
:bg
Huuuuuow !
Greg,
Thank you ! I didnt see it !