The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: megabyte on December 27, 2005, 03:15:54 PM

Title: data types
Post by: megabyte on December 27, 2005, 03:15:54 PM
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?????????
Title: Re: data types
Post by: MichaelW on December 27, 2005, 06:39:56 PM
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.

Title: Re: data types
Post by: P1 on December 28, 2005, 06:04:33 AM
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)
Title: Re: data types
Post by: megabyte on December 28, 2005, 01:10:20 PM
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