Re: itoa assembly version



Frank Kotler wrote:
The only thing I see (without testing it) is that you zero dx at the
*end* of your loop. What's dx on the *first* iteration? Possibly
different in "protected mode" - I assume you mean v86 mode - and real
mode? That's what first comes to mind... try moving it and see if it helps.
By *end* of your loop do you mean:
mov byte ptr ds:[si], dl
mov dx, 0
At the *first* iteration the dl holds the remainders. If that was
removed the divide operation will be dx:ax/bx again, I believe that's
the cause of "Divide Overflow"
If that's what you mean. But I really curious what make the program
"Divide Overflow" again?
By rmode I mean the real DOS, and by pmode I mean WinXP

What's the advantage of moving ax to cx and then testing cx for zero,
compared to just testing ax for zero?
" jcxz ok" was also a guard against the last bit of a digit, I wish I
could compare ax against zero but I haven't learn it yet.

Well, you're closing in on it. As Betov says - one time I do agree with
him - "Courage!"
Well, Thanks a lot, encouragement is really what I needed.

.



Relevant Pages

  • Re: which book to start with...?
    ... mov eax, 4 ... just installed nasm 16 bit and 32 bit bins under dosemu. ... .bss wont accept initialisations while .data will but no garantee for modification at runtime. ... Section .bss is nominally "uninitialized" data, but is in fact cleard to zero. ...
    (alt.lang.asm)
  • Re: which book to start with...?
    ... mov eax, 4 ... buffer resb 1000h ... Section .bss is nominally "uninitialized" data, but is in fact cleard to zero. ... i used nasm's one because intel's manuals are too big and detailed for me yet:) also i hate pdf files... ...
    (alt.lang.asm)
  • Re: which way is more efficient to check bit value
    ... and 128 (the offset zero is if the original number was zero). ... low order 4 bits of the 8-bit value; if it's the high order you ... xor eax, eax ... mov bl, ...
    (microsoft.public.vc.language)
  • Re: I need speed! Byte-for-byte comparing ...
    ... so we have the worst-case situation and we have to compare to the end ... xor(eax, eax); ... mov(16*1024*1024, ecx); ... mov(edx, (type dword time1)); ...
    (alt.lang.asm)
  • Re: Newbie to Forums, SIMD question
    ... Both of these converse most rapidly when x is near zero. ... mov ebx,ecx ... So far we've ignored zeros, denormals, infinities and NaNs. ... infinity or NaN, nor will it work for a negative x. ...
    (comp.lang.asm.x86)