Section address operator (__sectop/__secend)


This is a section address operator.

[Function]

-

The start address of section-name specified with __sectop is referenced.

-

The end address of section-name +1 specified with __sectop is referenced.

-

The return type of __sectop( ) and __secend( ) is void __far*.

-

Addition and subtraction between the value obtained by __sectop or __secend and a constant should not be used.

[Usage]

__sectop("section-name")
__secend("section-name")

[Example]

The following shows a sample C source code.

const struct {
        void __far *rom_s;
        void __far *rom_e;
} DTBL[]={__sectop("XXX"), __secend("XXX")};

 

The following shows the declarations in the assembly source code.

        .PUBLIC         _DTBL
        .SECTION        .const, CONST
        .ALIGN          2
_DTBL:
        .DB2    LOWW(STARTOF(XXX))                    ;Lower-order 2 bytes of rom_s
        .DB     LOW(HIGHW(STARTOF(XXX)))              ;Least significant byte rom_s
        .DB     0x00
        .DB2    LOWW(STARTOF(XXX)+SIZEOF(XXX))        ;Lower-order 2 bytes of rom_e
        .DB     LOW(HIGHW(STARTOF(XXX)+SIZEOF(XXX)))  ;Least significant byte rom_e
        .DB     0x00