News:

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

data types

Started by megabyte, December 27, 2005, 03:15:54 PM

Previous topic - Next topic

megabyte

does anybody knows if NEAR and FAR are considered as seperate data types when used by themselves without PTR, since i saw in the listing that the type evaluates to CODE but i don't know what does it mean?????????

MichaelW

AFAIK NEAR and FAR are not data types, but are used to specify distance, in many different contexts. I have seen them referred to as operators when used to specify the distance for jumps, as distance attributes for the PROC and PROTO directives, and as distance modifiers or just as distance for the TYPEDEF, EXTERN, EXTERNDEF, and COMM directives. The rules are so complex and poorly defined that I frequently have to assemble and test before I'm sure that my usage is correct. Fortunately, with the FLAT model there is seldom any need to specify distance, as everything is effectively NEAR.

eschew obfuscation

P1

Back in the old days of programming, Near was a modifier of the target being within the current segment.  So no extra bytes were generated to reference it.   Far was a modifier of the target being outside the current segment.  So extra bytes were generated to reference it, within the uP's current addressing mode.

Regards,  P1  :8)

megabyte

thx again MichaelW, for answering me about bad documentation of the MASM, since i've been looking in several documents for some mysteries like using, distances without

PTR or any of the regular contexts where it comes at..............replacing text equates with regular equates since it works in some context and others it doesn't,

but the only thing that will make us sure of what are we doing as u said assemble and see the results