English
Language : 

Z8F4822AR020SG Datasheet, PDF (246/323 Pages) Zilog, Inc. – High Performance 8-Bit Microcontrollers
Z8 Encore! XP® F64xx Series
Product Specification
226
Assembly Language Source Program Example
JP START
START:
LD R4, R7
LD 234H, #%01
; Everything after the semicolon is a comment.
; 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.
; 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
; is written into R4.
; Another Load (LD) instruction with two operands.
; The first operand, Extended Mode Register
; Address 234H, identifies the destination. The
; second operand, Immediate Data value 01H, is the
; source. The value 01H is written into the
; Register at address 234H.
Assembly Language Syntax
For proper instruction execution, eZ8 CPU assembly language syntax requires that the
operands be written as destination, source. After assembly, the object code usually pres-
ents the operands in the source, destination order; however, ordering is op code-depen-
dent. The following instruction examples illustrate the format of some basic assembly
instructions and the resulting object code produced by the assembler. This binary format
must be followed if you prefer manual program coding or intend to implement your own
assembler.
Example 1. If the contents of Registers 43H and 08H are added and the result is stored in
43H, the assembly syntax and resulting object code result is shown in Table 123.
Table 123. Assembly Language Syntax Example 1
Assembly Language Code
Object Code
ADD
04
43H,
08
08H (ADD dst, src)
43 (OPC src, dst)
Example 2. In general, when an instruction format requires an 8-bit register address, that
address can specify any register location in the range 0–255 or, using Escaped Mode
Addressing, a Working Register R0–R15. If the contents of Register 43H and Working
Register R8 are added and the result is stored in 43H, the assembly syntax and resulting
object code result is shown in Table 124.
PS019924-0113
PRELIMINARY
Assembly Language Syntax