News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

MASM Syntax help

Started by dncprogrammer, December 04, 2006, 06:24:20 PM

Previous topic - Next topic

dncprogrammer

Hey Guys, I haven't been on for a while but Im translating a program from MASM to NASM and I need to know what a few things mean:
1)The following looks like some array indexing or something.

OffNum    DW    0000, 0000            ; declared in beginning of file, no problem
.
.
later in code
.
.
MOV OffNum[1], AX                       ; what is the [1]?

2)"WhatEver      PROC       USES AX BX CX"
Does that push those registers automatically or just tell the assembler what to be prepared for?

Thanks a ton for your help!
jon

gabor

Hello!

My short answers:
1. mov Offnum[1],ax = mov [Offnum+1],ax
2. USES will be compiled into push instructions, and into pop instructions at the end

Greets, Gábor

dncprogrammer

Excellent! Thank you! I assumed the situation with "USES" since none of the procedures had initial PUSH instructions to preserve registers incoming. Thanks again!

dncprogrammer

Hey all,
Here's another one. What does this one mean?

Whatever  EQU  THIS BYTE

ToutEnMasm


dncprogrammer

I didn't find it in the MASM doc. What else ya got?

ToutEnMasm


In the masm reference guide,\masm32\HELP\MASM32.HLP
choose index,THIS
Quote
Syntax:   THIS qualifiedtype

  Description:

     Returns an operand of <qualifiedtype> with offset and segment
     values equal to the current location-counter value. THIS can be
     used with EQU or = to create labels and variables. THIS NEAR is
     equivalent to $.

     These two lines are equivalent:

       tag1     EQU      THIS BYTE
       tag1     LABEL    BYTE

     The <qualifiedtype> can be any qualified type.