The MASM Forum Archive 2004 to 2012

Project Support Forums => GoAsm Assembler and Tools => Topic started by: jneutron64 on February 16, 2006, 02:32:07 AM

Title: Type Indicator Conversion from MASM to GoASM
Post by: jneutron64 on February 16, 2006, 02:32:07 AM
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.
Title: Re: Type Indicator Conversion from MASM to GoASM
Post by: Vortex on February 16, 2006, 11:38:10 AM
Welcome on board.

Maybe this can work for you :

mov esi,OFFSET bufer
mov al,b[esi]
Title: Re: Type Indicator Conversion from MASM to GoASM
Post by: donkey on February 16, 2006, 02:13:37 PM
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]