WingedPanther said:
We don't just do homework. That said, what do you have so far? Guesses, precise questions, anything?
i'm sorry
i have my draft written not in english
that's why i didn't attached it
i have translated it shortly, just to show that i did try by myself and got stucked :(
Question 1
external atoi
%macro print_num 1
mov dword[NUMBER], %1
//push NUMBER
//call atoi
//pop eax
// mov dword[NUMBER], eax //what if number is too big?? The result is moved to eax automaticall?
mov eax,0X04
mov ebx,0x01
mov ecx, NUMBER
mov edx 0x020 //32 decimal bytes
int 0x80
//can’t use labels to error printing
%endmacro
Question 2
The code checks how many ones are in ebx
?? there must be a test whether we searched the whole ebx
Byte masking
Calling func?
Doing 32 times
Question 3.1
mov ax, 0x01
inc ax //assuming ax is 0
add ax, 0x01 //assuming ax is 0
or ax, 0x01 //assuming ax is 0
Question 3.2
STC
Shr
?? not good not sure the other digits are zero
Q4
?? is there any catch ?
add y, 0x05 //canot add to memory?
sub x, 0x02
inc dword[z]
//suopposed to be longer…
Q5.1
//-no- carry only in 32 bytes--// Adds cx-1 times the carry from bx*2
Adds the previous carry bit to DX cx times (doest change during calculation)
Q5.2
??
times ecx
times ecx adc Dx, 0