Keil Logo Arm Logo

A166 User's Guide

SEG Assembler Operator

Arguments
SEG operand


Description

The SEG operator returns a relocatable segment number of the specified operand. The segment number is a 2-bit value for 80C166 devices or an 8-bit value for C167 devices.

The operand must be the name of a variable, section, group, special function register (SFR), or register bank. If SEG is used on system names (SFRs), the result is absolute and has a value of 0.

See Also

PAG

Example
                  1    C100    SECTION CODE
                  2    P100    PROC    NEAR
0000 E000         3            MOV     R0,#SEG SYSCON  ; R0=0
0002 E001 R       4            MOV     R1,#SEG P100    ; relocatable
0004 E022         5            MOV     R2,#SEG 22000H  ; R2=2
                  6    P100    ENDP
                  7    C100    ENDS
                  8            END

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.