Part2
It's all about making and analyzign procs.
One, who didn't read HTODW.ASM topic, had better read it first,
For the rest of us let look what we've got after the work we've done:
! mov ebx, 16
mov esi, eax
xor edx,edx
.while esi != 0
mov al,
cmp al,'A'
jb figure
sub al,'a'-10
adc dl,0
shl dl,5 ;if cf set we get it bl 20h else - 0
add al,dl
jmp vodka
figure: sub al,'0'
vodka:
! movzx eax, al
mov ecx, esi
dec ecx
.while ecx > 0
! mul ebx
1. movzx inst takes 3 clocks and we can get the same result
by and eax,0Fh which is one clock
2. Multiply by 16 using the mul command - it's really something for
assembler programmer :))
Of course we shall change it to shl eax,4 even if we don't know what's it
for whatsoever :)
And will let us kill one more line:
mov ebx,16
So now the part of code looks like:
mov esi, eax
xor edx,edx
.while esi != 0
mov al,
cmp al,'A'
jb figure
sub al,'a'-10
adc dl,0
shl dl,5 ;if cf set we get it bl 20h else - 0
add al,dl
jmp vodka
figure: sub al,'0'
vodka:
and eax,0Fh
mov ecx, esi
dec ecx
.while ecx > 0
shr eax,4
..to be continued on HTODW.ASM
The Svin.