The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: dncprogrammer on December 04, 2006, 06:24:20 PM

Title: MASM Syntax help
Post by: dncprogrammer on December 04, 2006, 06:24:20 PM
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
Title: Re: MASM Syntax help
Post by: gabor on December 05, 2006, 08:10:07 AM
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
Title: Re: MASM Syntax help
Post by: dncprogrammer on December 05, 2006, 02:49:48 PM
Excellent! Thank you! I assumed the situation with "USES" since none of the procedures had initial PUSH instructions to preserve registers incoming. Thanks again!
Title: Re: MASM Syntax help
Post by: dncprogrammer on December 09, 2006, 02:39:32 PM
Hey all,
Here's another one. What does this one mean?

Whatever  EQU  THIS BYTE
Title: Re: MASM Syntax help
Post by: ToutEnMasm on December 09, 2006, 03:15:10 PM

Perhaps a help file is needed ?

http://webster.cs.ucr.edu/AsmTools/MASM/index.html
(http://webster.cs.ucr.edu/AsmTools/MASM/index.html%3Cbr%20/%3E)
Title: Re: MASM Syntax help
Post by: dncprogrammer on December 09, 2006, 03:32:50 PM
I didn't find it in the MASM doc. What else ya got?
Title: Re: MASM Syntax help
Post by: ToutEnMasm on December 09, 2006, 05:00:16 PM

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.