Grammar Of Assembly Source; Statements - Epson S5U1C17001C Manual

Cmos 16-bit single chip microcontroller (c compiler package for s1c17 family) (ver. 3.2)
Hide thumbs Also See for S5U1C17001C:
Table of Contents

Advertisement

2.3 Grammar of Assembly Source

2.3.1

Statements

Each individual instruction or definition of an assembly source is called a statement. The basic composition of a statement is as
follows:
 Syntax pattern
1
<Mnemonic>
2
<Assembler directive>
3
<Label>:
4
;<Comment>
5
<Extended instruction>
6
<Preprocessor directive>
Example:
———————————————
; boot.s
; boot program
#define SP_INI,0x3f00
.text
.long BOOT
BOOT:
xld.a %sp,SP_INI
xcall main
jpr BOOT
The example given above is an ordinary source description method. For increased visibility, the elements composing each statement
are aligned with tabs and spaces.
 Restrictions
 Only one statement can be described in one line. A description containing more than two instructions in one line will result in
an error. However, comments may be described in the same line with an instruction or label.
;OK
Example:
BOOT:
;Error
BOOT:
 One statement cannot be described in more than one line. A statement not complete in one line will result in an error.
;OK
Example:
;Error
 The usable characters are limited to ASCII characters (alphanumeric symbols), except for use in comments. Also, the usable
symbols have certain limitations (details below).
Comments can be described using other characters than ASCII characters. When using non-ASCII characters (such as Chinese
characters) for comments, use /* · · · */ as the comment symbol.
S5U1C17001C Manual
(Rev. 1.0)
<Operands>
<Parameters>
;<Comment>
<Operands>
<Parameters>
——————————————— —
Statement
; Stack pointer value
; BOOT VECTOR
; set SP
; goto main
; infinity loop
ld %r1,%r2
ld %r0,%r1
ld %r1,%r2
ld %r0,%r1
ld %r1,%r2
ld %r1,
%r2
Seiko Epson Corporation
;<Comment>
;<Comment>
;<Comment>
;<Comment>
Syntax pattern
4
4
6
2
2
3
5
5
1
2 Source Files
2-5

Advertisement

Table of Contents
loading

Table of Contents