A166 User's Guide

PAG Assembler Operator

Arguments
PAG operand


Description

The PAG operator returns the relocatable page number of the specified operand. The page number is a 4-bit value for 80C166 devices or a 10-bit value for C167 devices.

The operand must be the name of a variable, section, group, special function register (SFR), or register bank. If PAG is used on system names (SFRs), the result is the absolute page number 3.

See Also

POF, SEG

Example
                  1    D100    SECTION DATA                    ; relocatable data section
0000              2      V1    DSW     1
                  3    D100    ENDS                            ; end of section
                  4
                  5    C100    SECTION CODE
                  6    P100    PROC    NEAR
0000 E6020000 R   7            MOV     DPP2,#PAG D100          ; base page of D100
0004 E6030300     8            MOV     DPP3,#PAG SYSCON        ; page of internal RAM
0008 E6F00300     9            MOV     R0,#PAG SYSCON          ; R0=3
000C E6F10000 R  10            MOV     R1,#PAG P100            ; relocatable
0010 E6F20800    11            MOV     R2,#PAG 22000H          ; R2=8
0014 E082        12            MOV     R2,#DATA4 (PAG 22000H)  ; R2=8
                 13    P100    ENDP
                 14    C100    ENDS
                 15            END