Type Indicator Conversion from MASM to GoASM

Started by jneutron64, February 16, 2006, 02:32:07 AM

Previous topic - Next topic

jneutron64

Would anyone know how to convert a type indicator in MASM to GoASM?

In the MASM example, the data type BUFER is defined in .DATA as

.DATA
BUFER DB 1000 DUP(0)

.CODE
MOV AL, BYTE PTR BUFER[ESI]  ; I would like to convert this line to GoASM style. How is this done?

I have only seen examples where GoASM is affecting one register or one memory location, but not both at the same time. 

Let me know if you need anything more.

Thanks.

Vortex

Welcome on board.

Maybe this can work for you :

mov esi,OFFSET bufer
mov al,b[esi]

donkey

#2
You only need type indicators when the destination or source size is unclear. In the case of AL the size will always be 1 BYTE so a type indicator is not needed. In MASM you would have to have it only because it uses stricter typing, GoAsm does not use typed variables therefore you do not have to "cast" the varaible to a different type. So

mov ESI, OFFSET bufer
mov AL, [ESI]

As well as

mov al,[ESI+bufer]

is fine. However when the size is not evident you must specify it, for example...

movzx EAX,[ESI]

could be either a BYTE or WORD operand so you have to specify...

movzx EAX, B[ESI]
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable