eZ8 CPU
User Manual
UM012811-0904
eZ8 CPU Instruction Set Summary
35
eZ8 CPU Instruction Set Summary
ASSEMBLY LANGUAGE PROGRAMMING INTRODUCTION
The eZ8 CPU assembly language enables writing to an application program without con-
cern about actual memory addresses or machine instruction formats. A program written in
assembly language is called a source program. Assembly language uses symbolic
addresses to identify memory locations. It also allows mnemonic codes (opcodes and
operands) to represent the instructions themselves. The opcodes identify the instruction
while the operands represent memory locations, registers, or immediate data values.
Each assembly language program consists of a series of symbolic commands, called state-
ments. Each statement contains labels, operations, operands and comments.
Labels are assigned to a particular instruction step in a source program. The label identi-
fies that step in the program as an entry point for use by other instructions.
The assembly language also includes assembler directives that supplement the machine
instruction. The assembler directives, or pseudo-ops, are not translated into a machine
instruction. The pseudo-ops are interpreted as directives that control or assist the assembly
process.
The assembler processes the source program to obtain a machine language program called
the object code. The eZ8 CPU executes the object code. An example segment of an assem-
bly language program is detailed in the following example.
Assembly Language Source Program Example
JP START
; Everything after the semicolon is a comment.
START:
; A label called “START”. The first instruction (
JP START
) in this
; example causes program execution to jump to the point within the
; program where the
START
label occurs.
LD R4, R7
; A Load (LD) instruction with two operands. The first operand,
; Working Register R4, is the destination. The second operand,
; Working Register R7, is the source. The contents of R7 are
; written into R4.
LD 234H, #%01
; Another Load (LD) instruction with two operands.
; The first operand, Extended Mode Register Address
234H
,
; identifies the destination. The second operand, Immediate Data