Keil Logo

PTR Assembler Operator

Arguments
type <[>PTR<]> <[>:<]> operand


Description

The PTR operator specifies a type for a memory address. The type may be one of the following:

Type Description
BIT Specifies the operand addresses a BIT.
BYTE Specifies the operand addresses a BYTE.
FAR Specifies the operand address is a FAR address.
NEAR Specifies the operand address is a NEAR address.
WORD Specifies the operand addresses a WORD.

The operand may be any address expression representing a data variable or a code label. The PTR operator may be used to override the default type of the operand.

Note

  • When specifying pointer overrides, the PTR keyword is optional and may be omitted.
  • The PTR operator may not be used on section and group names or external constants (ie. extern DATAn:name).
  • The BIT PTR type may be applied only on bits—it is not possible to change the access type from some other type to a BIT type.
Example
D100   SECTION DATA
       V1   DSW 1
       V2   DSW 1

       B1   DSB 1
       B2   DSB 1
D100   ENDS

EXTRN  XPROC:NEAR

C100   SECTION CODE
       CALL  FAR PTR XPROC ; override type near by far
       MOV   RL0,BYTE PTR V2
       MOV   R15,WORD B1
       MOV   [R1],200   ; type of move unsure
       MOV   [R1],BYTE 200      ; byte move
       MOV   [R1],WORD 200      ; word move
C100   ENDS
  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.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.