I saw two diffrent way to pass integer in assmbler: the one by [eax], the second by eax.
I’ll give an example:
section .rodata
print_int_str: "%d"
%macro print_int 1
push %1
push print_int_str
call printf
add esp, 8
%endmacro
as I understood, we can use print_int eax, and also print_int [eax].
What is the difrrence between them?
will print you the value of
eaxwill use the value of
eaxas an address and will print the value that is stored at this addressso you can either put the integer into
eaxand use (any other reg will work too)or if you have a variable you can do