5 grammar of assembly source, 1 statements, 6 register names 4.5.7 numerical notations – Epson S5U1C63000A User Manual

Page 65

Advertising
background image

CHAPTER 4: ASSEMBLER

S5U1C63000A MANUAL

EPSON

51

(S1C63 FAMILY ASSEMBLER PACKAGE)

4.5 Grammar of Assembly Source

Assembly source files should be created on a general-purpose editor or the source editor of the work
bench. Save sources as standard text files. For the file name, a long file name supported in Windows can
be specified.

This section explains the rules and grammar involved with the creation of assembly source files.

4.5.1 Statements

Each individual instruction or definition of an assembly source is called a statement. The basic composi-
tion of a statement is as follows:

Syntax pattern

(1) Mnemonic

Operand

(;comment)

(2) Assembler pseudo-instruction

Parameter

(;comment)

(3) Label:

(;comment)

(4) ;comment

Example:

<Statement>

<Syntax Pattern>

#include

"define.h"

(2)

.set IO1, 0xfff1

(2)

; TEXT SECTION (ROM, 13bit width)

(4)

.org 0x100

(2)

NMI:

(3)

reti

(1)

nop

(1)

nop

(1)

jr

NMI

(1)

.org 0x110

(2)

BOOT:

(3)

ld

%f,0x4

(1)

ld

%a,0

(1)

ld

%a,0

(1)

ldb

%ext,0

; clear memory 0 to 3

(1)

:

:

The example given above is an ordinary source description method. For increased visibility, the elements
composing each statement are aligned with tabs and spaces.

Advertising