Assembly language source program example, Assembly language syntax – Zilog Z8F0130 User Manual

Page 63

Advertising
background image

eZ8

CPU Core

User Manual

UM012820-0810

eZ8

CPU Instruction Set Summary

48

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 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 places the operands in the order ‘source,
destination’, but ordering is Op Code-dependent. The following
instruction examples illustrate the format of some basic assembly
instructions and the resulting object code produced by the assembler. This

Advertising