146
Section 3: Assembler
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual
Not for Distribution
Beta Version February 2, 2001
Radix
Prefix (asm68)
Prefix (asm68k)
Binary
%
%
Octal
@ or 0
@ or 0†
Decimal
1 – 9
0† – 9
Hexadecimal
$ or 0x or 0X
$ or 0x or 0X
† A leading zero identifies a decimal constant unless the .opt
(not OPT) directive is used in a file assembled by asm68k,
in which case, a leading zero specifies an octal constant.
The behavior switch based on the detection of the .opt
directive is provided to allow asm68k to be compatible with
code originally written for asm68.
Table 3.5: Integer Radix Specification
The size of an integer constant can be one, two, or four bytes. The value ranges
for each size are shown in Table 3.6. Values are stored using two’s complement
representation.
Bytes
Signed Range
Unsigned Range
1
L
128 – 127
0 – 255
2
L
32,768 – 32,767
0 – 65,535
4
L
2,147,483,648 – 2,147,483,647
0 – 4,294,967,295
Table 3.6: Value Ranges for Integer Constants
3.3.6.2. Character
Constants
Character constants are delimited by single quotes (
'
). Each character between
the single quotes is represented by a byte of data; therefore, byte data is limited
to a single character, word data to two, and long-word data to four. If the
maximum number of characters is not specified, the bytes in a word or long-word
constant are justified according to the assembler being used. The bytes are
right-justified within the byte group when using asm68 (or asm68 style data
directives with asm68k). For example:
.word 'a'
; produces 0061
.long 'ab'
; produces 00006162
When using asm68k, the bytes are left-justified:
DC.W 'a'
; produces 6100
DC.L 'ab'
; produces 61620000