beautypg.com

Cpu instruction set, Ez80, Cpu assembly language programming introduction – Zilog EZ80F916 User Manual

Page 61

background image

eZ80

®

CPU

User Manual

UM007715-0415

CPU Instruction Set

52

CPU Instruction Set

eZ80

®

CPU Assembly Language Programming Introduction

eZ80

®

CPU assembly language provides a means for writing an application program

without considering the actual memory addresses or machine instruction formats. A

program written in assembly language is called a source program. Assembly language

allows the use of 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

statements. Each statement contains labels, operations, operands, and comments.
Labels are assigned to a particular instruction step in a source program. The label

identifies 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. Rather, the pseudo-ops are interpreted as directives that control or assist the

assembly process.
The source program is processed (assembled) by the assembler to obtain a machine

language program called the object code. The object code is executed by the CPU.
An example segment of an assembly language source program is detailed in the following

example.

Assembly Language Source Program Example

JP.LIL START

;Everything after the semicolon is

;a comment.

.ASSUME ADL

=

1

;A compiler directive or pseudo-op.

START:

;A label called “START”. The first

;instruction in this example causes program

;execution to jump to the point within the

;program where the JP.LIL (Jump) executes.

LD A, 3Ah

;A Load (LD) instruction with two operands.

;The accumulator register, A, is the first

;operand that indicates the destination for

;this instruction. The hexadecimal constant

;value 3Ah is the second operand signifying

;the source value for this instruction.

eZ80

®

CPU assembly language is designed to minimize the number of different opcodes

corresponding to the set of basic machine operations, in addition to providing a consistent

This manual is related to the following products: