as: CR16 Operand Qualifiers
1
1 9.7.1 CR16 Operand Qualifiers
1 -----------------------------
1
1 The National Semiconductor CR16 target of 'as' has a few machine
1 dependent operand qualifiers.
1
1 Operand expression type qualifier is an optional field in the
1 instruction operand, to determines the type of the expression field of
1 an operand. The '@' is required. CR16 architecture uses one of the
1 following expression qualifiers:
1
1 's'
1 - 'Specifies expression operand type as small'
1 'm'
1 - 'Specifies expression operand type as medium'
1 'l'
1 - 'Specifies expression operand type as large'
1 'c'
1 - 'Specifies the CR16 Assembler generates a relocation entry for
1 the operand, where pc has implied bit, the expression is adjusted
1 accordingly. The linker uses the relocation entry to update the
1 operand address at link time.'
1 'got/GOT'
1 - 'Specifies the CR16 Assembler generates a relocation entry for
1 the operand, offset from Global Offset Table. The linker uses this
1 relocation entry to update the operand address at link time'
1 'cgot/cGOT'
1 - 'Specifies the CompactRISC Assembler generates a relocation entry
1 for the operand, where pc has implied bit, the expression is
1 adjusted accordingly. The linker uses the relocation entry to
1 update the operand address at link time.'
1
1 CR16 target operand qualifiers and its size (in bits):
1
1 'Immediate Operand: s'
1 4 bits.
1
1 'Immediate Operand: m'
1 16 bits, for movb and movw instructions.
1
1 'Immediate Operand: m'
1 20 bits, movd instructions.
1
1 'Immediate Operand: l'
1 32 bits.
1
1 'Absolute Operand: s'
1 Illegal specifier for this operand.
1
1 'Absolute Operand: m'
1 20 bits, movd instructions.
1
1 'Displacement Operand: s'
1 8 bits.
1
1 'Displacement Operand: m'
1 16 bits.
1
1 'Displacement Operand: l'
1 24 bits.
1
1 For example:
1 1 movw $_myfun@c,r1
1
1 This loads the address of _myfun, shifted right by 1, into r1.
1
1 2 movd $_myfun@c,(r2,r1)
1
1 This loads the address of _myfun, shifted right by 1, into register-pair r2-r1.
1
1 3 _myfun_ptr:
1 .long _myfun@c
1 loadd _myfun_ptr, (r1,r0)
1 jal (r1,r0)
1
1 This .long directive, the address of _myfunc, shifted right by 1 at link time.
1
1 4 loadd _data1@GOT(r12), (r1,r0)
1
1 This loads the address of _data1, into global offset table (ie GOT) and its offset value from GOT loads into register-pair r2-r1.
1
1 5 loadd _myfunc@cGOT(r12), (r1,r0)
1
1 This loads the address of _myfun, shifted right by 1, into global offset table (ie GOT) and its offset value from GOT loads into register-pair r1-r0.
1