in MASM, you have IF,WHILE,INVOKE and etc. , which in other assemblers like NASM or TASM:
IF
=CMP
, INVOKE
= push
parameters and call
function , loops(like WHILE
) = CMP
and JMP
to LABELS
, and so on....
So I don't understand, If i'm writing IF
in MASM, it's tanslated to CMP
when I Build the program(assemble&link)? the loops are translated to CMP
and JMP
to some LABLES
? The INVOKE
is translated to push
parameters and call
the function? Basically what Im asking is, if im using IF
WHILE
INVOKE
and so on, They translated to what written here:https://en.wikipedia.org/wiki/X86_instruction_listings or they are compiled like those basic commands.
Because for example, I wrote a simple chat, and this is the socket part:
invoke socket,AF_INET,SOCK_STREAM,IPPROTO_TCP
.IF eax==INVALID_SOCKET
invoke crt_printf,offset Socketerror,offset formatMessagePRINT
WSAGetLastErrorMACRO
jmp End_Program
.else
mov [ListenSocket],eax
invoke crt_printf,offset SocketSuccess,offset formatMessagePRINT
.ENDIF
As you can see, It is look like a code that written in high level programming language. and this is not what I wanted. I want to write programs in assembly in the lowest level that can be written.
So how to write in 32 BIT Assembly in the lowest level that can be written? Do I need to write with the basic commands of 16 bit Assembly (https://en.wikipedia.org/wiki/X86_instruction_listings) and not IF WHILE INVOKE and so on..? this is the only things that I need to stop doing?
invoke
is a macro though), they will be translated into the appropriate assembly code. – Jester