MC9RS08KA1 FREESCALE [Freescale Semiconductor, Inc], MC9RS08KA1 Datasheet - Page 62

no-image

MC9RS08KA1

Manufacturer Part Number
MC9RS08KA1
Description
RS08 Microcontrollers
Manufacturer
FREESCALE [Freescale Semiconductor, Inc]
Datasheets

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
MC9RS08KA1CDB
Quantity:
12 306
Part Number:
MC9RS08KA1CPC
Manufacturer:
FREESCALE
Quantity:
20 000
Part Number:
MC9RS08KA1CSC
Manufacturer:
TI
Quantity:
213
Part Number:
MC9RS08KA1CSC
Manufacturer:
FREESCALE
Quantity:
20 000
Part Number:
MC9RS08KA1CSC
0
Company:
Part Number:
MC9RS08KA1CSCR
Quantity:
2 439
Chapter 8 Central Processor Unit (RS08CPUV1)
in the operand field of the branch instruction; the assembler calculates the difference between the location
counter (which points at the next address after the branch instruction at the time) and the address
represented by the label or expression in the operand field. This difference is called the offset and is an
8-bit two’s complement number. The assembler stores this offset in the object code for the branch
instruction.
During execution, the CPU evaluates the condition that controls the branch. If the branch condition is true,
the CPU sign-extends the offset to a 14-bit value, adds the offset to the current PC, and uses this as the
address where it will fetch the next instruction and continue execution rather than continuing execution
with the next instruction after the branch. Because the offset is an 8-bit two’s complement value, the
destination must be within the range –128 to +127 locations from the address that follows the last byte of
object code for the branch instruction.
A common method to create a simple infinite loop is to use a branch instruction that branches to itself. This
is sometimes used to end short code segments during debug. Typically, to get out of this infinite loop, use
the debug host (through background commands) to stop the program, examine registers and memory, or
to start execution from a new location. This construct is not used in normal application programs except
in the case where the program has detected an error and wants to force the COP watchdog timer to timeout.
(The branch in the infinite loop executes repeatedly until the watchdog timer eventually causes a reset.)
8.3.3
In this addressing mode, the operand is located immediately after the opcode in the instruction stream. This
addressing mode is used when the programmer wants to use an explicit value that is known at the time the
program is written. A # (pound) symbol is used to tell the assembler to use the operand as a data value
rather than an address where the desired value should be accessed.
The size of the immediate operand is always 8 bits. The assembler automatically will truncate or extend
the operand as needed to match the size needed for the instruction. Most assemblers generate a warning if
a 16-bit operand is provided.
It is the programmer’s responsibility to use the # symbol to tell the assembler when immediate addressing
should be used. The assembler does not consider it an error to leave off the # symbol because the resulting
statement is still a valid instruction (although it may mean something different than the programmer
intended).
8.3.4
TNY addressing mode is capable of addressing only the first 16 bytes in the address map, from $0000 to
$000F. This addressing mode is available for INC, DEC, ADD, and SUB instructions. A system can be
optimized by placing the most computation-intensive data in this area of memory.
Because the 4-bit address is embedded in the opcode, only the least significant four bits of the address must
be included in the instruction; this saves program space and execution time. During execution, the CPU
adds 10 high-order 0s to the 4-bit operand address and uses the combined 14-bit address ($000x) to access
the intended operand.
62
Immediate Addressing Mode (IMM)
Tiny Addressing Mode (TNY)
MC9RS08KA2 Series Data Sheet, Rev. 3
Freescale Semiconductor

Related parts for MC9RS08KA1