Footnote to what return SIZE and LENGHT operators when used with labels

Started by MazeGen, January 10, 2005, 09:40:17 AM

Previous topic - Next topic

MazeGen

Quoting one old thread:

Quote from: MichaelW
[...]

For all of the API functions I tested, the program returned:


LENGTH: 00000001
SIZE: 0000FF04
TYPE: 0000FF04
OPATTR: 000003A5
   References a code label
   Is an immediate expression
   References no undefined symbols and is without error
   References an external label
   STDCALL

Press enter to exit...


Quote from: MazeGen
BTW, MichaelW, can you to explain what means the value "0000FF04", returned by TYPE? According to masm32.hlp, when the expression is code label, it should be distance, but I doubt about it, since the SIZE returns the same value.
I've found nothing about labels and TYPE in MASM programmer's guide.

Quote from: MichaelW
I have no idea what the 0000FF04 value is. [...]

I've just found it in MASM Programmer's Guide 6.1: :)

Quote from: Appendix_A.doc, page 365, line 27
Without OPTION M510, SIZE returns values of 0FF01h, 0FF02h, 0FF04h, 0FF05h, and 0FF06h for SHORT, NEAR16, NEAR32, FAR16, and FAR32 labels, respectively. LENGTH returns 1 except when used with DUP, in which case it returns the outermost count.

Not much of use, thought...

MichaelW

I think it might have been useful for DOS code, say for a macro where you needed to know the distance for a label. I can't see any use for Win32, but all knowledge is good knowledge, so thanks for taking the time to post this. :U

eschew obfuscation