News:

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

question about org

Started by ninjarider, August 03, 2007, 03:07:14 PM

Previous topic - Next topic

ninjarider

going through the help files for masm i found that i can take and use org $+300 to add 300 bytes in a perticular section. is there any way to say that if i want a code section to be 1000 bytes to do somthing like org 1000-$. or is there anyways to do that.

MichaelW

If you had a label at the start of the section, and assuming the label was L0 and you were trying to pad the section to 1000 bytes, then you could do something like this:

org 1000+L0

And the section would be padded with nulls.
eschew obfuscation

Vortex

Generally, the ORG statement is used in .COM files to specify the offset of the first instruction :

http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/ProgrammersGuide/Chap_03.htm

BogdanOntanu



You can use the ORG directive to set the location counter in the current segment.
You can move the location counter forward or backward in the current segment.

format is : ORG "expression"

Where "expression" has to be:
- an constant
- and offset from an symbol in current segment
- and offset from the current location counter

"expression" can NOT be a forward reference symbol (a symbol not yet defined at the time of ORG)

Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro