U24 Hitachi 6301 6801 Assembler Text Editor Users Manual

6301/6801 ASSEMBLER TEXT EDITOR USER'S MANUAL @HITACHI When using this manual, the reader should keep the following in mind: 1. This manual may, wholly or partially, be subject to change without notice.

Index of /components/hitachi/ dataBooks

U24 Hitachi 6301 6801 Assembler Text Editor Users Manual
6301/6801 ASSEMBLER TEXT EDITOR USER'S MANUAL
@HITACHI

When using this manual, the reader should keep the following in mind:

1. This manual may, wholly or partially, be subject to change without notice.

2. All rights reserved: No one is permitted to reproduce or duplicate, in any form, the whole or part of this manual without Hitachi's permission.

3. Hitachi will not be responsible for any damage to the user that may result

from accidents or any other reasons during operation of his unit according

to-this-manual;

--------

4. This manual neither ensures the enforcement of any industrial properties or other rights, nor sanctions the enforcement right thereof.

PREFACE The 6301/6801 Assembler-Text Editor User's Manual is a detailed explanation of operational methods for the S31MIX1-R/S61MIX2-R Assembler-Text Editor. The S31MIX1-R/S61MIX2-R is used with either the 6301 Evaluation Kit (H31EVT1) or the 6801 Evaluation Kit (H61EVT2). The 6301/6801 Assembler-Text Editor programmed in HN462732 EPROMs will be mounted on the evaluation kit (H31EVT1 or H61EVT2). It has functions to edit and revise text on paper tape medium and to assemble source programs. When using the present manual, there are two others you should refer to for details on the 6301 and/or 6801 assembly languages: 0 6801 Assembly Language Manual (S61ASL1-EM), and 0 HD6301 User's Manual For details on the H31EVT1 evaluation kit monitor, see: 0 6301 Evaluation Kit User's Manual (H31EVT1-EM); and on the H61EVT2 monitor, see: 0 6801 Evaluation Kit User's Manual (H61EVT2-EM).

Table of. Contents
1. The System···························.···································· 1 1.1 System Overview ························································· 1 1.2 System Equipment Configuration ·········································· 2 1. 3 Memory Map ····················.········································· 3 1. 4 Using the System························································ 4
2. Assembler ································································· 6 2. 1 Assembler Overview···································.·················· 6 2. 2 Assembler Features ······················································ 7 2.3 Assembler Input/Output ·······························.·················· 8 2.3.1 Input to the Assembler ··············································· 8 2.3.2 Output from the Assembler ················.········..················ 18 2.4 Executing the Assembler ··.·······················.····················· 26 2. 5 Operating the Assembler ················································ 28 2. 5. 1 Operational Overview ·······.······················...··············· 28 2.5.2 Assembler Processing ·.·····························..··············· 28 2. 6 Assembler Commands ··.································.················· 29 2.6.1 lS- Executing Pass (not clearing symbol table) ···················· 30 2.6.2 lP- Executing Pass (clearing symbol table) ········.···· , ·········· 31 2.6.3 21- Executing Pass 2 (outputting assembly listing) ·.················ 31 2.6.4 2T- Executing Pass 2 (outputting object program) ····.··············· 32 2.6.5 2P- Executing Pass 2 (simultaneous output of assemblv listing and object program) .··.··············· 32 2. 6. 6 X- Return to Monitor ······················.··.····...··············· 33 2. 7 Assembler Directives ···························· , ······················ 33 2. 7. 1 END (End of Program) ················································ 34 2. 7. 2 EQU (Equate Symbol Value) ································.·········· 36 2. 7. 3 FCB (Form Constant Byte) ····························..··· , ·········· 38 2.7.4 FCC (Form Character Constant) ······································· 40 2. 7 .5 FDB (Form Double Byte Constant) ·························· , ·········· 42 2. 7. 6 NAM (Program Name) . · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ····.·········· 44 2. 7. 7 OPT (Output Option) ·······························..····· , ·········· 45 2.7.8 OPT T (Specify Assembly Language Type) ···················.·········· 48 2.7.9 OPT M (Output Object to Memory) ·..·································· 50 2.7.10 OPT 0 (Select Object Output) ·····.································ 51

2. 7.11 ORG (Origin ) ··················.·······.··························· 52 2. 7.12 PAGE (Top of Page) ..···········.···..·······················.······ 53 2. 7· 13 RMB (Reserve Memory Byte) ...······.······················..········ 54 2. 7.14 SPC (Space) ····················.··.······················..·.···.·· 55 2.8 Assembler Operational Examples ··············..·.·.····················. 55 2. 9 Assembler Error Messages ·······...····························..······. 57 2.10 Assembler Commands ····················.··.···························· 60
3. Text Editor ·····················································.········ 61 3.1 General Description of Text Editor ··········..·········.·········.····· 61 3.2 Text Editor Features .·······..·.····································.·· 61 3.3 Text Editor Input/Output ······..·····································.· 62 3.3.1 Input to the Text Editor ······························.···········.· 62 3.3.2 Output from the Text Editor ··············.·························· 63 3.4 Executing the Text Editor ········ , ·······.···· , ························· 63 3.5 Operating the Text Editor ·················.··························.· 64 3.5.1 Edit Operation Flow ·· , ···········.···················.···.·······.·· 64 3.5.2 Operational Procedures for Editing ···························.······ 66 3. 6 Text Editor Commands ······· , ··.······················ , ················· 66 3.6.1 A (text input) ············· , ·······. , ·· , ······················· , ·· , 70 3.6.2 B (moving pointer to head of buffer) ····························.·· 71 3.6.3 Cstringl$strin$2 (replacing a character string) ···················· 71 3.6.4 nD (deleting text by character units) ··.··························· 73 3.6.5 E (ending editing operations) ······.··········.···················· 74 3.6.6 F (outputting feed) ·············.·..·······.······················· 76 3.6.7 !text (inserting text) ·..·······.··.·..···········.··.······.···.·· 77 3.6.8 J (selecting output devices).,, ··. , .· , ······· , ··················.·· 78 3.6.9 nK (deleting text by line units) ···········.···············.·.·.... 79 3.6.10 nL (moving pointer by line units) ···························.····· 81 3.6.11 nM (moving pointer by character units) ··.························. 82 3.6.12 nN (repeat command execution) ············.························ 84 3.6.13 nP (outputting text) ·.····················.················..····· 85 3.6.14 Sstring (searching for a character string) ························ 88 3.6.15 nT (displaying text) ...·······..·.····.·.························· 89 3.6.16 X (ending edit operations) ········.·.···.························· 91 3.6.17 Z (moving pointer to end of input text in buffer) ···············.· 91

3.7 Serial Execution of Conunands ··········································· 92 3. 8 Text Editor Messages ··································.················· 96 3. 9 Text Editor Conunands .··························.··.··········.········· 97
Appendix A HD6301 and HD6801 Executive Instructions ·································· 98 B ASCII Code Table ·········.···················.······················· , ·· , 121 C Hexadecimal-Decimal Conversion Tables ···································· 122 D EPROM Mounting Method ···················································· 127

1. THE SYSTEM 1.1 System Overview The 6301/6801 Assembler-Text Editor is operated on either the 6301
(H31EVT1) or the 6801 (H61EVT2) evaluation kit. These two evaluation kits are highly effective tools for users designing and developing systems which use the HD6301 or HD6801. By using a console connected to either kit, the user can develop hardware or software systems with extreme efficiency. Figures 1-1 and 1-2 show the program diagrams.

6301 Monitor

6801 Monitor

6301/6801 Assembler

6301/6801 Text Editor

6301/6801 Assembler

6301/6801 Text Editor

Figure 1-1 Programs in H31EVT1

Figure 1-2 Programs in H61EVT2

The monitor program is indispensable to the evaluation kit. The user uses the program to debug hardware and/or software systems.
The 6301/6801 assembler program converts source programs, written in 6301/6801 assembly language, into object programs. Source and object programs are compatible with H68/SD series cross assemblers.
The user selects the 6301 or 6801 assembler by executing the assembler directive "OPT".

HITACHI

The 6301/6801 Text Editor is a program for editing and revising text. It is a particularly effective tool for revising and editing source programs input into the 6301 or the 6801 assembler.
1.2 System Equipment Configuration Figure 1-3 shows the equipment configuration of the 6301 evaluation kit.
The 6801 configuration is exactly the same.

6301 Evaluation Kit
H31EVT1

Console Typewriter

c==i Dedicated ~-----~ Small
ffiH§ Console
Figure 1-3 6301 Evaluation Kit Configuration
Execute the 6301/6801 Assembler-Text Editor with the console typewriter. You cannot use the small, dedicated console.
The EPROMs (HN462732) which are internal to the 6301/6801 Assembler-Text Editor will be mounted on the evaluation kit board.

2 HITACHI

1.3 Memory Map Figure 1-4 is the software system memory map of the 6301 Evaluation Kit.

Table 1-1 shows how each area is used. The chart and table also apply to the

6801 Evaluation Kit (H61EVT2).

Address (hexadecimal) $000 0
$00BO

Monitor Work Area

6301 Assembler/Text Editor Work Area

$027F

~,..

-

$6000 $7000 $9800

Monitor
Symbol Table for 6301 Assembler/ Buffer for 6301 Text Editor

$BOOO

6301 Assembler

6301 Text Editor $DEAA
6301 Assembler/Text Editor I/0 Routines
$EOOO

$E800 $ECOO

Work Area for Monitor

$FOOO

Monitor

Figure 1-4 System Software Memory Map

HITACHI 3

Table 1-1 Use of Memory Areas

No.

Address

Use

--I

(hexadecimal)

$00BO

Work area and stack for 6301 assembler and

1

f

6301 text editor.

$027F

$7000

Area for 6301 text editor buffer or 6301

2

f

assembler symbol table.

$9800

$BOOO

Storage area for 6301 assembler

3

f

$CCFF

$D6DF

Storage area for 6301 text editor

4

f

$DE8F

---·-~·

$DEAA

Storage area for I/O routines shared by the 6301

5

f

assembler and 6301 text editor

$DFFF

$E800

Work area and monitor stack

6

f

$E.6FF

$0000 f
$00AF

Monitor areas

$6000

7

f

$7000

$FOOO f
$FFFF

1.4 Using the System The flow chart in Figure 1-5 shows the procedures for using this system
to develop programs.

4 HITACHI

Source

Source Program Coding
Offline
r=====:::i©
Text Editor

Object

Assembler
RAM
Object Program

Bad

Revise

Hardware Simulation

ROM Creation

End .________,Sys tern
Developemtn
Figure 1-5 Program Development Procedure

HITACHI 5

Procedures in Figure 1-5:
(D Input text from source tape, edit and revise. Output results to
paper tape.
{%) Input source program from paper tape. Assemble and output object
program to paper tape or directly to memory. ~ Use all monitor functions and debug object program stored in memory. With these results, revise the source program again and perform hardware simulation.
2. ASSEMBLER 2.1 Assembler Overview
The 6301/6801 Assembler (from now on, simply, "the assembler") programming system enters user source programs, written in 6301 or 6801 assembly language, onto paper tape. The assembler then converts the source programs into object programs.
You can use assembler source programs as input for 6301 (S31XAS2-F) or 6801 (S61XAS1-F) cross macro assemblers incorporated in the H68/SD series. The object program can be used for monitor input. It can also be used on paper tape for the creation of a mask read-only memory (ROM).
Figure 2-1 shows the relationship between the 6301 and 6801 assembly languages. For further details, see Tables A-1 and A-2 in appendix A "HD6301 and HD6801 Executive Instructions."
Note: 6301 assembly language has 10 more execution instructions than 6801 assembly language. (Table 2-5 lists the instructions which are exclusive to the 6301).
Table 2-1 6301 and 6801 Assembly Languages
6 HITACHI

2.2 Assembler Features The assembler has the following features: (1) Source programs compatible with source programs input to 6301 and
6801 cross macro assemblers. (2) Direct output of object programs to memory. (3) Adequate directives incorporated for easy observation of the assemble
list. (4) Displayable cross reference list (see (1) in 2.3.2) for easy
observation of the assemble list. (5) Reference to symbols used in other programs. (6) Assembler directive "OPT" for switching to the 6801 assembler.
2.3 Assembler Input/Output The assembler inputs source programs from paper tape and commands entered
from the keyboard. It also outputs the assemble list and object program. Figure 2-2 diagrams assembler input/output.

Source Program Paper Tape
Keyboard

6301 /6801 Assembler

r-- --,

I

I

:object :

1Program1

I

I

L.-----.J

RAM

Object Program
Paper Tape

Figure 2-2 Assembler Input/Output

HITACHI 7

2.3.l Input to the Assembler

The assembler inputs paper tape on which source programs written in 6301

assembly language are punche'd. It inputs commands keyed in at the keyboard.

For details on the commands, see 2.6, "Assembler Commands."

(1) Source statement format

A source program is a logical sequence of source statements written in

assembly language. Each source statement is a sequence of ASCII characters

ending with a carriage return (Cl). See appendix B "ASCII Codes" to find out

which characters in the ASCII set can be used.

Each statement line consists of the four fields shown below. If a label

field begins with an asterisk ("*"), all remaining columns constitute the

comment field.

A statement can have a maximum of 72 columns.

~bel

I operation

operand

comment

statement

(Example)

*COMMENT LINE

LABEL W CMPA CSP) 11$20 crp) SPACE CODE? @

I

label operation operand

comment

statement

~ at least one blank space

(a) Label field

The label (the symbol in the label field) is a name given to each

statement so it can be easily referred to by an instruction. The label

starts at the head of the statement.

8 HITACHI

When "*" is in the field header, the statement is a comment.
Comments are output to the assemble list but are not converted into object codes.
If the header is blank, the statement has no label field, and consequently no label.
? ~:eration
(i) Label rules (a) A label symbol consists of 1 to 6 characters. (b) The allowable symbol characters (in the label field) are: 0 Alphabetics from A to Z, 0 Numerics from 0 to 9. (c) The first character in the symbol must be alphabetic. (d) A, B and X are words reserved by the assembler and cannot be used independently as labels. (e) Defining labels twice will cause an error. (f) The location counter's value of the first byte in the instruction or data storage area is assigned to the label. (g) You can assign any label to statements that have executive instructions. But, as Table 2-1 shows, certain assembler directives require a label and others must not be labeled.
HITACHI 9

Table 2-1 Assembler Directives for Label Addition

~e

Assembler Directive

Requires label

EQU

No label

END, NAM, OPT, ORG, PAGE, SPC

(h) The location counter's value cannot be assigned to the EQU directive. For further details, see the explanations for each directive. (b) Operation Field The operation field comes directly after the label field, and consists of an operation code of less than 5 characters. The two types of operation codes entered in the operation field are: (i) HD6301 or HD6801 executive instructions (from now on, simply 6301 executive instructions or 6801 executive instructions) These are operation codes shown in Appendix A's Table A-1 "6301 Executive Instructions" and Table A-2 "6801 Executive Instructions." (ii) Assembler control instructions The special operation codes recognized by the assembler. These codes will not be converted into machine language; they control assembler processing. (c) Operand field The 6301 and 6801 executive instructions determine the addressing mode in the operand field. Table 2-2 shows the operand field format and applicable addressing mode.

10 HITACHI

Table 2-2 Operand Formats

6301/6801

0_.E_erand Format

Addressing Mode

6801 or 6301
6801 or 6301

No operand <.expression)

Implied
I
Direct (1), extended or relative In selecting between direct (1)
or extended mode, the assembler, if possible, automatically selects the direct address format.

6801 or 6301

ll<expression>

Immediate

6801 or 6301

<expression>,X Index(!)

6801 or 6301

"A" or "B"

Accumulator A space may or may not be
entered between the operator and the accumulator designation. For example, "RORA" is the same as "RORt.A".

6301 only 6301 only

<value)', <expression)'*
<value), <expression>*,
x

Direct(2) Depending on the executive
instruction, <value> takes the numeric value from 0 to 7 with BCLR, BSET, BTGL or BTST and the ll<expression~* with AIM, EIM, OIM, or TIM. For example, "AIM 11$3F ,LABEL+3".
·----· Index(2) Just as with the Direct (2) format, <Value-,. takes the
numeric value from 0 to 7 or ll<expression>* depending on what the executive instruction is. For example, "BCLR 3,DISP,X".

*The values in an expression are 1 byte (Oto 255).

(d) Comment field

The comment field is the final field in a source statement.

When a program is assembled, the comment is not converted into

machine language. It appears only in the source list. The

HITACHI 11

comment explains program processing, it helps you to understand the program. Comments are also important for their role in helping to simplify debugging and maintenance.
Rules on the comment field (i) It is an optional field. (ii) Leave at least one space after the operand field, then write the comment. If there is no operand field, leave at least one space after the operation field and then write the comment. (iii) You can use any character in the ASCII code from $20(~) to $SF( ). (2) Expressions An expression is composed of symbols, numerics and arithmetic operators and it specifies the operand value of the operation code. The arithmetic operators are: (a) + addition (b) - subtraction
(c) * multiplication
(d) I division
Expressions are computed serially from left to right no matter what the arithmetic operator is.
If an expression's operational result exceeds 2-byte lengths (65535), the value becomes undefined. If neither symbol nor numeric comes directly before an arithmetic operator, the computation is made as if a 0 were there.
(example: /SYM = 0/SYM)
12 HITACHI

Figure 2-3 is an example of expression use.

00001 00002 00003

OOAA 0055

NAM

DATA!

EQU

DATA2

EQU

EXP RES $AA $55

00004

* EXAMPLE OF EXPRESSION

00007 00008 00009 00010

0000 0002 0004 0006

0011 0006 OOOD 08

FDB

8+6+3

FDB

4/2+4

FDB

5*4-7

FCB

2*2*2

00012 00013 00014 00015

0007 0009
oooc
OOOE

86 55 B7 0011 86 FF B7 0012

LDA A STA A LDA A STA A

/IDATA1-DATA2 WORKl /IDATA2*3 WORK2

00017 00018 00019

0011 0012

0001 0001

WORKl

RMB

WORK2

RMB

END

TOTAL ERRORS 00000

Figure 2-3 Example of Expression Use

(a) Numerics

Table 2-3 shows the methods for expressing numerics.

HITACHI 13

Numeric Expression Decimal Hexadecimal
Octal
Binary

Table 2-3 Expressing Numerics Display Format

Example

<numeric>
$<numeric> or <numeric>H (with the latter, the first digit must be 0 to 9)
@<numeric> or <numeric>O or <numeric>Q (only 0 to 7 can be used)
%(numeric> or <numeric:::>B (only 1 and 0 can be used)·

255
$FF ' OOFFH
@377' 3770, 377Q
%11111111, llllllllB

(b) Character constants

These constants are formed from character strings. Table 2-4 shows

the method of expressing character constants.

Table 2-4 Expressing Character Constants

No.

Format

Ex_planation

1

'C

The character following ""' will

- - be converted to 7-bit ASCII code.

2

n, character string

n characters following ",",

will be converted to ASCII

code.

3

d character string d

Character strings enclosed by

d will be converted to ASCII

code.

(c) Symbols

Symbols are strings of 1 to 6 alphanumerics beginning with an

alphabetic. The rules for symbols are:

(i) The characters A, B and X are words reserved for the

assembler and cannot be used by themselves.

14 HITACHI

(ii) "*" is the symbol for location counter. It also indicates
the address of the first byte in an instruction word which has
"*" in the operand.
(3) Addressing Modes (a) Implied and accumulator addressing modes In the HD6301 and HD6801, several operation codes have instructions
with only one byte. These instructions are either in implied or accumulator addressing mode, and when coding in assembly language, there is no need to write in their operand fields.
(b) Immediate addressing mode In the immediate addressing mode, 1 or 2 byte values can be immediately used for operands. Specify the immediate addressing mode by placing the character "II" at the beginning of the source statement's operand field. The expression after "II" takes a 1 or 2 byte value depending on the instruction. (c) Relative addressing mode The relative addressing mode is used with branching instructions. Branching is performed only when relative values from the branching instruction's first byte are -126 to +129.
(PC + 2) - 128 < D < (PC + 2) + 127 PC address of first byte of branching instruction D address of destination to which branch is made. The branch off set is actually entered into the 2nd byte of the branch machine instruction. It assigns, in 2's complementary, the difference between the branch destination address and the address directly after the branch instruction.
HITACHI 15

(d) Index addressing mode The index address is related to the index register of the
HD6301 or HD6801. When an instruction is executed, the effective address is calculated by adding the displacement in the machine instruction's 2nd byte to the 16 bit index register's present content. Since signs are not computed, negative values cannot be used in the offset.
The index addressing mode is specified by the characters ",X" usually after the operand field expression. ",X" or "X" can be expressed only when the character is "O,X". (e) Direct and extended addressing modes
With direct or extended addressing modes, use 1 byte (direct) or 2 bytes (extended) in the operand's address. In the direct addressing mode, ~perand addresses are limited to a range of 0 to 255 in memory. Direct and extended addressing modes are differentiated according to the value of the expression in the source statement's operand field. (4) 6301 and 6801 Executive Instructions Table 2-5 lists the executive instructions for the 6301 and 6801. 6301 dedicated instructions are marked with an asterisk (*).
16 HITACHI

Table 2-5 Executive Instructions (addressing mode and machine cycle)

"8
~
Ill 0.
0
~
ABA ABX ADC ADD ADDD *AIM 0 AND ASL ASLD ASR BCC *BCLR 0 BCS BEQ BGE BGT BHI BIT BLE BLS BLT BMI BNE BPL BRA BRN *BSET 0 BSR *BTGL 0 *BTST 0 BVC BVS CBA CLC CLI CLR CLV CMP COM CPX DAA DEC DES DEX *EIM 0 EOR INC

.I.l.l

uu><! <

·-"-0'

...
u

-eeIll

.I.l.l
0

-0

Ill

Ill
-c0
!
><
~

-v0 ><
Ill
--0
c

-0
·-Ill
-
-e0.

·.>.-.
-"'
aI:l:l

· · · · · · 1- 2 INS

· · · · · · 1-3 INX

· 2 3 4 4 · · JMP

· 2 3 4 4 · · JSR

· · · 3-4 4- 5 5-6 5- 6

LDA

· · 6 · 7 · · LDD

· 2 3 4 4 · · LDS

· 1-2 · 6 6 · · LDX

· · · · · · 1-3 LSR

· 1- 2 · 6 6 · · LSRD

· · · · · · 3 MUL

· · 6 · 7 · · NEG

· · · · · · 3 NOP

· · · · · · 3 *OIM

· · · · · · 3 ORA

· · · · · · 3 PSH

· · · · · · 3 PSHX

· 2 3 4 4 · · PUL

· · · · · · 3 PULX

· · · · · · 3 ROL

· · · · · · 3 ROR

· · · · · · 3 RTI

· · · · · · 3 RTS

· · · · · · 3 SBA

· · · · · · 3 SBC

· · · · · · 3 SEC

· · 6 · 7 · · SEI

· · · · · · 5- 6 SEV

· · 6 · 7 · · *SLP

· · 4 · 5 · · STA

· · · · · · 3 STD

· ·

· ·

· ·

· ·

· ·

· 3 · 1- 2

STS STX

· · · · · · 1- 2 SUB

· · · · · · 1-2 SUBD

· · · · 1-2

5- 6 5- 6

SWI

· · · · · · 1-2 TAB

· 2 3 4 4 · · TAP

· 1- 2 · 6 6 · · TBA

· · · 3-4 4-5 5- 6 5- 6

*TIM

· · · · · 2 · TPA

· 1-2 · 6 6 · · TST

· · · · · · 1-3 TSX

· ·

· ·

·
6

· ·

·
7

· 1- 3 · ·

TXS ·*-XGDX

· · 2 3 4 4

· WAI

· 1-2 · 6 6 · ·

-0
c

."..'

Ill 0.
0

xuu

~

<

!

·-"'

-0

~

- ·- Ill
§

~

0

-0 Ill -0
...c
Ill
><
~

Ill

-0

-0

>

Ill
><
Ill
--c0

·--Ill
-e0.

....
-"'
aI:l:l

· · · · · · 1-3

· · · · · · 1-3

···3 3 ··

· · 5 6 · 5- 6 ·

·2 3 4 4 ··

·3 4 5 5 ··

·3 45 5··

· · 3 4 5 5 · ·

· · 1-2

· 6 6

· · · · · · 1- 3

· · · · · · 6-10

· 1-2 · 6 6 · ·

· · · · · · 1- 2

0 ·· 6·7 ··

·2 3 4 4 ··

· 4-3 · · · · ·

· · · · · · 5-4

· 3-4 · · · · ·

· · · · · · 4- 5

· 1- 2 · 6 6 · ·

· 1-2 · 6 6 · ·

· · · · · · 10

····· 5 ·

· · · · · · 1-2

·2 344··

· ·

· ·

· ·

· ·

· ·

· 1-2 · 1-2

· · · · · · 1-2

····· 4 ·

· ·

· ·

3 4

4 5

4 5

· ·

· ·

··4 5 5 ··

··4 5 5 ··

· · ·

· · 2 3 4 4 · · 3-4 4-5 5- 6 5- 6 · · · · · 12

· · · · · · 1-2

0

· · · · · · · · · 1- 2
· ·

· ·
4
· · ·

· · · 1-2 · · · 1-2 ·5 ·· · · · 1- 2 · · 4- 6 4-6 · · · 1-3

· ·

· ·

· ·

· ·

· ·

· 1-3 2 ·

····· 9 ·

Note: Figures before "-" are the number of 6301 machine cycles, those after

are the number of 6801 machine cycles.

HITACHI 17

2.3.2 Output from the Assembler The assembler outputs the assembly listing and object program. (1) Assembly Listing There are 4 types: 0 Source statement listing 0 Error listing 0 Symbol table listing °Cross reference table listing We will now explain these listings by first looking at Figure 2-4 which
shows an entire assembly listing.
18 HITACHI

PAGE 001 MOVE

6301 ASSEMBLER 1.0

00001 00002 00003 08004 0408 80005 8400 0882 88886 8482 8082 00007 0484 0082

NAM OPT OPT QRG MOVB£G RMB MO VOST RMB SAVEX RMB

MOVE SYMBOL,XREF NOP $408
2 2 2

00009

0486

MO'v'E EQU

08010 0406 EC 80

LOO

00011 8408 FD 0400

STD

88812 0408 EC 02

LOO

00813 8480 FD 8482

STD

88814 8418 A6 84

LOA A

* 00815
00016 0412 FE 8488

LOX

08017 0415 E6 00 MOV010 LOA B

08818 0417 FF 8484

STX

00819 041A FE 8482

LOX

08028 041[) E7 80

STA B

00021 841F 08

INX

80022 8428 FF 8404

STX

80023 8423 FE 0404

LOX

00024 8426 88

INX

88025 0427 4A

DEC A

00026 0428 26 EB

BNE

00827 842A 39

RTS

00028

END

MOVBEG 0480 MO VOST 0402 MOVE

*0,X
MOVBEG 2.x MOVDST 4,X
MOVBEG e,x SA VEX MOVDST 0,X
SAVEX SAVEX

* SET PARAMETER
* * *

MOV018

8406 MOV010 0415 SA VEX

0484

MOVBEG 0408 MO VOST 0482 MOVE 0406 MOV018 0415 SAVEX 8484

00005* 80011 08806* 00013 80009* 08017* 8(1026 E-)0887* 80818

08016 00819
08022

00823

TOT Al~ ERRORS 08800

Figure 2-4 Assemblz: Listing ExamEle (entire)

HITACHI 19

(a) Source statement listing The source statement listing includes the source statements, formatted for easier reading, as well as additional information generated by the assembler. Most lines in the listing correspond directly to a source statement. The listing is output in pass 2. Figure 2-5 is an example of a source statement listing.

PAGE 881

,MOVE, CD

6S01

ASSEMBLER 1. 0

00001 80002 80083 00004 8480 80005 8480 8002 88886 0402 0882 00007 8404 0882

NAM
OPT OPT ORG MOVBr::G RMB MOVOST RMB SA VEX RMB

MOVE SYMBOL XREF $400 2 2 2

08809

8406

MOVE

08810 0406 EC 08

00011 8488 FD 8488

00812 0488 EC 82

00013 8480 FD 8482

80814 8410 A6 84

EQU
LOO STD LOO STD LOA A

*0.x
MOVBEG
2.x MO VOST 4,X

SET PARAMETER
* * * *

* 88815
08016 0412 FE 8480

LOX

08817 0415 E6 80 MOVG1G LOA G

80818 0417 FF 8484

STX

88019 841A FE 8482

LOX

80828 8410 E7 GG

STA 8

MOVBEG
0.x
SA VEX
MO VOST
0.x

88821 841F 88 88022 8428 FF 8482 80823 8423 FE 8484 08024 8426 88

INX

STX

MO VOST

LOX

SAVEX

INX

88025 0427 4A 08026 0428 26 EG 80027 042A 39

DEC A

BNE

MOV818

RTS

80828 END L.____J L_____J l__J L _ _ J l - . . - - - - - - - - - - - - - - - - - - - - -

®

@ © ®

®

Fi~ure 2-5 Source Statement Listing (examEle)

The circled numbers in Figure 2-5 are used to explain the source state-

ment listing.
<D: The program name for the assembly listing. Every time you go to a

20 HITACHI

new page in a list, the top of that page is displayed. The characters in the operand of the NAM directive, the first statement in the program, are used in the program name.
Q): Statement numbers. The assembler assigns these numbers
automatically.
Q): Addresses in memory where the object program is stored (hexadecimal
display).
G): Machine operation codes for the instructions (hexadecimal display).
~:Operand values of the instructions (hexadecimal display).
@:): Formats and outputs the source statement.
(b) Error listing A list is output of total errors occurring in pass 1 and pass 2
and of error messages for source statements which have produced errors. Figure 2-6 is an example of error listing output.

****ERROR 201

00001 8010

ORG $10

****ERROR 201 00002

NAM PGM9

00003 ****ERROR 209

* ERROR PROGRAM

00004 0010 00 0000 LOA #$55

* ****ERROR 207
00005 8013 00 8000 GSS

00006 0016 30

MUL

****ERROR 218
>(30007 0017 -c6Y2c

LOAG #300

88888

L_Error NumberENO

TOTAL ERRORS 00010 - - ----------~-------

'----Listing of Total Errors

Note: Error message and source statement where the error is located are output in pass 1.

Figure 2-6 Example of Error Listing Output

HITACHI 21

(c) Symbol table listing This listing contains all symbols (labels) appearing in the
source program, as well as the addresses or values by which those symbols were defined. The symbol values are displayed in hexadecimal.
The list will be output only if output is specified in the source program. Write the output specification as "OPT S" in the OPT directive. Figure 2-7 is an example of symbol table output.

_ MOtV_BE_G_0_ 40t_0 MOVDST 0402 MOVE 0406 MOVOlO 0415

l

Laddress or value

symbol

SAVEX 0404

Figure 2-7 Symbol Table Listing

(d) Cross reference table listing

This listing contains all symbols (labels) which appear in the

source program as well as their corresponding defined addresses or

values. It also contains the line numbers of defined or referenced

statements. For the defined statement, the symbol displays "*"

after the line number.

The listing will be output only if specified in the source

program. If output is specified during execution, line numbers of

label definitions and references prior to that point will not be

output. Specify output by writing "OPT X" in the OPT directive.

If list output is specified and there is no space in the symbol

table area for loading the cross reference table, the list won't be

output (2 bytes are required to reference one symbol).

Figure 2-8 shows an example of cross reference table output.

22 HITACHI

MOVBEG G4GG MOVOST 0402 MOVE 0406 MOVG 10 0415 SAVEX G40:L

CD

®

08085* GGG 11 80006* 00013
80009* 00017* 80026 00087* 08018

88016 00819
00823

®

08022

Symbols 2 Addresses 3 Line numbers being defined and referred to
("*" is a line number being defined.)
Figure 2-8 Cross Reference Table Listing Note: When assembling two or more programs, an excess of line numbers will be output to the cross reference table listing.
(2) Object Program Object programs are normally output to paper tape, but by executing an "OPT M" directive in the source program, you can have an object program output directly to memory.
(a) An object program output to paper tape will be in the S type format shown in Figure 2-9.

HITACHI 23

~

I

I

) Leader

I

I

~

1

5 3

S = Head of record

2

RT

RT = Record format·

3

I-

- } Byte count (length of data from address

4

to checksum)

5

6

§ s

·r-l

:<

7 ii

~

8

(1j
µ~..

-.-:t
9 '°

10

I-

ealo

i:::

I-

(1j

p::

s I-

N

en

x

~ ()

.µ
§

.uacl

0

u

I-

.aµl
:>-.
P'.l

~

- Address -
- } Data
:::~

I-

...... Checksum (1 's complement of the sum of

N

l data from byte count to checksum)

OA

OD

Delimiter of each record

0 0
I I I I I I
~

Figure 2-9 S Type Object Tape Format

24 HITACHI

Figure 2-10 is a diagram of all record formats.
© 80080000484452202020202076
@ Sll6110086448701004142484445464748494A48404D4E6D
@ S9030000FO

Frame

©RT=30 Header Record

1 Head of record 53

2 Record format 80

3

30

Byte count

4

42

30

6 Address

30

7

80

30

s
08 0000

@RT=31 Data Record
53 31 31 36 31 31 30 30

s
16 1100

®RT=39 End Record
53 39 30 33 30 30 30 30

s
03 0000

9 Data
10

84

38

46

48-+H

86

38

36

43

34

34

34

44 34

35 32

sz-R

8.________

OD

ffi 7 6 ~~~~~~~ ~_....J ~_~~~-L_;;__j~~~~(~C_hecksum)
~Checksum
6

FC (checksum)

Figure 2-10 Record Formats for S Type Objects In Figure 2-10:
CD: The first record in the object program. Content written into the
program's "NAM" directive operand is set into this record's data section. ~: This record includes machine codes. ~:The final record in the object program. The address is normally 0, but when an operand is written in the "END" directive, the operand value will be set as the start address.

HITACHI 25

(b) When "OPT M" is specified, the assembler outputs the object

directly to the user memory area during assembler execution (pass

2).

By using this function, you don't have to load the object

program into memory again after assembly terminates.

If you try to output the object to a non-packaged RAM area

while using this function, the assembler will display error number

218. The object program will not then be output to memory, but to

paper tape. Figure 2-11 shows the general concept of object output.

System Memory Area

User Memory Area

Assembler

k:.1 User Program

Text Editor

Figure 2-11 "OPT M's" Object Program Output

2.4 Executing the Assembler

Since the assembler is stored in the evaluation kit EPROM, turn on the

power supply and key in as shown in Figure 2-12. The assembler then enters

command request status.

/A@ 6301 ASSEMBLER

The user keys in the underlined section (as with all subsequent procedures)

Figure 2-12 Assembler Execution

26 HITACHI

Key to Figure 2-12:
CD : Key in monitor command for assembler execution.
Cf): Display assembler title. Version and revision numbers are entered in
the spaces marked v and r.
<1): Assembler enters command request status.
HITACHI 27

2.5 Operating the Assembler 2.5.1 Operational Overview
Figure 2-13 outlines the operations of program assembly. Code the source program first. Then, punch it onto paper tape at the console. When performin~ punch operations, the console must be off-line (LOCAL). Program Sheet
Memory (EPROM)

Assembler

Text Editor

1--~~~--------,--------1
11001010 11110000 Memory (RAM)

Object Program Assembly

Figure 2-13 Assembler Operation

List

Use an assembler command to input paper tape created during off line

operations or paper tape edited and corrected by text editor. Then, assemble

and output the assembly listing or object tape to an output device.

2.5.2 Assembler Processing The assembler inputs the source program twice. Figure 2-14 shows the
flow for each pass.

28 HITACHI

Source Program ------------
pass 1 pas s 2 -------

Assembler

--------~-----
' I ' I
I

I

I

_!_

I

I

Object Progranj

Object Program

Figure 2-14 Flow ci Assembly

The source program is checked for errors at each statement in pass 1. Every time an error occurs, an error message applicable. to that statement is displayed. The symbol table is also created during pass 1.
In pass 2, the source program is read in and the assembly listing or object program is output in line with the specification. Pass 1 execution must end before pass 2 execution starts. Always process pass 1 first.
Each pass is specified by command. When a pass ends, the assembler again enters command request status. But, a word of caution: An END directive must be assigned to end a source program, otherwise the pass will not be considered ended and the assembler will not enter command request status.

2.6 Assembler Commands This section explains the specifics of assembler commands using the table
format shown. Figure 2-15 is the format for explaining commands.

HITACHI 29

,/".~~-----------~command: The key word that executes

ltttf'

the command.

I 11 I( I II Command

Command Name('=---- Command name: The title of the

Function

:::::::::e F:::::. explanation .

___,!~Explanation: How to use ._E_x_p_l_a_n_a_t_i_o_n_I_'_______

command. the

r=r-mportant PointsjJ

-'=~~----Important Points: Describes what to watch out for when using this
command.

Figure 2-15 Understanding the Assembler Command Table

I2.6. l

is\ -··--=--i Executing Pass 1 (not clearing symbol table)

-~=-:-

1~c~__=oJJ (1) Executes pass~..:.=~~.~~~~~~~-~~-~-~---~

~~"ia_n_at10ii) (1) Check syntax. If there is an error, the error message and

statement producing the error will be displayed and the symbol

table will be cataloged.

(2) Because pass 1 is executed with the symbol table on hold,

several programs can simultaneously cross reference the same

symbols.

(3) After setting the source tape in the input unit, key in

"lS 11 ·
j,...,.---·--------··-------------·-----···--· ·---------------··----------'

30 HITACHI

..._2_._6_._2~~~-1_.tj Executing Pass 1 (clearing symbol table)

IJ Function

(1) Clears symbol table and executes pass 1.

(1) Check syntax. If there is an error, the error message and statement causing the error will be displayed and the symbol table will be cataloged. (2) Clear symbol table. (3) Set the source tape in the input unit and key in "lP".

I 2LI Executi~~ Pass 2 (outputting assembly listing)

!Function IJ
IExp lana_t~
mportant

(1) Executes pass 2 and outputs assembly listing
(1) After pass 1 ends, set source program in input unit again and key in "2L". (2) Assembly listing is output while the source program is being read. (3) If there is an error, an error message will be displayed at the applicable position in the list. (4) The total number of errors in pass 1 and pass 2 will be displayed at the end of the a~__s_e_m_b_l~y,__l_i_·s_t_i_·n~g"--.~~~~~~~~__.
(1) The object program will be output only when option M is specified.

HITACHI 31

I2.6.4

2rJ{Executing Pass 2 (outputting object program)

IJ J Function I io1 r r
Exp lana t

(I) Executes pass 2 and outputs object program.
(I) After pass 1 ends, set the source program in the input unit again and key in "2T".

(2) The object program is output while the source program is

being read.

(3) Since errors are checked, error messages will be punched on

paper tape, but this presents no problem since these messages

will be ignored when the monitor inputs the object program.

(4) When the object is output to paper tape, a leader will be

output at the beginning of the object tape and a trailer at the

end. After the trailer is output, the total number of errors

I [Tmportantl
Points

in pass 1 and pass 2 will be output. (1) No output of assembly listing.

l__2_._6_._s~~~2.P...I_.

LE_x_e~cu~t-in _

_g__P_a__s_s _ _z__<_os_bi_mju_e_lc_tt_a_np_re_oo_gur_sa_m_o_)u_t_p_u_t_ _o_f_ _a_s_s_e_m_b_l_y_ _l_i_s_t_i_n_g_ _a_n_d_ _.....

IFunction J (1) Executes pass 2, simultaneously outputs assembly listing

and object program.

ExplanationJI (1) After pass 1 ends, set the source program in the input unit again and key in "2P". (2) The assembly listing and object program will be output at the same time as the source program is being read. (3) The assembly listing will be punched on to object tape depending on what the output device type is, but this will present no problem since the monitor ignores the assembly listing when the object program is input.

32 HITACHI

, 2.6.6
I Function

xi !Return to Monitor
r (1) Returns control from the assembler to the monitor and
places the monitor in command request status.

( Exp lanat io1

(1) After the end of assembly, key in the X command and return control to the monitor.

2.7 Assembler Directives This section explains the directives recognized by the assembler. Except
for those which define data, assembler directives control processing, they do not convert directly into object codes. Table 2-6 lists assembler directives by function. The symbols used in this section and their meanings are:
{ } Select one
( ) Optional
c J.. ·Repeats the number of times chosen
< )> Character string such as label or operand (<label~ ~operand~)
A box in each table shows whether a label or operand is required. label operand
* *
In the descriptions, O, X or 6 will be where the asterisks are. The symbols mean:
o...... required
x...... cannot be used
6 ·····. either may be used

HITACHI 33

Table 2-6 Assembler Directives

No.

~

Control

Instruction

1 Assembly Control NAM OPT T OPT M

OPT 0

ORG

END

2 Define S_ymbol EQU

3

Define Data FCC

and

FCB

Reserve Area FDB

RMB

4

Control

PAGE

of Listing

SPC
OPT x

OPT s

OPT G

OPT P OPT L

Function
S_£ecifies _£ro_g_ram name Selects 6301 or 6801 Assembler Outputs object code directly to memor_y Selects obiect out__£_ut S__£_ecif ies ori_g_in S_£ecifies end of _£ro_g_ram Assi_g_ns non-variable value Obtains character constant _data Obtains 1 b_y_te constant data Obtains 2 b_y_te constant data_ Obtains memor_y area Chan_g_es _E_ag_e 0u1:.E_uts blank line Out_.E_uts cross reference--Eable 0u1:.E_uts s_ymbol table Outputs Expanded line of FCB, FCC and FDB Lists in _E_a_ge format Outputs list

Section
-Nu-mb-er
2.7.6 2.7.8
2.7.9 2.7.10 2. 7.11 2.7.1 2.7.2 2.7.4 2.7.3 2.7.5 2. 7.13 2.7.12 2.7.14 2.7.7 2.7.7
2.7.7 2.7.7 2.7.7

Assembly control

END

2.7.1 END [ End of Program]

Format

END [<expression>] [<comment>]

1-L-a-be-l---O1p-er-a-nd------
x

Function

Specifies the end of a program

---------------------------------------------Explanation The END directive tells the assembler the source program has

ended. The assembler thus ignores any source statement after

an END statement. During the execution of each pass, the

assembler reads the END statement and ends the pass. Expres-

sions can be written in the END directive's operand field. The

expression's value indicates the start address of the program

and is entered into the end record of the object tape. For

object formats see Figures 2-9 and 2-10. Figure 2-16 shows an

example of how this command is used. The statement of the END

directive is underlined. You must write an END directive at

the end of a source program.

34 HITACHI

80001

NAM

ENO

80003 1008 88004 1800 96 08 START 80005 1002 97 01 00006 1GG4 7E F000

ORG LOA A STA A JMP

$1000 0 1 $F000

00008

END

START

TOTAL ERRORS 80000

PROGRAM BEGINS AT START

(END statement's operand field includes an expression)

00801

NAM

EN02

80003 0080 96 80 START LOA A G

00084 0002 97 01

STA A 1

00005 0004 7E F080

JMP

$F080

00007

ENO

TOTAL ERRORS 80000

(END statement's operand field does not include an expression) Figure 2-16 Example of END Directive

HITACHI 35

Defining Symbols

EQU 2.7.2 EQU [~ate Symbol Value]

Format

<label> EQU <expression> [<comment>]

Label Operand

0

0

Function

Defines the value of a symbol.

.....E..-x-pl·an·a-ti·on-

-

-

--
The

- - - - ..
EQU direc

t

ive

assigns

the

value

of

an

operand

field expression to a symbol in the label field. The label and

expression follow the rules in 2.3.1 "Input to Assembler." It

should be noted that the EQU directive does not assign a

program location counter to a label, it assigns only the

counter's value. Neither label nor operand field can be

omitted. Labels defined by EQU directive cannot be redefined

elsewhere in the program. An EQU directive's operand field

cannot contain undefined symbols. Figure 2-17 gives an example

of how the directive is used. The underlined sections are the

statements of the EQU directive.

36 HITACHI

00801

NAM

EQU

08003 0000 0864

08005

0832

00087

0032

****ERROR 206

88809

03E8

88811

G3E8

LABEL1 RMB LABEL2 EQU LABEL3 EQU

100 LAGEL1+50 LABEL2

LABEL4 EQU LABELS ERROR -- FORWARD REFERENCE

LABELS EOU

1008

80813

ENO

TOTAL ERRORS 80001

Figure 2-17 EQU Directive Example

HITACHI 37

Data Definition

FCB

2.7.3 FCB [Form Constant _!ryte ]
1----------..-------------------------·-- r-·····----~-----

Format

Label Operand

f).

0

[<label>] FCB {<:expression.>} {<:expression:>} ··· {<expre·ssion>'} [<comment"']

<null>

<null>

' <null>

Function

Forms a constant of one byte

Explanation

The FCB directive stores an 8-bit unsigned binary, for a given operand value, in one byte of the object program. The directive can have one or more operands. Delimit operands with commas. Two or more operands will be stored in contiguous bytes. In the operand field, you can write expressions and symbols with numerics assigned by the assembler and you can write hexadecimal, decimal, octal and binary numerics. You can assign a series of one or more null operands delimited by commas to an FCB directive. Zeroes (0) will be stored for the null operands. Undefined symbols are not allowed in the expressions of an FCB directive operand field. Figure 2-18 shows an example of how this directive is used. Underlined sections are FCB directive statements.

38 HITACHI

80001

NAM FCG

00003 0000 FF 00)004 0801 00
0002 0F 0003 17 0004 00 0000~, 0005 02 0006 02 0007 07 00006 0008 05 00007 0009 00 000A 00 0008 01 00008 000C GA

FCG LAGE.L FCG

$FF ,$F,23.

FCG

'%018,LAGEL+l,*

FCG

5

£CG _ _~

FCB 5*2

80010

ENO

TOTAL ERRORS 00000

Figure 2-18 FCB Directive Example

HITACHI 39

Data Definition

FCC

2.7.4 FCC [ !_orm fharacter _fonstant ]

Format

Label Operand

8

0

[~label>] FCC{d<AS~II character string>d . } [<comment>] ~decimal>,<:ASCII character string>
Note: ASCII character strings do not include 'U'.::BJ'.

Function

Forms character constants

Explanation

The FCC directive converts character strings to 7 bit ASCII code. In this directive, you can use any character in the ASCII code from $20 (space) to $5F(-). You can write in the FCC directive's operand field in either of 2 ways:
(1) <count decimal>,<ASCII character string> Count is the number of characters to be formed. The character string starts after the operand's first comma. If the value of count is greater than the length of the character string, the code for spaces will be entered until the count value is reached. The maximum value of count is 255.
(2) d<ASCII character string>d A character, number or symbol may be used for d. A character string delimited by d will be converted to ASCII code. If a number is used for d, the character string cannot start with
II II
'
If an operand character string contains 2 or more characters, the ASCII codes corresponding to the contiguous characters will be entered into contiguous areas. Figure 2-19 is an example of how the directive is used. The underlined sections are the statements of the FCC directive.
Note: The same characters as the delimiter symbol d can not be included in a character string.
(Example) FCC AABCA (The delimiter symbol A is contained in the character string ABC.)

40 HITACHI

00801

NAM FCC

08883 0000 54 0001 45 0002 58 0083 54
00004 0004 54 0005 45 0006 58 0007 54 0008 20 0009 20 000A 20 0008 20 000C 20
00005 0000 40 000E 4F 000F 52 0018 45 0011 20 0012 54 0813 45 0014 58 0015 54

MSG1 FCC MSG2 FCC
FCC

80807

OPT

08008 0016 4E

FCC

08810

OPT

08811 0018 47

FCC

001C 45

0El10 4E

00812

ENO

TOTAL ERRORS 08888

/TEXT/ 9,TEXT
?MORE TEXT?
NO GEN /NOGEN/ GEN /GEN/

Figure 2-19 FCC Directive Example

HITACHI 41

Data Definition

FDB

- - -·-·-· 2.7.5 FDB [ Form Double _!ryte Constant ]
~--i-------------

·------------------------.----..-------1

Format

_

Label Operand

/j.

0

'------

[<label>] FDB {<expression>} {<expression>}··· {<expression>} [<comment>]

<null>

' <null>

' <null>

Function

Forms a 2-byte constant

Explanation

The FDB directive stores a 16-bit unsigned binary that is equivalent to the operand value in 2 bytes of the object program. When there are two or more operands the binary will be stored in contiguous areas. In the operand field, you can write symbols and expressions to which the assembler has assigned numeric values, and you can write binary, octal, decimal and hexadecimal numerics. FDB directives with one or more null operands delimited by commas will store zeroes (0) for the null operands. You may assign labels if you wish. FDB directive cannot have undefined symbols within their operand field expressions.

Figure 2-20 is an example of how this directive is used. The statements of the FDB directive are underlined.

42 HITACHI

00001

NAM FOB

00803 8000 0002 00004 0002 0000
0084 00GF 0006 00FF 0008 0FFF G00A FFFF 00005 000C 0G0C G00E 0007 0018 0002 80006

FOB LABEL FOB
FOB END

TOTAL ERRORS 00000

2 .SF.SFF.$FFF.$FFFF
LAGEL+10,LABEL+S,LABEL

Figure 2-20 FDB Directive Example

HITACHI 43

Assembly Control

NAM

2.7.6 NAM [Program Name]

Format

Label Operand

NAM <program name> [<comment:>]

x

0

Function

Used to specify the program name.

Explanation

The NAM directive must always be written at the beginning of a source program. No labels may be attached to the NAM directive. Write the program name in the operand field using no more than 8 alphanumeric characters. The NAM directive displays the program name on the first line of each page in the list. The program name will also be in the object program's header record. See Figures 2-9 and 2-10 for object formats. Figure 2-21 shows how this directive is used. The statements in the NAM directive are underlined.

88001 00002

NAM

NAM

OPT

0

80004
80005 0800 96 00 00006 0002 97 01 00007

*PROGRAM NAME NAM81 LOA A 0
STA A 1 END

TOTAL ERRORS 00800

Figure 2-21 NAM Directive Example

44 HITACHI

i---------~-~
Listing Control

OPT

2.7.7 OPT [ Output .2.E!_ion ]

Format

Label Operand

~----- r--O-P-T-<-:-op-t-io·n->·-[-,<·o-p-t-io-n->·]-·-··-·-·-· ------_..___x__.___0 _____,

Function

Selects output

! - - - - · · - - - · · ·..-·-·--·------------------------------------~

Explanation The OPT directive is used to give the programmer optional

control of assembler output. Some options are reset to the

default at the end of pass 1. To cancel control of those

options, specify "NO" at the header. Table 2-7 lists the options available. Note the following

points. (1) N, D and R mean:

N - "NO" can be assigned to the header. D - Default. Selected when the operand is omitted. R - Reset at the end of pass 1. The option will be in

effect at a point you specify. (2) Characters in parentheses are abbreviated forms of the

option. (3) More detailed explanations of options marked with asterisks (*) will be given on subsequent pages. Figure

2-22 is an example of how to use XREF and SYMBOL options. The statements underlined are for that particular option.

HITACHI 45

O_ption
6301 *T={ }
6801
I GENERATE (G) i
LIST
(L)
*MEMORY (M)
*OTAPE (O) PAGE
(P)
SYMBOL (S)
XREF (X)

Table 2-7 Options Segment
--
N, D, R
N, D, R
N N, D N, D N N

Meanin_g_
Selects 6301 or 6801 assembler.
The default is T = 6301.
Outputs expanded lines for FCC, FCB and FDB directives. When you specify "NO"~ expanded line
will not be output.
The option will begin to output the list at a specified point in time. If "NO" is specified, there will be no output after that point.
Outputs the object program directly to memory.
Outputs the object program tape.
Outputs the list in page format.
Outputs the symbol table list.
Outputs the cross reference list.

46 HITACHI

PAGE 801 MOVE

6301 ASSEMBLER 1.0

00001 00002 80003 08084 8488 00005 8488 0002 00806 0402 0082 88807 0484 8002

NAM OPT OPT ORG MOVGEG RMB MOVOST RMB SAVEX RMB

MOVE SYMBOL XREF $488
2 2 2

88009

0486

MOVE EQU

08018 0406 EC 80

LOO

08811 8408 FD 0488

STD

00812 0488 EC 82

LOO

88013 0400 FD 0402

STD

88014 0410 A6 04

LOA A

88815

*

08016 0412 FE 0408

LOX

88017 0415 E6 08 MOV818 LOA G

00818 8417 FF 0404

STX

00019 041A FE 0402

LOX

00820 0410 E7 88

STA 8

88821 841F 88

INX

00022 8428 FF 0482

STX

00823 8423 FE 0404

LOX

00824 8426 88

INX

88825 8427 4A

DEC A

88826 8428 26 EB

GNE

88827 842A 39

RTS

00828

END

0* .x
MOVBEG 2.X MO VOST 4,X
MOVGEG 0.x SAVEX MOVDST 0,X
MO VOST SA VEX
MOV010

* SET PARAMETER
*
* *

PAGE 882 MOVE

6381 ASSEMBLER 1.8

MOVBEG 8488 MOVDST 8482 MOVE 8486 MOV81G 0415 SAVEX 8404

MOVGEG 8480 MOVOST 8482 MOVE 8486 MOV810 8415 SA VEX 8484

00885* 88811 08006* 08013
88889* 00017* 88026 00887* 88818

88816 88819
88823

88822

TOTAL ERRORS 88808

Figure 2-22 Example of XREF apd SYMBOL Options Use

HITACHI 47

Assembly Control

OPT T

2.7.8 OPT T [Specify Assembly Language !ype]

Format

T = {6801}
6301

Label Operand

x

0

Function

Converts the source program into a specified machine language.

Explanation

The OPT directive's T option directs the assembler to convert a source program into the machine language specified.
(1) When OPT T = 6801,
The source program will be converted into HD6801 machine language. (2) When OPT T = 6301, The source program will be converted into HD6301 machine language.
T = 6301 is the default so if you do not specify the T
option, the source program will be converted into HD6301 machine language. The T option must be placed prior to the statements of the executive instruction. If the T option is after those statements, it will be ignored and assembly will be performed by the default (6301). The T option cannot be used more than once in one program. If it is, options specified afterwards will be cancelled. Figure 2-23 is an example of how this option is used. The statements in the T option are underlined,

48 HITACHI

PAGE 001 OPTTST

6801 ASSEMBLER 2-0

08801 08082 1008 00803

NAM OPTTST

ORG

$1800

OPT X,T=6801

00805 1008 86 1008 00006 1803 97 18
****ERROR 207 . 00007 1885 00 0010

LOA A WORK STA A $18
AIM #$7F,$10

00009 1008 0081 08018

WORK RMB END

WORK AREA

Figure 2-23 Example of T Option Use

HITACHI 49

Assembly Control OPT M
ro-~~----~~--~~~-~----~·~~~~--~~--------~-·~------------~----
2. 7. 9 OPT M [Output Object to !!_emory]

Function Explanation

Outputs the object directly to memory.
The OPT directive's M option directs the assembler to output the object code directly to memory. If a RAM is not packaged in the respective area, error number 218 will be displayed and there will be no output to memory. Figure 2-24 gives an example of how this option is used. The statement specifying the M option is underlined.

88881 88882 F880 88003

NAM OPTMEM
ORG $F888 OPT M

80885 F808 96 80 START LOA A G

00886 F802 97 81

STA A 1

00007 F804 7E F080

0MP

$FGGG

88809

END START

TC) TAL ERRORS 80008

Figure 2-24 Example of MEMORY Option Use

50 HITACHI

Assembly Control

-------O-P-T--0-- - -
2.7.10 OPT 0 [ Select Object Qutput 1

Format Function

Label Operand

OPT{OTAPE}

x

0

0

--------------···------- - ---·-----~--------·

-·--- -- --·-------·-·

Selects output of an object program.

Explanation

The OPT directive's 0 option is used in outputting object programs. The 0 option is a system default, so that if omitted, object program output will be selected. If you do not want the object program output, specify the NOO option to inhibit. The 0 option can be used only once, and you cannot use 0 and NOO together in the same program. Figure 2-25 shows an example of how this option is used. The statement specifying the 0 option is underlined,

08001 88002 1000
ff8003
88805 1000 96 00 START 00006 1002 97 81 80007 1084 7E FGGG

NAM OPTOGJ

ORG

$1080

OPT 0
-----

LOA A 0

STA A 1

JMP

$F00G

00009

END START

TOTAL ERRORS 80808

Figure 2-25 Example of OTAPE Option Use

HITACHI 51

Assembly Control

ORG

2. 7.11 ORG [ Ori_g_in]

-------------------------------------.--· .

Format

ORG <expression> [-<comment>]

Label Operand

x

0

Function

Specifies the origin.

Explanation

The ORG directive stores the values of operand field expressions into the program counter. Statements after the ORG directive are assigned to memory locations which start with those operand values. If ORG is not specified, zeroes (0) will be stored in the program counter. Do not assign labels to the ORG directive. Figure 2-26 gives an example of how this directive is used. Statements in the ORG directive are underlined.

08881 88802

NAM ORG

OPT

0

00804 0000 0801

BILL RMB

00885

0001

JOHN EOU

*

00007 0820 00808 0020 000A

- OR-G - - -$20

RMB

10

00010 0001

ORG JOHN

88812

ENO

TOTAL ERRORS 00000

Figure 2-26 Example of ORG Directive Use

52 HITACHI

Listing Control

PAGE

2. 7 .12 PAGE [Top of Page]

Format

PAGE

Label Operand

x

x

Function

Advance to next page.

Explanation

The PAGE directive is used to form feed to the beginning of the next page, This directive will not be displayed on the assembly listing. You cannot use a label or operand with it. Nor will the PAGE directive_ translate into a machine instruction.

HITACHI 53

Reserve Area

RMB

2.7.13 RMB [ !eserve !!emory _!ryte ]

Format

[4label>] RMB <;expression> [<comment>]

Label Operand

!:::.

0

Function

Reserves bytes of memory area.

Explanation

The RMB directive reserves an area in memory of a size specified (in bytes) by the operand field value. As a result, the location counter increments by operand field value. You can write numeric constants (binary, octal, decimal and hexadecimal), symbols and expressions in the operand field. The assembler converts the symbols and expressions to numerics. A memory area reserved using the RMB directive cannot be changed by a second use of the directive. You cannot write symbols previously referred to or undefined symbols in the operand field expression of an RMB directive. Figure 2-27 gives an example of how the directive is used. Statements in the RMB directive are underlined.

08081

NAM RMB

08003 0000 0001 08084 0001 0002 08006 0003 0003
08008 0006 0006

CLABl RMB CLAB2 RMB
RMB
RMB

1

1BYTE RESERVED FOR CLABl

2

2BYTE RESERVED FOR CLAB2

*-CLABl RESULT OF EXPRES. IS ABS

*

ERROR - RESULT OF EXPRESSION

08010

END

TOTAL ERRORS 00000

Figure 2-27 Example of RMB Directive Use

54 HITACHI

Listing Control SPC

2.7.14 SPC [ E.E_a~e]

Format

SPC .('.expression>

Label Operand

x

0

Function

Outputs a blank line

Explanation
L-----

The SPC directive instructs as many blank lines as specified by the operand to be left in the assembly listing. SPC will not be displayed in the list. In the operand field~ write the number of lines to be left blank in binary, octal, decimal or hexadecimal. You may write either symbols or expressions. If page change occurs halfway through execution of the SPC di rective, blank lines will be placed only up to that page. The operand field expression of this directive cannot contain undefined symbols or forward reference symbols.

2.8 Assembler Operational Examples

Figure 2-28 is an example of assembler operation.

HITACHI 55

PAGE 001 MOVE

6301 ASSEMBLER l. 0

00001 00002 00003 0400 00004 0400 0002 00005 0402 0002 00006 0404 0002

NAM OPT ORG MOVBEG RMB MO VOST RMB SAVEX ~MB

MOVE
0 $400
2 2 2

08008

0406 MOVE EQU

00009 0406 EC 00

LOO

00010 0408 FD 0400

STD

00011 0408 EC 02

LOO

00012 0400 FD 0402

STD

00013 0410 A6 04

LOA A

* 00014
00015 0412 FE 0400

LOX

00016 0415 E6 00 MOV010 LOA B

00017 0417 FF 0404

STX

00018 041A FE 0402

LOX

00019 0410 E7 00

STA 8

00020 041F 08

INX

00021 0420 FF 0402

STX

00022 0423 FE 0404

LOX

00023 0426 08

INX

00024 0427 4A

DEC A

00825 0428 26 EB

GNE

80026 042A 39

RTS

00027

ENO

*0.x
MOVBEG 2.x MOVDST 4.X
MOVBEG 0,X SAVEX MOVOST 0,X
MOVOST SAVEX
MOV010

TOTAL ERRORS 00080

SET PARAMETER
* * * *

@ !2TS0080808404F56452020202030 S11E0406EC08F00400EC02F08402A604FE0400E600FF0404FE0402E70008FF6E S10004210402FE0404084A26EB3925 S9030000FC
TOTAL ERRORS 00000

Figure 2-28 Assembler Operational Example

56 HITACHI

Operations in Figure 2-28:

I : In assembler command request status, key in command "IP" to execute

pass I. The "IP" command clears the symbol table and executes pass I.

2 Execute pass 2. The "2L" command outputs the assembly listing.

3 Key in "2T" and output the object program. When performing paper

tape output, key in "2T" and immediately turn the output device switch

on. When paper tape output is complete, turn the output device switch

off.

2.9 Assembler Error Messages

Assembler error messages will be displayed in this format:

****ERROR xxx

The error message number is displayed in xxx.

Table 2-8 lists the numbers, names and meaning of the assembler error

messages.

Table 2-8 Assembler Error Messages

Error No.

Error Name

Descri.Q_tion of Error

20I

NAM directive

NAM directive not in first state-

error

ment of source program. Or, more

than one NAM directive in the same

program.

202

Label or

Label or operation code symbols

operation code

start with non-alphabetic.

error

203 204*

Statement error Syntax error

Source statement has only a label or blank spaces.
Error in source statement syntax.

205

Label error

The label field does not end with a blank space. Or·an invalid character was used in the label field.

HITACHI 57

206

Dual definition

An attempt was made to define a

symbol

symbol more than once. The value

first defined is the effective

value. Or, the characters A, B or

X have been us~d by themselves in

the label.

207

Undefined

An item, not defined as an

operation code

instruction, was used in the

operation code field.

208

Branching error

The operand value of a branching

instruction was not within the

1-byte range.
(* + 2) - 128 < D < (* + 2) + 127

*: Address of the first byte in the

branching instruction.

D: Address of the branch

destination.
-----·---t----·------------+- -------------------------+

209

Invalid addres-

An addressing mode that does not

sing mode

conform with the operation code

type was used in an operand.

·--------+-----------·------···- ---------------·---·-·---·-----------f

210

Byte overflow or

An operand value is outside the

reserved word

range of 0 - 255. Or, reserved

reference error

word A, B or X was used in the

operand of an FCB directive.

211

Undefined symbol

--------~ ----------···-··--····-·-··. -- .. . ....

212

Assembler direc-

tive syntax

error

An undefined symbol was used in an operand.

. ···- ... - . ·-···

. . . .... - ··-·-- ·--·-·-------!

There is a syntactical error in the

assembly directive operand.

213

EQU directive

The EQU directive is not

syntax error

labeled, or, it has a syntax error.

214

FCB directive

Syntactical error in FCB directive

syntax error

statement.

~------··-t----···-····- -- ... ····---·---··-- --- .. ·-----·----··· -·--· ··-··- ···--····--······-········ ·----------·-····---------!

215

FDB directive

Syntactical error in FDB directive

syntax error

statement.

216

Assembler direc-

Operand error in the assembler

tive operand

directive.

error

58 HITACHI

217

OPT directive

An undefined option was used in the

error

OPT directive statement. Or, there

is an error in the "OPT T = ··· "

position.

218

Addressing error

The object program cannot be output

to memory. Or, the memory to which

output was attempted is not

packaged.

220

Phasing error

An instruction word used in

equivalent statements in pass 1 and

pass 2 has two different addresses.

221

Symbol table

The symbol table has overflowed.

overflow

The defined symbol will not be

cataloged after this error is

output. All statements which refer

to that symbol will also be in

error.

223

Error in assemb-

A label was assigned to a directive

ler directive

which must not have a label.

label field

234

Dual definition

A twice-defined symbol has been

symbol reference

referred to.

* If there is a syntax error in an FCC directive, the error message will be
written on the subsequent line of the source statement.

HITACHI 59

2.10 Assembler Commands

Table 2-9 lists the assembler commands.

Table 2-9 Assembler Commands

No.

Command

Descri_E_tion of Function

1

lS

Executes pass 1 without clearing the symbol

table.

2

lP

I

Executes pass 1 after clearing the symbol table.

3

21

Outputs the assembly listing only.

4

2T

Outputs the object program only.

5

2P

Outputs the assembly listing and the object

program.

6

x

Returns control to the monitor.

60 HITACHI

3. Text Editor 3.1 General Description of Text Editor
The 6301 text editor programming system (afterwards, simply, text editor) inputs text on paper tape, and then edits and corrects that text. 3.2 Text Editor Features
(1) Editing and correcting of long text on a small, 3Kbyte buffer. The text editor has functions for storing part of the text on a buffer in memory, correcting that text and then outputting it. After output terminates, the text editor reads the text remaining in the input device in the same way as previous storage, corrects the text and then outputs. It continues this same processing sequence over and over again. This segmented processing allows the text editor to handle large volumes of text. (2) Serial execution of multiple commands. You can execute commands either one at a time or sequentially. (3) Repeating command execution The text editor has functions to repeatedly execute commands, and you can repeat the same processing as many times as you specify. (4) Specification of edit location by pointer The text editor locates the pointer between two adjacent text characters. It inserts new text or deletes characters on the left or the right of the pointer. The text editor then moves the pointer to the next location requiring correction. (S) Specifying edit location by character string The text editor searches for a character string in the buffer, moves the pointer to the position directly after that character string and replaces it.
HITACHI 61

(6) Correcting key-in mistakes When text or a command is incorrectly keyed in, the mistake is corrected by deleting a character previously keyed in or a line up to the previous command request. 3.3 Text Editor Input/Output The text editor edits or corrects text input from paper tape by commands entered from the keyboard and outputs the results to paper tape. Figure 3-1 shows the flow of text editor I/O.

Text Paper Tape

6301 /6801 Text Editor

Printer

Keyboard

Text Paper Tape

Figure 3-1 Text Editor Input/Output 3.3.1 Input to Text Editor
The text editor inputs commands keyed in at the keyboard and text punched on paper tape. For details on these commands see 3.6 "Text Editor Commands."
Text format (1) Text is composed of characters in ASCII code. (2) A line is a group of characters delimited by@ ($OD: carriage return). (3) The final characters in text are@:]? ($1A). Figure 3-2 shows a text format

62 HITACHI

@

@

( A s 0 I I code )

@

4

@D

@D

@

n-1

@D

n

@D

@:v

Figure 3-2 Text Format 3.3.2 Output from Text Editor
The text editor follows the directives of an entered command to output corrected text to paper tape and to output text lists.
Rules on text output
( 1) Even if it has not been entered into input text, an al) will always be
output prior to a@. (2) When text is output up toCEQF}, the text editor will output a feed (150 nulls) to the text. 3.4 Executing the Text Editor If the EPROMs for the text editor are mounted on the evaluation kit, once the power ~upply is turned on and a key-in is made like that in Figure 3-3, the text editor enters command request status.
/E~ 6301 TEXT EDITOR v.r @
Figure 3-3 Text Editor Execution Key to Figure 3-3.
(D: Key in a monitor command to execute the text editor.

HITACHI 63

@:Displays the title of the text editor. V stands for the version number and r for the revision number. ~: The text editor enters command request status. 3.5 Operating the Text Editor 3.5.1 Edit Operation Flow The text editor inputs text from paper tape. It edits and corrects text by command from the keyboard. Figure 3-4 shows the flow of edit operations. The text editor repeatedly stores part of a continuous text in the buffer, edits buffer content and then outputs that content.
64 HITACHI

Text Editor
IT IE Ix Ii}------
Figure 3-4 Flow of Editing Operations
HITACHI 65

3.5.2 Operational Procedures for Editing Are: (1) Performed by character or line unit. (2) Performed for lines or characters located by a pointer. The pointer
indicates where a character is in the buffer. As the example in Figure 3-5 shows, the pointer is considered to be between adjacent characters.
Pointer Figure 3-5 Pointer Position (3)(i;f)is not stored in the buffer, so it makes no difference whether input text includes an@or not.
3.6 Text Editor Commands This section explains the functions and methods used for each text editor
command. Before that explanation some general points on command usage should be mentioned.
(1) Command request The text editor displays a "@" at the left of the list whenever it is requesting a command. When a "@" appears, key in a command. (2) Command execute directive After keying in the command, key in~twice to end command input and begin command execution. ~is an undisplayed character set, but when you
key~ in, the text editor displays "$".
Figure 3-6 is an example of command input. In this example, the pointer moves to the head of the buffer.
66 HITACHI

@ B<EW~ -~ Displays "$"

Figure 3-6 Example of Command Input

(3) Rules on key-in

If the bell rings* during command input and the following message is dis-

played,
** BUFFER NEAR END
You wi'll be able to key in only 10 more characters besides the 2 ~ for

directing command execution. Any mo:::-e than 10 will not be accepted. Use (llS)

and~ (see (5)) to partially delete excess commands. Then begin execution.

At times you won't be able key in the C, 1 and S commands during text in-

put. If you are unable to key in these commands and a command is then execut-

ed, you will be unable, as the next example shows, to perform the desired pro-

cessing.

(Example)

@ lABCDEFGHIJKLNNC
** BUFFER NEAR END

!'._ QRSTU$COTP$$

t
l

t l

t ~o keying in beyond this point

After message is displayed only 12 characters can be

keyed in

Message is displayed when this character is keyed in.

After "OTP" in the C command, an attempt was made to key in '~

OPT" to replace "OPT" with "OTP". But, during C command input, the

command ended and "OTP" was deleted because the buffer was full.

(4) Serial execution of commands

You can key in several different commands sequentially before issuing

*Differs according to console specifications.

HITACHI 67

the directive to execute a command. Figure 3-7 is an example of how this is

done. In this example, text set in the input device is read and the second

line from the header is deleted.

@A B L K

Displays "$"

Figure 3-7 Example of Serial Command Execution

Section 3.7 discusses serial execution of commands in further detail.

(5) Correcting commands

If you notice any key-in errors in a command before issuing the execute

directive, correct them using either method in Table 3-1.

Table 3-1 Methods of Correcting Commands

No. Method Name

1

Carree- Back

tion by Space

([S)Key

QE.eration Code

Description

~+H $08 Deletes the character just

keyed in from the buffer and

displays the deleted character.

(Example)

@A B L L 2
- - -t -

L K
--

<tSO

<!S1'

I
<BID

In this example, commands A, B, 2L and K will each be executed.

2

Carree- Cancel ~+X $18 1 entire line will be deleted,

tion by (CA© Key

a move made to the next line, and "@", requesting a new

command, will display.

(Example)

@!!~~~ t

<Pk

@

The examples below explain each command used when text in Figure 3-8 is

stored in the buffer. However, (CR) and (LF) indicate the key-in of @ar;d

68 HITACHI

NAM PGM(CR) (LF)

OTP M MEMORY FILE OPTION(CR)(LF)

OPT 0 OUTPUT OBJECT TAPES(CR)(LF)

OPT S SELECT PRINTING SYMBOLS(CR)(LF)

ORG 8192(CR)(LF)

LDA B ADDR(CR)(LF)

COUNT EQU @8 @ INDICATES OCTAL(CR)(LF)

START LDS #STACK INZ STACK POINTER(CR)(LF)

LDX ADDR(CR)(LF)

LDA B #COUNT IMMEDIATE ADDRESSING(CR)(LF)

BACK LDA A 10 DIRECT ADDRESSING(CR)(LF)

CMP A 2,X INDEXED ADDRESSING(CR)(LF)

BEQ FOUND RELATIVE ADDRESSING(CR)(LF)

DEX IMPLIED ADDRESSING(CR)(LF)

DEC B ACCUMULATOR ONLY ADDRESSING(CR)(LF)

BNE BACK(CR)(LF)

WAI WAIT FOR INTERRUPT(CR)(LF)

SPC l(CR)(LF)

FOUND JSR SUBRTN

JUMP TO SUBROUTINE(CR)(LF)

*JMP START EXTENDED ADDRESSING(CR)(LF) COMMENT STATEMENT NOTE TRUNCATION o 12 345 6 7 89 o 12 34 5 6 789 (CR) (LF)

SUBRTN TAB COMMENT FIELD TRUNCATION0123456789(CR)(LF)

ORA A BYTE SET MOST SIGNIFICANT BIT(CR)(LF)

RTS RETURN FROM SUBROUTINE(CR)(LF)

SPC 2 (CR) ( LF)

RMB 20 SCRATCH AREA FOR STACK(CR)(LF)

STACK RMB 1 START OF STACK(CR)(LF)

BYTE FCB $so FORM CONSTANT BYTE(CR)(LF)

FCB $10,$4 $ INDICATES HEXADECIMAL(CR)(LF)

ADDR FDB DATA FORM CONSTANT DOUBLE BYTE(CR)(LF)

DATA FCC 'SET' FORM CONSTANT DATA STRING AS ASCII(CR)(LF)

END(CR)(LF)

There are several errors in the above text. Those errors are corrected by the commands explained below.

Figure 3-8 Example of Input Text Symbols used in each command: 8 ··.··.··· Means a space is keyed in.
(underline) ····· sections keyed in by user.

HITACHI 69

Text Input/Output

A

3.6.1 A (text input)

Functions

Text is sent from an input device and stored in the buffer. Text is not displayed.

Explanation

(1) Text input terminates when any of the following

conditions are satisfied. "@" then displays requesting the

next command.

(a) WhenCEQ!}($1A: ~+ Z) is input from tape.

(b) When 150 lines are read in.

(c) When the buffer is full.

(2) If any previously input text remains in the buffer, new

text is read in after it.

(3) The following codes will not be input to the buffer.

(a)@j)
(d) (!ID
(g) ®ID
(j) (fil5)

(b) (DEL)
(e) ®
(h) <ZD
(k) aiOO

(c)@
(f) <Wt>
(i)~

(4) If there is space in the buffer, 150 lines or more can be

input when the A command is repeated.

(5) The pointer will not move.

(6) If none of the conditions in (1) are satisfied, the input

device enters input wait status even if all paper tape has been

read in. At this time have an <EQF}read in.

Examples

<D @A$$

@

(!):Reads the content of paper tape into the buffer.

70 HITACHI

Moving the Pointer

B

3.6.2 B (moving pointer to head of buffer)

Function Examples

Moves the pointer to the head of the buffer.
CD @T$$
OPT S SELECT PRINTING SYMBOLS

@ @B$$ Q) @T$$

@
CD: Displays line indicated by pointer (in this case, line
4).
@: Moves pointer to head of buffer. Q): Displays line indicated by pointer (1st line).

Edit Operations

Cstringl$string2

3.6.3 Cstringl$string2 (replacing a character string)

Functions

Searches for a character string which is identical to "stringl" then replaces that character string with "string2".

Explanation

(1) Execution of this command ends when either of the following occurs.
(a) "stringl" is found. "stringl" is replaced by "string2", the pointer moves to a location after "string2" and "@" displays to request the next command.

HITACHI 71

Examples

(b) "stringl" cannot be found from beginning to end of input text in the buffer.
After the message "CAN'T FIND 'stringl'" is displayed, "@" is displayed requesting the next command. The pointer does not move. (2) Key in ·~· once to delimit "string I" and "string2". (3) If "string2" is omitted, "string!" will be deleted. When this happens, command input must be ended as "Cstring l ~
~·. (4) "stringl" and "string2" are ASCII code character strings of
16 characters or less not including the characters (!;s()and (BREAK}
"stringl" and string2" do not have to be the saFiL' iength.
Q)@ B$$
@@ 5T$$ NAM PGM
* REVISION
OTP M MEMORY FILE OPTION OPT 0 OUTPUT OBJECT TAPES OPT S SELECT PRINTING SYMBOLS
@ @CSYMBOLS$0FL'ISYMBOL$$ @ @COTP$0PT$$
CAN'T FIND "OTP" G)@B$$
@ @COTP$0PT$$
CV @B$$
@@5T$$ NAM PGM
* REVISION
OPT M MEMORY FILE OPTION OPT 0 OUTPUT OBJECT TAPES OPT S SELECT PRINTING OF SYMBOLS
@

72 HITACHI

(!): Moves the pointer to the head of the buffer.
(6): Displays 5 lines after the line indicated by the pointer.
Q): Searches for "SYMBOLS" and replaces it with "OFt.SYMBOLS". @ : Searches for "OTP".
But, there is no "OTP" between the pointer location
and the end of input text, and the message "CAN'T FIND
"OTP"" is displayed. ~: Moves the pointer to the head of the buffer.
@: Searches for "OTP" and replaces it with "OPT". (i>: Moves the pointer to the head of the buffer.
~:Displays 5 lines after the line (1st line) indicated by the
pointer.

Edit Operations

nD

3.6.4 nD (deleting text by character units)

Functions

From the location indicated by the pointer, deletes n characters from the buffer.

Explanation

(1) n is a decimal integer: -254SnS255.
(2) No execution takes place if n = 0.
(3) If n is negative, n characters to the left of the pointer location will be deleted. (4) If there are less than n characters from the pointer location to the head or foot of the input text, all characters between the head or foot will be deleted.
(5) If n is omitted, it will be assumed as n = 1, if n is -D, it will be assumed as equivalent to n = -1.

Example

(D@B$$ (3}@4T$$
NAM PGM
* REVISION 1
OTP M MEMORY FILE OPTION OPT 0 OUTPUT OBJECT TAPES

HITACHI 73

@@STAPES$$ @@-1D$$ <2)@-4T$$
NAM PGM
* REVISION
OTP M MEMORY FILE OPTION OPT 0 OUTPUT OBJECT TAPE
@
Q): Moves pointer to head of buffer. (6}: Display 4 lines from line indicated by the pointer (1st
line).
Q) : Searches for "TAPES". Moves pointer to next immediate
position. ~ : Deletes character (S) to left of pointer location.
G) : Displays 4 lines above pointer location.

Text Input/Output

E

3.6.5 E (ending editing operations)

Functions Explanation

Outputs entire buffer content to paper tape and continues to copy the tape remaining in the input device. When all copying ends, the trailer is output.
(1) When all text corrections end, key in the E command. All buffer content and remaining text will be copied on paper tape. ( 2) If there is an (EQD on the input tape, the @:[)at the end of the output tape and the trailer (150(filij};) will be output and output will end. (3) Pointer does not move. (4) ~ will not be copied. (5) When the text in the buffer is output,Q;;E)will be assigned
before@ 6 ffiID}; will then be output.

74 HITACHI

(6) The following operations differ according to whether the J command is executed.
(a) When not executed: (i) Execute the E command. "PUNCH ON?" will display. Turn the output device switch on and key in charac-
ters other than Will), dlID or@. The keyed in charac-
ters will not be output, but buffer content and remaining text will be copied. (ii) If there is an~ on the tape, the copying of input tape will end and the trailer will be output. Since the tape stops when trailer output ends, turn the output device switch off and key in a character
other than <ii@, Glfil) or@ "@" will be displayed
and the system will enter command request status. (b) When executed:
Execute the E command. Buffer content and remaining text will be output immediately. The trailer will also be output and the system will enter command request status.
Example (!) @E$$
@PU~CH ON
Q)@
Q) : Key in the E command to end edit operations.
(6) : Turn the output device switch on and key in any character except
@ID, (QW or @.
Q) : After buffer content is output and text remaining in the input
device is copied, the feed will be output. When this occurs, turn the output device switch off and key in characters other
than ai®, @ID) or@. The text editor will then enter command
request status.
HITACHI 75

Text Input/Output

F

3.6.6 F (outputting feed)

Functions

Outputs lSOCID.fi); to paper tape in an output device.

Explanation (1) Use the F command to output trailers or leaders to paper tape. (2) Operations will differ depending on whether the .J command has been executed. (a) When not executed: (i) Execute the F command. "PUNCH ON?" wi J.1 displ;1y. Turn the output device switch on and key in characters other than(NUL}. @Dor@ The keyed in cha meters will not be output, but 150<'.liiil)s will. (ii) When the tape stops, turn the output device switch off, and key in characters othe;:- than (ill[).
Ci2]D, orCiJ:l, The system wj_ll enter command requPl't status and "@" will be displayed.
(b) When executed: Execute the F command. The feed will be tiutput immedi-
ately and the system will enter command request status. Examples
(D@F$$ @PUNCH ON?
@@

CD: Key in the F command to output feed (150Qilll1)s)
@: Turn the output device switch on, and key in any chare.c:ters except CN@, QIB1} or@
Q): When feed output ends, turn the output device switch off and key
in any characters except CR@, (DELJor@ The te~,t editor w1J.l
enter command request status.

76 HITACHI I

Edit Operatjons

I text

3.6.7 Itext (inserting text)

Functions

Inserts text into the buffer in either line or character units.

Explanatiof"'. Example

(1) Text will be inserted in the location indicated by the

pointer. When insertion ends, the pointer moves to the end of

the ins~rted text.

(2) Except for the following, "text" is made up of characters

in ASCII code. (a)Ct@ (b)~
(e) @j) (f) (iiLl> (i) @@ (j) ©ill>

(c)@ (d)@
(g) (liQ) (h) ~

CD @B$$
@ @2T$$
NAM PGM
OTP M MEMORY FILE OPTION
Q) 0Ili$$ ® @L$$ Q) @Ili*liREVISIONtil<&E)
11 @ @B$$
(J) @3T$$
NAM PGM
* REVISION 1
OPT M MEMCRY FILE OPTION

@
(D: Moves the pointer to the head of the buffer. G): 2 lines after line (1st line) indicated by pointer are
displayed.
d): One space is inserted in the location indicated by the
pointer. ~ : Moves pointer to the next line.

HITACHI 77

G): Insert "I6*6REVISION61 ~' into the location indicated by
the pointer.
@):Moves pointer to head of buffer.
CZ): Displays 3 lines after the line (1st line) indicated by the
pointer.

Editor Control

J

3.6.8 J (selecting output device)

Function Explanation

Specifies console with packaged Automatic Device Control (ADC) function for controlling automatic punch output. (1) When you execute the J command there will be no temporary stop to turn the output device switch on or off or to output text to paper tape. The "PUNCH ON?" message will not be dis~ played. (2) At a console with a packaged ADC function, there is no need to turn the output device switch on and off for paper tape output. Just execute the J command. (3) Don't use the J command on a console that does not have the ADC function. If you do, punch errors may result. This is because you cannot easily time the on-off switching of the output device.

Example

(j)@J$$ @@F$$
Q)@
(D: When you don't have to operate the output device on/off
switch, key in the J command. ~: Key in the F command to output feed.
Q) : "PUNCH ON?'' will not be displayed, the feed will be
automatically output, and the text editor will enter command request status.

78 HITACHI

Edit Operations

nK

3.6.9 nK (deleting text by line units)

Function

Deletes n lines of text from the buffer beginning at the position indicated by the pointer.

Explanation

(1) n is a decimal integer, -254SnS255. (2) There will be no execution when n = 0. However, if the pointer is within a line, that part of the line from the head to the pointer locatio1~ will be deleted. (3) When n = 1, one line wilJ be deleted. But, if the pointer is within a line, the line will be deleted from the pointer location to@ (4) When n is a negative number, n lines above the pointer location will be deleted. 0) When n = -1, one line above the pointer location will be deleted. But. if the pointer is in a line, the deletion will he from the head of the previous line to the pointer location. (6) If n is omitted. or assumed to be "+K", it will be regarded as equivalent ton=- 1, and if it is assumed as 11 -K", it will be regarded as equivalent ton= -1.

l

c

pointer
{

I a

I

a : deleted by "C1K" b : deleted bv "lK" c, a: deleted by II-lK"

J
h

(7) lf the number of lines from the pointer location to the head or foot of the input text is less than n, only text from the pointer location to the head or foot will be deleted.

HITACHI 79

Example

@@B$$ @@7T$$
NAM PGM
* REVISION
OTP M MEMORY FILE OPTION OPT 0 OUTPUT OBJECT TAPE OPT S SELECT PRINTING SYMBOLS ORG 8192 LDA B ADDR
@@SLD$$
© @OL$$
@@K$$ @@B$$
(J) @7T$$
NAM PAGM
* REVISION
OPT M MEMORY FILE OPTION OPT 0 OUTPUT OBJECT TAPE OPT S SELECT PRINTING SYMBOLS ORG 8192 COUNT EQU @8 @ INDICATES OCTAL
CD: Moves pointer to head of buffer.
@ : Displays 7 lines from the line indicated by the pointer
(1st line).
Q): Searches for "LD". Immediately moves pointer directly
behind "LD".
(6): Moves pointer to the head of the line.
G) : Deletes the line indicated by the pointer. @: Moves pointer to the head of the buffer. Ci) : Displays 7 lines from the line indicated by the pointer
(1st line).

80 HITACHI

-- Po~i~ nt~e~ r ~M~ov-e- me-n~ t

nL

3.6.10 nL (moving pointer by line units)

Function

Moves the pointer n lines

Explanation

(1) n is a decimal integer: -254~n~255.
(2) When n = 0, the pointer will not even move one line.
However, if the pointer is in a line, it moves to the head of that line.
(3) If n = 1, the pointer moves to the next line. However, if
the pointer is in a line, it moves to the head of the next line. (4) If n is a negative number, the pointer moves backward n lines.
(5) If n = -1, the pointer moves backward 1 line. However, if
the pointer is in a line, it moves to the head of the previous line (6) If n is omitted, or assumed to be "+L", it will be regarded
as equivalent to n = 1. If it is assumed to be 11-L" it will be
regarded as equivalent to n = -1.

c

t

I

pointer

a
i

t

I

b

1

I

a : pointer location at "OL"

b : pointer location at "lL"

c : pointer location at 11-1111

(7) If the number of lines from pointer location to the head or foot of input text is less than n, the pointer moves to the head or foot.

HITACHI 81

Example

(D @4T$$
NAM PGM
OTP M MEMORY FILE OPTION
OPT 0 OUTPUT OBJECT TAPES
OPT S SELECT PRINTING SYMBOLS
@ @3L$$
<ID @T$$
OPT S SELECT PRINTING SYMBOLS
© @-2L$$
@ @T$$
OTP M MEMORY FILE OPTION
@ @SM$$
(J) @T$$
M MEMORY FILE OPTION
@ @OL$$
® @T$$
OTP M MEMORY FILE OPTION
@
(D : Displays 4 lines from pointer location
(3) : Moves pointer down 3 lines
~ : Displays line indicated by pointer (4th line)
(3} : Moves pointer up 2 lines
~ : Displays line indicated by pointer (2nd line)
@) : Moves pointer 5 characters to the right (j) : Displays 1 line from pointer location
(8th and subsequent characters in the 2nd line)
{ID: Moves pointer to the head of the line.
~: Displays line indicated by pointer (2nd line)

Pointer Movement

nM

3.6.11 nM (moving pointer by character units)

Functions

Moves the pointer n characters.

Explanation

(1) n is a decimal integer: -254:Sn:S255.
(2) If n = 0, the pointer will not move.
(3) If n is negative, the pointer moves n characters to the

82 HITACHI

Example

left. (4) If n is omitted, or assumed to be "+M", it will be regarded
as equivalent to n = 1. If it is assumed to be "-M", it will
be regarded as equivalent to n = -1. (5) If the characters between the pointer location and the head or foot of input text are less than n, the pointer moves to the head or the foot.
Q)@4T$$ NAM PGM OTP M MEMORY FILE OPTION OPT 0 OUTPUT OBJECT TAPES OPT S SELECT PRINTING SYMBOLS
@@3M$$
Q) @_?!$$
PGM OTP M MEMORY FII.E OPTION @0-1T$$ NAM \I)@5M$$ @@T$$_ OTP M MEMORY FILE OPTION
Q) @-1M$$_
@@T$$
@
Q) : Displays 4 lines from the line indicated by the pointer (in
this case, the 1st line). Q) : Moves the pointer 3 characters to the right.
G) : Displays from the pointer location to the next line. @ : DispLiys from the head of the buffer to pointer location. <2) : Moves the pointer 5 characters to the right. <.§:>: Displays the iine indicated by the pointer. (j): Moves the pointer 1 character to the left (in front of@.
@ : Displays @and@ only.

HITACHI 83

Editor Control

nN

3.6.12 nN (repeaL command execution)

Functions

Repeatedly executes a command n times after command request or previous N command. Actually executes the command a total of n + 1 times.

Explanation

(1) n is a decimal integer: n~255. (2) If n = 0, there is no repeat; the command will be executed only once. (3) Negative signs ( - ) are ignored, the numbers are regarded as positive. (4) If n is omitted, or assumed as "+N", it is regarded as equivalent ton= 1. (5) If the N command is keyed in more than once in the same command string, the execution will be as in the following diagram.

Example

I@ a

I I b

10N 1$$

a : Repeated 5 times by N command in(!). b : Repeated 10 times by N command in~

(6) If the buffer is filled during execution of the N command and the specified number of repeats cannot be performed, the message "CAN'T CONTINUE" will display and repeats will stop.

(J) @B9LT$$
LDA B #COUNT IMMEDIATE ADDRESSING
@ @CADDRESSING$ADR$3N$$
Q:}@B916T$$ LDA B #COUNT IMMEDIATE ADR BACK LDA A lO'DIRECT ADR CMP A 2,X INDEXED ADR BEQ FOUND RELATIVE ADR

84 HITACHI

DEX IMPLIED ADDRESSING DEC B ACCUMULATOR ONLY ADDRESSING
@
Q): Moves pointer to the 10th line from the head of the buffer.
@: Searches for "ADDRESSING." Then executes the processing,
once, to replace "ADDRESSING" with "ADR." Then executes the same process three times.
@: Moves the pointer to the 10th line from the head of the
buffer and displays 6 lines.

Text Input/Output

nP

3.6.13 nP (outputting text)

Function

Outputs n lines of buffer content to paper tape beginning at
the line indicated by the pointer. Lines output are deleted from the buffer.

Explanation

(1) n is a decimal integer: -254~ns255. (2) If n = 0, there is no execution. But, if the pointer is in a line and output, the line, from the head to the pointer location, will be deleted from the buffer. (3) If n = 1, one line is output and deleted from the buffer. But if the pointer is within a line, the line, from pointer location to~, will be output and deleted from the buffer. (4) If n is negative, n lines above the location indicated by the pointer will be output and deleted from the buffer. (5) If n = -1, 1 line back will be output and deleted from the buffer. But if the pointer is within a line, that line, from the head of the above line to pointer location will be output and deleted from the buffer. (6) If n is omitted, or assumed to be "+P", it will be regarded as equivalent to n = 1; if it is assumed to be "-P" it will be regarded as equivalent to n = -1.

HITACHI 85

c

Examples

a

b

a output by "OP" b output by "lP" c, a : output by 11-lP"

(7) If the number of lines from pointer location to head or foot of the input text is less than n, the lines from the pointer location to the head or foot will be output and deleted from the buffer. (8) The following operations differ according to whether the J command is executed.
(a) When not executed: (i) Execute the P command. "PUNCH ON?" displays. At this point, turn the output device switch on and key in any characters other than {filfil, @ED or a:!) The only output will be the specified number of lines, the keyed-in characters will not be displayed. (ii) When the tape stops, turn the output device switch off. Key in any characters other than W@, am!) or(!;!). The text editor will enter command request status and "@" will be displayed.
(b) When executed: Execute the P command. The number of text lines
specified will output immediately and the editor will enter command request status.

Q) @B5T$$
NAM PGM OTP M MEMORY FILE OPTION OPT 0 OUTPUT OBJECT TAPES OPT S SELECT PRINTING SYMBOLS

86 HITACHI

ORG 8192 @@3P$$
PUNCH ON? @@B5T$$
OPT S SELECT PRINTING SYMBOLS ORG 9182 LDA B ADDR COUNT EQU @8 @ INDICATES OCTAL START LDS #STACK IN STACK POINTER @)@2LT$$ LDA B ADDR
C2) @-2P$$
PyNcH ON? @@B5T$$
LDA B ADDR COUNT EQU @8 @ INDICATES OCTAL START LDS #STACK IN STACK POINTER
LDX ADDR LDA B # COUNT IMMEDIATE ADDRESSING
@
(D: Displays 5 lines from the head of the buffer.
~: Outputs 3 lines from the location (1st line) indicated by the pointer.
Q) : Displays 5 lines from the head of the buffer and confirms
that they were output.
@) : Moves the pointer 2 lines down and displays line indicated
by the pointer. ~ : Outputs 2 lines previous to the line indicated by the
pointer.
(§) : Displays 5 lines from the head of the buffer and confirms
that they were output.
HITACHI 87

Pointer Movement

Sstring

3.6.14 S string (searching for a character string)

Function

Searches for the first character string which appears that is equal to "string".

Explanation

(1) Begins the search from the pointer location, and ends when the system enters a different status. (a) When a character string the same as "string" is found:
The pointer locates itself after the final character in the string. The text editor displays "@" to request a command. (b) When the search is completed to the end of text in the buffer and "string" is not found: The message "CAN'T FIND "string"" and "@" for command request are displayed. If an equivalent string cannot be found, the pointer will not move. (2) "string" consists of not more than 16 characters in ASCII
code. It does not include the words (fil9 or ©REMO.

Example

Q @B$$
@ @SOPT S$$ Q) @T$$
OPT S SELECT PRINTING SYMBOLS @@SOTP$$
CAN'T FIND "OTP"
G) @B$$
@@SOTP$$ (}) @OL$$
@ @T$$
OTP M MEMORY FILE OPTION
@
CD: Moves pointer to head of buffer.
@ : Searches for "OPTt.S".

88 HITACHI

Since "@" requesting the next command is displayed, we know that "OPT6S" was found and the pointer moved to the location behind it.
Q): Displays 1 line from location indicated by pointer. @ : Searches for "OTP".
Since "OTP" does not exist between the pointer location and the end of input text, the editor displays "CAN'T FIND "OTP"" and requests the next command.
(SJ: Moves pointer to head of buffer. @: Searches for "OTP".
Since 11 @" requesting the next command is displayed, we know that "OTP" was found and the pointer moved to a location behind it.
(j) : Moves pointer to head of line. @: Displays line (containing "OTP") indicated by pointer.

Text Input/Output

nT

3.6.15 nT (displaying text)

function

Displays n Jines of buffer content from the location indicated by the pointer.

Explanation

(1) n is a decimal jnteger: -254sns255. (2) If n -- 0, no execution will be performed. However, if the pointer is within a line, the line will be displayed from the head to the pointer location. (3) If n = 1, one line is displayed. However, if the pointer is within a line, the line from pointer location to(QD will be displayed. (4) If n is ~egative, n lines above the pointer will be dis-
play~d.
(5) If n = -1, one line above will be displayed. However, if the pointer is within a line, the line from the head of the above line to the pointer location will be displayed.

HITACHI 89

Example

(6) If n is omitted, or assumed to be "+T", it will be regarded
as equivalent to n = 1; if it is assumed to be "-T" it will be regarded as equivalent to n = -1.

c

pointer

t a

b

a b c, a

displayed by "OT" displayed by "lT" displayed by 11-lT"

(7) @is assigned after@. (8) The pointer does not move. (9) If the number of lines between the pointer location and the head or foot of input text is less than n, all input text up to the head or foot will be displayed.

(D@ST$$ OPT S SELECT PRINTING SYMBOLS ORG 8192 LDA B ADDR
COUNT EQU @8 @ INDICATES OCTAL START LDS #STACK IN STACK POINTER @@OT$$ @@-10T$$ NAM PGM OTP M MEMORY FILE OPTION OPT 0 OUTPUT OBJECT TAPES @@T$$
OPT S SELECT PRINTING SYMBOLS
@

90 HITACHI

(!):Displays 5 lines from the pointer location. In this
example, the pointer is at the head of the 4th line. ~: Displays no lines.
Q): Since the number of lines from the pointer location to the
head of the buffer is less than 10, all those lines are
displayed. ~: Displays line indicated by pointer.

Editor Control

x

3.6.16 x (ending edit operations)

Function

Moves control to monitor

Explanation

(1) If editing operations have ended or you want to cancel them, execute the X command to put the monitor in command request status.

Example

CD @X$$
I
Q): Key in the X command during editing, or when edit
operations terminate. This cancels text editor execution and
puts the monitor in command request status.

Pointer Movement

z

3.6.17 z (moving pointer to end of input text in buffer)

Function

Moves pointer to end of input text.

Example

(D @T$$
NAM PGM @@Z$$ @@-1T$$
END @

HITACHI 91

(D: Displays lines indicated by pointer (in this case, the 1st
line). (?):Moves pointer to end of input text.
{l): Displays the line above the one (last line) indicated by
pointer.
3.7 Serial Execution of Commands You can execute commands serially using the text editor. To do this, key
in the commands (more than one, of course) and then key®£) in twice. Observe the following precautions: (1) When a new command is entered after the character string in a C, I or
S command, key in~once to separate the character string and subsequent command.
(2) The command string will be executed in sequence from left to right. If there is an error in one command string, subsequent commands will not be executed.
(3) At a certain point during serial key-in, a bell will ring and the following message will be displayed. The bell will not ring in some console I/O units.
@IABCDE
** BUFFER NEAR END
FGHIJKLMNOPQR
~~Will not be accepted when keyed in. Only 12 more characters can be keyed in when this message appears. Message appears when this character is keyed in.
92 HITACHI

When the message is displayed, you can only key in 10 characters with the exception of the 2~ for executing the command. If you attempt to key in

any more, they won't be accepted. You will have to key in® or W) to delete

part of the commands and then execute. But, be careful when using a C, I or S

command, a situation may arise where you are unable to input in the middle of

text. If you execute without rectifying the situation, the desired processing

in the following example cannot be performed.

(Example)

@IABCDEFGHIJKLMNO

** BUFFER NEAR END

PQRSTU$COTP$$

@

~You cannot key in beyond

this point.

An attempt was made to replace "OPT" with "OTP" by keying in "ESC OPT" after "OTP" in the C command. But the C command was discontinued due to a full buffer and "OTP" was deleted.
Figure 3-9 is an example of serial command execution.
(D@B8T$$ NAM PGM OTP M MEMORY FILE OPTION OPT 0 OUTPUT OBJECT TAPES OPT S SELECT PRINTING SYMBOLS ORG 8192 LDA B ADDR COUNT EQU @8 @ INDICATES OCTAL START LDS #STACK INZ STACK POINTER

@@2MH$0LTCS$$ NAM PGM

HITACHI 93

® Q) @SLD$0LKS@$DI9"'93$0LTCOTP$0PT$$
COUNT EQU @3 @ INDICATES OCTAL
CAN'T FIND "OTP"
@@BTSOTP$0PT ~
G) @BCOTP$0PT$BLiti*6REVISION61 @
$SSYMBOLS$-7MIOF6$$
@@B8TE$$ NAM PGM * REVISION OPT M MEMORY FILE OPTION OPT 0 OUTPUT OBJECT TAPE OPT S SELECT PRINTING OF SYMBOLS ORG 8192 COUNT EQU @3 @ INDICATES OCTAL START LDS # STACK INZ STACK POINTER
PUNCH ON?
Figure 3-9 Example of Serial Conunand Execution Key to Figure 3-9:
CD Displays 8 lines from the head of the buff er
(V 2M .·....·... Moves pointer 2 characters to the right.
I6$ .·..··... Inserts blank space into location indicated by pointer. OL ...···.... Moves pointer to the head of that line. T···.··.··.. Displays that line. CS ..····.·.. Deletes "S" in "TAPES."
@ SLD$ ....·... Searches for "LD" and moves the pointer behind it.
OL ··...·.... Moves pointer to the head of the line. K··..··..... Deletes one line indicated by pointer.
94 HITACHI

S@$ ········· Searches for"@" and moves the pointer behind it.

D··········· Deletes

8 11 11 ·

I@3$ ····.· "9" is deleted by@ since it was keyed in incorrectly. "3" is

then inserted.

01 · · . . . . · . . · Moves pointer to head of line.

T····.······ Displays line indicated by pointer.

COTP$0PT ···· Searches for "OTP" to replace it with "OPT". But, there is no

"OTP" between the pointer location and the end of input text in

the buffer and "CAN'T FIND "OTP"'' is displayed.
@ The command string is deleted by ~and not executed.
~ B···....·.·· Moves pointer to head of buffer.

COTP$0PT$ ·.. Searches for "OTP" to replaces it with "OPT" The pointer

moves directly behind the found location.

B..·......·· Moves pointer to head of buffer.

L..·.·..··.· Moves pointer to head of next line. I6*6REVISION6~

......·..·· Inserts "6*6REVISION61 <C:ID" into the location indicated by

the pointer. When inserting a line in this way, put a Ci)at

the end of the text.

SSYMBOLS$ ... Searches for "SYMBOLS" and moves the pointer to a location

immediately after "SYMBOLS".

-7M ·...····· Moves the pointer before "SYMBOLS".

,IOF6 ·...··.· Inserts "OF6" into location indicated by pointer.
@ B..·...··.·· Hoves pointer to head of buffer.

8T ....··.·.· Displays 8 lines from the pointer location.

E·.·.......· Copies buffer content and remaining text. Ends text editing

operations.

HITACHI 95

3.8 Text Editor Messages

Table 3-2 lists text editor messages.

Table 3-2 Text Editor Messages

Cate_g_or_y_

Messa_g_e

Meaning

Execute Control Message

6301 TEXT EDITOR v.r

The head is displayed when control passes to the text editor. v stands for version number, r for revision number.

@

Indicates that the system is in

command request status.

Error Message

"x" ????

Incorrect characters for a command were keyed in.

CAN'T FIND "string"

Specified character string can not be found.

CAN'T CONTINUE

The buffer was filled during N command execution and further processing cannot be performed.

Warning Message

Bell rings
** BUFFER NEAR END

12 characters can be entered before buffer is filled.

96 HITACHI

3.9 Text Editor Commands

Table 3-3 is a complete list of commands in the text editor.

Table 3-3 Text Editor Commands

No. Cate_gorx

Command

Maior Function

Section

1

Text

Input/

Output

A

Inputs text from paper tape. 3. 6.1

E

Ends edit operations and

3.6.5

creates output tape.

nP

Outputs text in ·line units 3.6.13

nT

Displays text in line units 3.6.15

F

Outputs feed

3.6.6

2

Pointer

Movement

B

Moves pointer to head of

3.6.2

buffer

nL

Moves pointer in line units 3.6.10

nM

Moves pointer in character 3.6.11

units

Sstring
z

Searches in buffer for character string and moves pointer to location after string.

3.6.14

Moves pointer to end of text 3.6.17 in buffer

3

Edit

Cstring1$string2 Replaces one character

Operations

string with another.

3.6.3

nD

Deletes text in character

3.6.4

units

I text

Inserts text

3.6.7

nK

Deletes text in line units 3.6.9

4

Editor

Control

nN

Repeats execution of a

3.6.12

command string

x

Ends text editor

execution

3.6.16

J

Selects output device

3.6.8

HITACHI 97

Appendix

A HD6301 and HD6801 Executive Instructions

Table A-1 lists the executive instructions for the HD6301 and Table A-2

lists them for the HD6801.

**Explanation of symbols and abbreviations used in the appendix**

(a) Operation symbols

() =indicates content, e.g.,

V =logical OR

(ACCA): content of accumulator © = exclusive OR

ACCA.

+ arithmetic addition

+ send direction

arithmetic subtraction

A logical AND

(b) Abbreviation symbols

OP operation code (hexadecimal display)

number of MPU cycles

# number of bytes in an instruction word

(c) Symbols for register in MPU

ACCA accumulator A

PC program counter, 16-bit

ACCB accumulator B

PCH upper 8 bits of program counter

AC CAB
cc

double accumulator condition code register

PCL lower 8 bits of program counter SP stack pointer, 16-bit

IX

index register, 16-bit

SPH upper 8 bits of stack pointer

IXH

upper 8 bits of index

SPL lower 8 bits of stack pointer

register

IXL

lower 8 bits of index

register

(d) Memory and address fo{mat

M

= storage address

IMMED immediate addressing

98 HITACHI

M + 1 storage address + 1

DIRECT direct addressing

to storage address M

MSP

storage address indi-

INDEX index addressing

cated by pointer

MSP+l storage address which

EXTND extended addressing

adds 1 to storage ad-

dress MSP indicated by

stack pointer

MSP-1 storage address which

RELATIVE relative addressing

subtracts 1 from stor-

age address MSP indi-

cated by the stack

pointer

(ri)

complement of 1 in con-

IMPL implied addressing

tent of storage address

M

Disp displacement = M - (X)

ACCX accumulator addressing

IMN

immediate value

Mi

i bits in storage ad-

dress M (i = 0-7)

(e) Meanings of bits 0 to 5 in the condition code register

c carry and borrow

N display if negative

v overflow display if 2's complement I interrupt mask

z display if zero

H carry from bit 3 to bit 4

(half carry)

(£) Symbols indicating changes in condition code register content R = reset at any time

HITACHI 99

S = set at any time
t set if true after test, anything else, clear
0 no change by that instruction (!)-©= set if true after test. Anything else, clear. Items 1 to 9 are
explained below (]). ·· result 10000000 (binary display) ~ ·· result ~ 00000000 (binary display) ?
Q). .. upper order 4 bit BCD (binary code decimal) display greater than 9?
~ ·· operand 10000000 (binary) ? (before execution)
G}. ·· operand 01111111 (binary) (before execution)
@. ·· NG) C = 1 after shift? (i). .. highest order bit= l? (after execution) (ID. .. was there an overflow when subtracted (addition of 2's
complementary)
® .. resul t4'0?
~=loads from stack into condition code register
@ = set when interrupt occurs
'1])= set according to content of accumulator ACCA
100 HITACHI

Table A-1 HD6301 Executive Instructions

Type

Mnemonic Code

Operation Content

Logic/Arithmetic Operation

:>-, 11! ..0..,
l1l i:: A 0 ·.-1.., <J·.-1 11! ..0
'° HI
Qi:)>,.--<
g 0
r---i

'j

l1l

..,H
Q)

~

0
"'·.-1 u ()()

..,pQ::)
·.-1 ..0

..,·.-1 ...~c.,:

I

·.-1

00
:>-.

< H

..0

i::
..,0
·.-1
l1l H
Q)
i:i. 0

ADDD MUL SUBD
ABX
ABA ADCA ADC B ADDA ADDB SBA SBCA SBCB SUBA SUBB

Double Add without carry Mu I t i p I y u n s i gn e d Doub I e Subtract w'i t ho u t c a r r y Add Acmltr B to Index Reg Add Aerni t rs
} Add wi th ca r r y
} Add
Subtract Acmltrs
} Subtract with carry
} Subtract

(ACCAB)+{M: Mt-1 )--¥\CCAB (ACCA)*(ACCB)--,\CCAB (ACCAB)-(M:Mt-1)--,\CCAB
(IX)+(ACCB)-+IX
(ACCA)+(ACCB)--,\CCA ( ACCA}+-(M)i-( C)-ACCA (ACCB)+(M)+(C )-+ACCB (ACCA)+(M)-+ACCA (ACCB )+ ( M}--+ACCB (ACCA)-(ACCB)-+ACCA (ACCA)- (M)-( c;)-.ACCA (ACCB)-(M)-(C)-+ACCB (ACCA)-(M)-+ACCA ( ACCB )- ( M}--+ACCB

Address Model

Condition Code

IMMED DIRECT

I'.'JDEX EXT ND

IMPL, A_c_(:x_

5

4

3

2

1

0

· - - - - - OP

+OP

+OP

+JP

· !:)p

H I Nzvc

C3 4 3 03 5 2 E3 6 2 F3 6 :~

·t t t t

· 3D 10 1·

t

· · · · 83 4 3 93 5 2 A3 6 2 B3 6 3

tt tt

·· ····· · 3A 3 1

· lB 2 1 t l t t t t

89 2 2 99 3 2 A9 4 2 B9 4 3

l tttt

C9 2 2 D9 3 2 E9 4 2 F9 4 3

t· t t t t

8B 2 2 9B 3 2 AB 4 2 BB 4 3

t ·t t t t

CB 2 2 DB 3 2 EB 4 2 FB 4 3 10 2
i · · 82 2 2 92 3 2 A2 4 2 B2 4 3
· · C2 2 2 D2 3 2 E2 4 2 F2 4 3 · 80 2 2 90 3 2 AO 4 2 B0 4 3
·· ·· co 2 2 DO 3 2 EO 4 2 FO 4 3

t· i t t t tt t t t t tt
·t t t t tt tt
tt t t

:I

~

Note: Execute instruction with an asterisk (*) to the right are for the HD3601 °

(')

~

0

-0
:"I'
~

C')

-:I

Type

Mnemonic Code

Operation Content

CLR

~ c
"'i...
<I)
i... 0.. <I) 0 +.J
..C..l.l c<I)
bl) 0
<I) .......
pc: c
+.J 0
..... ·r-f
..c +.J
"' I
00 i... <I)
:;.., 0..
..c 0
c (.)
0 ..... ..... +.J
~ ~ i... ..c
<I) +.J 0.. .....
< 0 i...·

CLRA CLRB DAA DEC DECA DECB INC INCA INCB NEG NEGA

} Clea.
Dec i ma I Adj us t, A
) Demmen I
) Increment
} C~pl ~en t. 2' S

NEGB (Negate)

Logic/Arithmetic Operation
00-+M 00-+ACCA 00-+ACCB Converts binary addition resultsto BCD (M)-1-+M (ACCA)-1-+ACCA (ACC B)-1-+ACCB (M)+l-+M ( ACCA)+l-+ACCA (ACCB)+l-+ACCB 00 -(M)--+M 00-(ACCA)-+ACCA 00- (ACCB )-·ACCB

Address ~de

Condition Code

IMMED DIRECT INDEX EXTND 1Mt'1ccx s 4 3 2 1 0

- - i··········· ······ - OP +OP

+OP 6F 6
6A 6 6C 6 60 6

+ OP 2 7F 6
2 7A 6 2 7C 6 2 -o 6

+OP 3
4F 2 SF 2 19 2
3
4A 2 SA 2 3 4C 2 SC 2 3 40 2 so 2

+H I N R

1 ·

R

1 ·

R

1

t

· t

1. · t

1· · t

·t
1. ·t · t

· t

1 ·t l· · t

z v c
S RR
s RR
S RR
t t@ t © t ©
t ©
t @
t ® t @
t ©® t ·:D ®
t ©®

C B A +.J
Cll
<I)
E-< CMPA

"cO
"c '

CMPB

.~ TST

i... TSTA
0..
5"' TS TB
CJ

Comp a re Aerni tr s } Compare
} Test.Zero or Minus

( ACCA )- (ACCB) (ACCA)-(M) (ACCB)-(M) (M)-00 (ACCA)-00 (ACCB)-00

11 2 1 · ·

81 2 2 91 3 2 Al 4 2 Bl 4 3

·

· Cl 2 2 Dl 3 2 El 4 2 Fl 4 3

· · 60 6 2 70 6 3

· · 4D 2 1 ·

·· SD 2 1.

tl tt t ttt
ll tt
t tRR t tRR
t t RR

Address Mode

Condition Code

Type Mnemonic Code

Operation Content

Logic/Arithmetic Operation

IMMED DIRECT INDEX EXT ND n;rr~cx 5 4 3 2 1 0

1-<"0 0 i::

ASLD~ Double Shift Left Arithmetic

i· · - OP * OP - * OP - * OP - * OP - * H I N z v c

05 3

t t® t

.u.u Ill ·.-<Ill Cl)
,t:>I-< .U.U I ClJ'+-<t'd
~g1~~

(LSLD} LSRD

(Logical Double Shift Left)
Double Shift Right
Logical

Cc H

111111111111111 l+O

b15

bo

I 0-l I I I I I I 11 I I I I I I I l+D

bis

bo (;

ASL

(LSL)

ASLA } Shd t L.r t A<i thme ti' (LSLA) (Logical Shift Left)

:} D·l llill 111-o

B C b1

bo

('L:SSLLBB)

I-<
~

ASR

l th~ ..<..l.l
C>O
~

Cl)
.u .Cud

....u.. p0:

"" .t:l
cIo

i:: Cd

l :;..,
.t:l

......u....

i::
..0...

..c:
(/)

.u

ASRA ASRB LSR LSRA LSRB ROL

Shi ft Right A<i

tic :} 1{11 I i1T1 I l·D

B

b1

bo C

Shift Right Logic·l

:}o·Uil!Ti I l·D

b1

bo C

B

Cd

I-< Cl) p.

ROLA ] Route Left

: ]Lci-1 I I I I I I I 1J

0
RO LB

B C b7 - - bo

ROR RO RA RORB

} Rot·t· Right

:}cD-1 I I I I I I I ~
B C b1 - - - bo

i· · 04 3

R t@t

68 6 2 78 6 3

t t@t

i·· · 48 2

·t t @ t

i· 58 2

t t®l

· 67 6 2 77 6 3

t t@t

· · 41 2 1 ·

t t@ t

ie · 57 2

t t@t

· 64 6 2 74 6 3

R t® t

i·· · 44 2

R t®t

i· · 54 2

R t® t

· 69 6 2 79 6 3

t t®t

i·· · 49 2

t t® t

i· · 59 2

·t t ® t

66 6 2 76 6 3

t l®t

i·· · 46 2

t t®t

i· · 56 2

·t t ® t

%

~

* Mnemonics enclosed in parentheses ( ) may be used in the 6301 Assembler

()
-%

0
(..)

0
~

:I
~

(')
-J:

r Type Mnemonic Code

Operation Content

A~DA
}-And ANDB

~
~

·..<

Oll

Q)

d

p..:,:

..,0
·..<

·..< co

,.0

~

I

Q)

00 0..

0

;>,
,.0 .~

..,d
-~

Oll 0 ...l

co
~ Q)
0.. 0

BITA B ITH COM COMA COMB EO RA EORB ORAA ORAB AIM*

} Bit Test
I
) CompJ,meot.l'S
} Exclusive OR
} or, Inclusive And Imrned i ate

OIM* EIM* TIM*

Or Immediate Exclusive 0 r
Immediate Test Immediate

T

Logic/Arithmetic

I

Operation

(At:CA) · (M)--->ACl'A ( ACCB) · ( M)--->ACCB (AC'CB) · (M) (ACCB) · (M)
I (M)--->M I ( ACCA )--->ACCA
I ( ACCB )--->ACCB
( ACCA) EB ( M)--->ACCA
(ACCB)(:f)(M)--->ACCB ( ACCA) ~)( M)-->ACCA (ACCB) C!)(M)--->ACCB (M) · I MM--M (M)C!) I MM--M (M)(f)I MM--+M (M) · I MM

1 NITT:-\1 Address Mode

/Condition Code

IMMED DI RECV!

EXTND ! IM~1cC'X 5

--
4

3

2

1

0

- - - - OP

* OP

* OP

- *OP

*OP

* H I N zv c

B4 2 2 94 3 i 2 A4 4 2 84 \ 4 3

I

·t t R.

·· · C4 2 2 D4 312 E4 4 2 F4 f 4 3

I

85 2 2 95 3 2 A5I 4 2 85 4 3

t t R. t l R.

· · 'C5 2 2 D5 3 2 ES 4 2 F5 4 3

i t R.

· · I · · I · · I

16 3 6 2 73 6 3

I

43 2 1

53 2 1

tl Rs t t R s
l l Rs

· · BB 2 2 9B 3

2 BB 4 3

t t R.

2Ar · · CB 2 2 DB 3 2 EB 4 2 F8 4 3 · · BA 2 2 9A 3 2 AA 4 2 BA 4 3 · · CA 2 2 DA 3 2 EA 4 2 FA 4 3
· · 71 6 3 61 7 3

t l R.
t t R. t t R.
t t R.

· · 72 6 3 62 7 3

t t R·

· · 75 6 3 65 7 3

t t R.

·· ·· 7B 6 3 6B 7 3

t t R.

.".,'

·..< d

.., ..,::d:>

0 ·..<

·..< co

>Q ~

.5 Q) 0.. 0

d
-..~,
co

.;::
Oll 0

~ ...l

Q)

0..

0

BCLR* BSET* BTGL* BTST*

Bit Clear Bit Set Bit Toggle Bit Test

0 --Mi 1 --+Mi Mi -+Mi Mi· 1

71 6 3 61 7 3 72 6 3 62 7 3 75 6 3 65 7 3 7B 6 3 6B 7 3

I

t t R·
·· t t R · · ·· t t R · ·· · l t R ·

Type Mnemonic Code

Operation Content

i:: Q'"O ..... i:: ..,.., t1l

·.-<<1l Q)

.DH '"OH

'°I QI t1l 0

......

op.

O'-' ...iu:i

LDD STD

Double Lo ad Acrnltr,A.B
Double Store Acrnltr,A.B

Logic/Arithmetic Operation
(M: M+l )->ACCAB (ACCAB)->M:M+1

Address Mode

Condition Code

I \!MED DI HECT I '.'<DEX EXTND TMA.~cx 5 4 3 2 1 0

- - - - - OP

'if OP

'if OP

'if OP

41- OP

'*' H I N z v c

cc 3 3 DC 4 2 EC 5 2 Ft: 5 3
DD 4 2 ED 5 2 ID 5 3

t l R·
···· l l R.

Q)
.0H.,
"'
'"Cl i:: t1l

..,H '"Cl

Q)

t1l

0

"' ...i
·.-<

b()

.p..Q..:.,:.)

LD AA LDAB STAA STAB

} Load Aerni tr. } Store Ac 111 I t r.

(M)-+ACCA ( \1 )-+ACC B (ACCA)-+M ( .\ \ 'C B ) --->M

86 2 2 96 3 2 A6 4 2 B6 4 3 C6 2 2 D6 3 2 E6 4 2 F6 4 3
97 3 2 A7 4 2 87 4 3 D7 3 2 E7 4 2 F7 4 3

· .1ei.~

t
l

R · R ·

· t t R·

···· .! + R.

.D I 00

:;.-., .D

i::

...0...,.

TAB

t1l

H
Q)

TBA

p.

0

I'S HA

'"Cl' i::

PSHB

Q)

"'

} 1' r an s f c r A cm I tr s.. } Push Data

(Al'<' A )--+A<T B
(ACCB)--+ACCA
tASCP)A-)-1--+-+MS SP I'
(ACCB)~SP
tSP)-1--SP SPHI-+SP

PULA } Pu I I Data
PULB

(MS P )--AC.CA (SP )-+-1--~P (MS P )--ACCB

l:

~

16 2
· · . 17 2 · · 36 3 ··········· 37 3

1 1 1 1·

t t R. t +R·

32 33

4 4

1 1

·· ·· ·· ·· ·· ··

(')

!

0
(Ji

0
°:%'
~

(')

-:I

Address Mode

Condition Code

Type Mnemonic Code

Operation Content

BCCW Branch If Carry Clear

Condition Determining Branch
(C) =O

RELATIVE INDEX EXT ND IMPL IIMXbtx
- CP -· + OP + OP - + OP - +OP - +
24 3 1

5 4 3 2 1 0
H I Nzvc
· · · · · ·

(BHS) (Branch If Higher of Same) BCS W Branch If Carry Set'

( C) = 1

25 3 2

· ···..··

( BLO)

.....

0
.1..-.1,

..c:
u

BEQ

i::
u 0

i:: <d

BGE

1-1

!§'

i:Q
.....

BGT

..;..:,l
..,
i:: <d

<d i::
..,...~..,
.,.;

B HI BLE

..c:
u i::

i:: u 0

BLS

<d

1-1

BLT

i:Q

BM I

B NE

BPL

BVC

r... <d

~

i:: ·....,
.., ..,0....;, i:: ..,.,.; <d

i:: ..c:
0 u u i::
:5 <d 1-1

i:Q

BVS BRA BRN NOP JMP

(Branch If Lower)

Branch If - Zero Branch If ~ Zero Branch If> Zero

(Z)=l
(N) EB (V) - 0
( Z ) 0 ( ( N )ffi( V ) ) = O

27 3 2 2C 3 2 2E 3 2

Branch If Higher Branch If ~Zero

(C) 0 (Z) = 0
( z) 0 CCN KBC v)) =1

22 3 2 2F 3 2

Branch If Lower or Same (C)0(Z)=l

23 3 2

Branch If < Zero

(N)EB(V)=l

2D 3 2

Branch If Minus

(N)=l

2B 3 2

Branch If Not Equal Zero (Z)=O

26 3 2

Branch If Plus

(N)=O

2A 3 2

Branch If Overflow Clear (V)=O

28 3 2

Branch If Over f 1ow Set CV)=l

29 3 2

BRanch Always BRanch Never

None

20 3 2

Advances only by PC+2 21 3 2

No Operation

Advances only by PC+l 01 2 1

Jump

} See (Note)

6E 3 2 7E 3 3

································································································

*Note: Mnemonics enclosed in parentheses ( ) may be used in the 6301 Assembler

Address Mode

Condition Code

%

Type Mnemonic Code

Operation Content

...k DEX
CIJ

<I) INX

,....,

·.-I Oil

...0
k

.:C.:I:J

LDX

c
u 0

:<
CIJ
"cti

STX

k H CPX

Q)

... +J k
.~ Q) DES

0 c

~ ·.-I 0

INS

..ruin.:
+J
.(../.)..
k

~
..urin.:
+J ti)

LDS STS

Q)

+J <I)

TXS

·.-I

Oil
.:Q.:):

TSX

:<
Q)

"cti

PSHX

c"O

Q)

H (/) PULX

Decrarent Index Reg lncrtment Index Reg Load Index Reg Store Indt'X Reg C<Jlllare Index Reg Decrment Stack Pointer Incr6"Tent Stack Pointer Load Stack Pointer Store Stack Pointer Ind·~ Heg-+S tack Pointer Stack Pointer-+ Index Reg Push Index Reg Pu! I Index Reg

XGDX* Exchang Aeon I tr D for Index Reg

k

Q).-<

+J 0 .....

<I) k
c .-I +J
00 Q) 0
i::i::u
Q)

0 k
c+J
u 0

"O
u 0

.4.::
i:t::i

c .3

.';::!

"cO

u 0

c Q)"tl
+J

~J;

CLC CL I CLV SEC SEI" SEV TAP TPA

Cle;ir Carry Clear Interrupt Mask Clear Overfla;v Set Carry Set Interrupt Mask Set Overt law .Acmltr A--+ CC Reg 00 Reg -+ AcmI tr A

Logic/Arithmetic Operation

(IX)-1-+IX

(IX)+l-+IX

( M)--.IXH, ( Mt-1 )--+I XL (~~p->M. (IXL)-+
(IXtlf-~M),(IXL) -( 1

{SP )-1-+S P

(SP )+1-+SP

(M}--->SPH,(M+-1 )-SPL

( SPH)-'M, (SPL}-M+-1

(IX )-1-+S P

t(SP)+l-+IX IXL~P; SP-1--+SP

IXH SP; SP-1-->SP

SP+-1-+SP; tMSP~

SP+l--SP; ~p

L

( ACCAB) - ( IX)

0-+C 0-+I 0-+V 1-+C 1-+ I 1-+V (ACCA)--iee (CC}--->ACCA

- . - - IMMED DIRECT

INDEX

EXT ND

lMt'L,
ACCX

5

4

3

2

1

0

OP + OP + OP -

OP + OP - + H I N z v c

09 3 1 ·
· · · · 08 3 1
· · · ·R·. CE 3 3 DE 4 2 EE 5 2 FE 5 3 · · R. DF 4 2 EF 5 ~ FF 5 3
· · SC 4 3 9C 5 2 AC 6 2 BC 6 3

l
t
® l
® t ® t®t

· · 34 3 1

· ·· · · · 31 3 1 · · · · ·R·. 8E 3 3 9E 4 2 AE 5 2 BE 5 3
· · R. 9F 4 2 AF 5 2 BF 5 3
· · 35 3 1.

® l
:ID t

·· · ·· 30 3 1

· · · ··· 3C 4 1

· · · · ·· 38 5 1

i·· ······ ···· 18 2

oc 2 1
·· ··· OE 2 1 · · · · OA 2 1 ·· · · 00 2 1 · ···· OF 2 1
·· · ····· OB 2 1

R ·
s ·

R
R ·
s
s ·

06 2 l@ @ @ @ @ @

· · · · · 07 2 1

·

~

'-----'---

-(')
%

0
"

0 00

:t
~

(')

!

Address Mode

Condition Code

Type

Mnemonic Code

Operation Content·

QJ

·= ... Q,
E,.... ....

0

BSR

1->t::i 0 0::l"..".. JSR

~.,gu

.":a:"l(i

:: .0 )

Cll

RT

S

~ .µ
ll..-< RT I
::l 0

"""" i::

1-1 QJ

.._. i::

SWI

"'~ .µ 0

.s (.) WAI

SLP*

Branch To Subroutine JumpTo Subroutine Return From Subroutine Return From Interrupt Soft Wire Interrupt W\i t for Interrupt Sleep

Conditions Determining Branch
(See Note)
(See Note)

RELATIVE DIRECT INDEX EXT ND IMPL 5 4 3 2 1 0

- - - - OP -· + OP + OP + OP + OP + H I
SD 6 2
· · · · · · 9D 5 2 AD 6 2 BD 6 3 ············ 39 5 1

Nzv c

3B 10 1 @ @ @ @ @ @

3F 12 1
· ··· 3E 9 1 ··· ········ lA 41 1

s ·
@

i

(Notes)

(1) JSR

DIRECT

PC Main Program

SP

Stack

PC

-I

n+~ S:::~~:ine

~ ~M ::-: f----(-n_+_2_)_H_ _ c = = )

~ess M (8 bit)

- f-----------i

Subroutine
Next Execution Ins true tion

{ n+2 Next Instruction

SP

(n+2) L

M=$00~~SFF

'---------'
(n+2)H and (n+2)L are the upper and

lower order 8 bits of n+2

PC Main Program

AD=JSR

INDEX { n+:

D=Disp

SP _,. SP-2
L) SP-1

Stack (n+2) H

PC

Subroutine

c==) X+D ~_I_Nnse_x~ttr_Eu~xce~tc~ui~toi~onn~--<

n+2 Next Instruction

SP

(n+2) L

D=8 bit Unsigned Value

(n+2)H and (n+2)L are the upper and
lower order 8 bi ts of n +z

EXT ND (2) BSR

PC Main Program

SP

Stack

PC

Subroutine

n

BD=JSR

-+ SP-2

Subroutine Addr<>ss n+l SH(upper order8bit ~ SP-1

(n+3) H

~s

Next Execution Ins true t ion

n+ 2

SubroutineAddress1 SL(lowerorder8bit)

'--v'

I n+3 Next Instruction

SP

(n+3) L

S is composed of SH and SL

(n+3)H and (n+3)L are the upper and lower order 8 bits of n+3

PC Main Program

n

8D=BSR

n+l

±D=Disp

SP
_,. SP-2
¢ SP-1

Stack (n+2) H

PC

Subroutine

~ n+2±D ~I_Nn_se_tx_tr_uE_c_xte_ic_ou_nt_ion__.

n+2 Next Ins true tion

SP

(n+2) L

D=7 bit Signed Value

n+2 is formed from (n+2)H and (n+2)L

(3) JMP PC
l~EXj n+:I

Main Program

6E=JMP D=Disp

j

x+D NInexslt:ruEcxteicountion

(4) RTS PC
s

Subroutine 39=RTS
IQ

SP SP SP+l SP+2

PC

Main Program

l 7E=JMP n+: Dtt=next address
n+2 D1=next address
~-------~
D ~N~e-x_t_E_x_e-cu_t_i~o-n~
~I=n=s~t=r~u=c=t=io=n~-

Stack

PC

Main Program

L ~ ~ n

Next Execution Instruction

The values PC

(and PC1 are ~l~oa_d_e_d.,---M-a_i_'n_f_o_r_m_e_d. from

from PC into the

stack and then

PCH and PCL

returned to main)

HITACHI 109

(5) RT!

PC Interrupt Program

SP

s

3B=RTI

1¢ SP

SP+l

SP+2

SP+3

SP+4

SP+5

SP+6 SP+7

Stack
cc
ACCB ACCA
IXR IXH PCH PC1

PC Main Program

-~--J-' --v n ~NIe:gxsttruEcxtei<Q;un__t_i_o__n _

Returns 'to n+l

main after loading all

.

_____J

n is composed of

information PCH and PC1

in stack into each register

(6) SWI

PC Main Program

n

3F=SWI

¢-+

n+l Next Instruction

PCH: upper order 8 bit of n+l PC1 : lower order 8 bit of n+l

SP Stack
.----SP-7

SP-6

cc

SP-5
I--
SP-4
SP-3
SP-2

ACCB ACCA IXH IX1

PC Interrupt Program

'-----------> l s
Goes to inter-

NInesxttruEcxtie9cIu!_ti_o_n__
1

rupt program ex~e- c- u---- S-i- s-- th- e-a'ddress

tion after saving

indicating SWI

information from all interrupt-vector-

registers in the address content

rack

SP-1

PCH

1---------

SP

PC1

(7) WAI

PC Main Program

SP Stack

n

3E=WAI

¢-+ SP-7

n+l Next Instruction

SP-6

cc

'----=> 1i::rrupt~e~~-1
L __ _ _ _ _ _J

PCH: upper order 8 bit of n+l PC1: lower order 8 bit of n+l

SP-5 SP-4 SP-3 SP-2 SP-1

ACCB

Queues interrupt

ACCA

after saving information from all registers in stack

IXH

--

IX1

j

PCH

SP

PC1

(8) SLP

PC Main Program

Location of stack indicating value of SP after execution of each instruction

n

lA=SLP

n+l Next Instruction

'------> CPU functions stop with

Interrupt Queue

all internal register

statuses on hold

F flag set by maskable

interrupt: n+l--+ PC

Non-maskable interrupt or F flag reset: vector address-+ PC

l 10 HITACHI

Table A-2 6801 Executive Instructions

Type Mnemonic Code

Operation Content

Logic /Arithmetic Operation

£ <llTu ADDO

t:: ~ ~~ §
..0.. p Q13l·..-.<.,

MUL

~ .':::1.5~ SUBD

H ..0 .-< Q)
~~ ~gJ ABX

Doub I e Add w1 thou t carry Mu I t i p I y u n s 1 gn e d
Doub I e Sub t r a c t without carry
Add Acmltr B to Index Reg

(ACCAB)+{ \1: \H-1 "H\Cl'AB (ACCA) t (A<'CBK('{'AB (ACCAB)-(M:\H-1 }-oACCAB (1 X)+(ACCB)--.JX

ABA

Add Aerni t rs

H

Q)
.~... b[)
<ll ~
.......,
..0

...0.t.:..:,
<ll
H Q)
0.

~Add A.DC A

with carry

ADCB

l ADDA Add
ADDB J

I 0

CX)

~
..0

...~.,

SBA

Subtract Acmltrs

t::
..3..,

..~c: .';:::

<ll
H

< H

Q)

0.

0

SBCA } Subtract with carry
SBCB
SUBA } Subtract

SUBB

(ACCA)+(ACCB)--io\CCA ( ACCA )+(M)+( C )--ACCA (ACCB)+(M)+(C )-+ACCB (ACCA)+(M)-+ACCA ( ACCB )+ ( M}-+ACCB (ACCA)- (ACCB)~ACCA (ACCA) · (M)-(C:)--ACXJA (ACCB )- (M)-( C )-+ACCB (ACCA)- (M)-+ACCA ( ACCB )- ( M}-+ACCB

Address Mode

Condition Code

IMM ED DIRECT

I .~DEX EXT.'\ID

IMPL, AC<'X

5

4

3

2

1 0

- - - - - OP

ot OP

· ()f'

ot JP

ot JP

+H l Nzvc

C3 4 3 D3 5 2 E3 6 2 F3 6 ;{
· · 30 10
i· · · · 83 4 3 93 5 2 A3 6 2 B3 6 3

t t l l
·t tt tt

·· ···· · · 3A 3 1

· 18 2 1 t t t t t t

89 2 2 99 3 2 A9 4 2 B9 4 3

t tt tt

C9 2 2 09 3 2 E9 4 2 F9 4 3

t· t t t t

88 2 2 9B 3 2 AB 4 2 BB 4 3

t ·i t t t

CB 2
82 2 CZ 2 80 2
co 2

2 DB
2 92 2 02 2 90 2 DO

3
3 3 3 3

2 EB
2 A2 2 E2 2 AO 2 EO

4
4 4 4 4

2 FB 4
2 82 4 2 F2 4 2 B0 4 2 FO 4

3 10
3 3 3 3

2

i·t· f l ·t t t t ·· t t ·· t t ·· ·· t t

t t
t t
t t t t t t t t

%
~
(')
:E

"-.:>

l:
~

-(')
:I

Type Mnemonic Code

Operation Content

Logic/Arithmetic Operation

Address Mode

Condition Code

I MMED I DI RECT I I ND EX I EXT ND I IMPlccx 51413121110

+ OPl-1 +IOPl-1 +IOPl-I IOPl-l +IOPl-1 +IHI I IN I Z I VIC

CLR
]' C L R A
l ~ CL RB
13' DAA
ai
I § D E c

CI ear Decimal Adjust, A

~
·~

§
·~
~

DEC A DEC B I NC

l Decrement

~
~
I
:

.~
i
..C:
·~

INCA I NC B N E G

l Increment

~ < N EGA

Complement,2°S

";:! co ~
0 ~ ~ ]

NEGB

(Negate)

CBA

Ccmpare Acmltrs

CMPA } Ccmpare
c Mp B I

: T ST
.~ TSTA
'~"' T S T B
Ilu~ I

}

.

Test.Zero or Minus

0 0-+M 0 0-+ACC A
(00-+ACCB
Convarts binary addition results to BCD
M) - 1->M
((ACCA)-1-+ACCA
(ACCB)-1-+ACCB
M)+ 1->M (ACCA)+l-+ACCA ( ACCB )+1->ACCB OO- ( M)-+M 00-(ACCA)-+ACCA 00-(ACCB)-·ACCB (ACCA)-(ACCB) (ACCA)-(M) ( ACCB )-(M) ( M)- 0 0 (ACCA)-00 ( ACC B )- 0 0

6F 16 2 7F 6 3

· · RS RR

4F 2 1 · · R S R R

SF 2 1 · · R S R R

19 2 1 · · f l f @

6A 6

2 7A .6

3 4A 2 SA 2

· · l l ©·
1 ·· t t ~ ·
t 1 · · f @ ·

@. 6C 6 2 7C 6 3

· · f l @·

t 4C 2 1 · · f

SC 2 1 · · f t .@ ·

60 6 2 o 6 3

· · t t CD @

40 2 1 · · J t CD®

SO 2 1 · · t t CD@

11 2 1 · · t t t t

81 2 2 91 3 2 Al 4 2 Bl 4 3

·· t t t t

Cl 2 2 Dl 3 2 El 4 2 Fl 4 3

·· t t t t

60 6 2 7D 6 3

· · ttRR

I

t t 40 2 1 · ·

R R

SO 2 1 · · f l R R

I

Type Mnemonic Code

Operation Content

Logic/Arithmetic Operation

1 Address Mode

Condition Code

IMMED DIRECT INDEX EXT ND IMfE"cx 5 4 3 2

0

~§I

A S L D(tt~~oub I e Shift Left
Arithmetic

1 . · t - OP - '*' OP - '*' OP - '*' OP f OP - + H I N z v c

05 3

t® t

l~ (LSLD)

M o:I <+-lo:!

..0~ ·M+J
i.J..>...lc0u.C..Jc):o~

L S RD

(Logical Double Shift Left)
Doub I e Shi ft Ri gh t
Logical

c[J.j

I b1,

11

I

I

I

11

I

I

I

I

I

I I I +O
bo

o..i I 111111111111 I I l+D

b.,

bo (;

1. · 04 3

R t®t

~ Cl)
.....
<ll ·M
00

AS L(tt)

( LSL)

ASLA } Shi ft Ldt Ad thmetie

t: l (LSLA) LSSLLBB) ASR
ASRA

(Logical Shift Left) Shift Right A'ith=lie

.C...l).

fl AS RB

:1 D·I 1Ti11111-o

B C b1

bo

:} C?11llT111·0

B

b1

bo C

~ ~

c ..... 't:l
·M

..0 o:I

I 00

.....

<+-!

..c: :;.., "M
..0 C/)

c

0

·.M....

o:I

~

LSR LSRA LSRB ROL ROLA

]Shift Right Logi<'I
l Roi.te Left

:10~! I I !!Ti I l+D

I B b1

bo C

: ]Lo--1 I I I I I I I ~

Cl)
c:>.

RO LB

B C b" - - bo

0

ROR RO RA } Rot"e Right

~ : }cIJ--1 I I I I I I I

RORB

B C b1 - - - bo

68 6 2 78 6 3
1·. 48 2
58 2
i · 67 6 2 77 6 3 · 47 2
1i·.57 2
64 6 2 74 6 3
1·. · 44 2 1. · 54 2 · 69 6 2 79 6 3
1·.49 2
I
59 2
i · 66 6 2 76 6 3
· 46 2
1i·.56 2

·t t ® t
·t t ® t ·t t ® t
·t t ® l ·t t @ t ·t t ® t
R t® t
R t :'ID t R t® t
·t t ® t ·t t ® t et t ® t
·t t ® t ·t t ® t ·t

I ®1 t-

%

~

* Mnemonics enclosed in parentheses ( ) may be used in the 6801 Assembler

()
-..%......

(..)

~

:t
~

()

!

Type I

Mnemonic Code

Operation Content

i... <U
..~...

... ... 00
p<,U;

c
.~

..... <ti

.0 I CX)

M <U i:i. 0

:»
.0

.~

...c
.~

00 0 ....l

<ti i... <U i:i. 0

ANDA AND8 8 IT A 8 ITH COM COMA COMB EO RA EOR8 ORAA OHA8

}.And } 8 it Test } Complement,l'S } Ex c l us i v e OR } Or.Inclusive

c <U

0
...·.-l

M
.0..

LD0

<ti Cl)

i...

c <U 't:l
i:i.

STD

...0

<ti

't:l

Double Lo ad Acmltr,A.B
Double Store Acmltr,A.B

Logic/Arithmetic Operation
(ACCA )A( M )-+ACCA ( ACCB )/\( M)-+ACCB (ACCB)/\(M) (ACC8 )/\(M) (M)-+M (ACCA)-+ACCA ( ACC8 )-+ACC8
( ACCA) EB ( M)-+ACCA ( ACC8) EB ( M)-+ACCB ( ACCA) V ( M)-+ACCA
(ACCB)V (M)-+ACCB
(M:Mt-1 )-+ACCA8 (ACCAB)->M:M+l

Address Mode

Condition Code

IMMED DIRECT INDEX EXT ND IM~1ccx 5 4 3 2 1 0

- - - - - OP

+OP

+ OP

+OP

+OP

+ H I Nzvc

· · R. S4 2 2 94 3 2 A4 4 2 B4 4 3
C4 2 2 D4 3 2 E4 4 2 F4 4 3

t t t t .Re

· · S5 2 2 95 3 2 A5 4 2 85 4 3

t t R.

· · C5 2 2 D5 3 2 E5 4 2 P.> 4 3

t t R.

· · 6 3 6 2 73 6 3

l l Rs

· · 43 2 1

l tRs

· · 53 2 1

t t Rs

· · SS 2 2 9S 3 2 AS 4 2 8S 4 3

t l R.

· · cs 2 2 DS 3 2 ES 4 2 F8 4 3

t l R.

·· ·· R. SA 2 2 9A 3 2 AA 4 2 BA 4 3

t t

CA 2 2 DA 3 2 EA 4 2 l-i\ 4 3

t t R.

·· · R. cc 3 3 DC 4 2 EC 5 2 I-1:: 5 3

· m DD 4 2 ED 5 2

5 3

·l f
·t t R.

·.-l <ti

.0 0

I ....l

~

I

Type Mnemonic Code

Operation Content

cu
M
.0....
Cl)

"O i:: Ill

"O

t:cMu

Ill 0 ...:I

·.-l

pcb:uO;

.....
·.-l
,a I 00

,:a>..

i::

0
·....-.l.

"O
ic:u:

Ill Cl)

Mcu

p.

0

LDAA LDAB STAA STAB
TAB TBA PSHA PSHB

} Load Aerni tr. } Store Acml tr.
} 1'ran.sfer Acmltrs. } Push Data

PULA } Pu I I Data
PULB

Logic/Arithmetic Operation
( M)-+ACCA (M)-+ACCB (ACCA)--M (ACCB)--M
(ACCA)-+ACCB
t(ACCB)-+ACCA AS ViA- 1)·--+-MS SP P (ACCB)-MSP
~SP)-1-+SP
SPHl-+SP (MSP )-+ACCA
(Sp)+l-+~P
(MSP )-+ACCB

Address Mode

Condition Code

IMMED DIRECT IND8X EXT ND ~ex 5 4 3 2 1 0

- - - - OP

t OP

+ OP - + OP

41- OP

t H I N '/, v c

· · R. 86 2 2 96 3 2 A6 4 2 B6 4 3
C6 2 2 06 3 2 E6 4 2 F6 4 3
· · i 97 3 2 A7 4 2 87 4 3 ·· ·· t D7 3 2 E7 4 2 F7 4 3

t t l R·
t R. t ·L R ·

16 2 1 ·
· R. 17 2 1· · 3
i· ·········· I"37 3 1 ·

t t R. t t

·· 32 4 1
···· ··· · ·· 33 4 1

I

I

:J:

~

!

(')

~

Vi

%°"

~

(')

-:i:

Type ~~:~nic

Operation Content

Address Mode

Condition Code

Condi ti~~:n~~termining RELATIVE INDEX EXT ND I MP L II MA~l:X 5 4 3 2 1 0

CP -· + OP - + OP - + OP - + OP - + H I N Z V C

{B(BCHCS*)
fKBBCLSO*J
B EQ

,....

r, G E

t .c B G T

8i:: ~c; B H I
t : BL E

..., ell
.,, § BL S
i:: ....

ell .!:: B L T
g 3 .c <ti BM I

~

BN E

Branch If Carry Clear

(C)-0

(Branch If Higher or Same)

Branch If Carry Set

(C)=l

(Branch ff Lower)

Br an ch If - Zero

( Z) = 1

Br an ch I f ~ Ze r o

( N) EB ( V ) - O

B ran c h I f > Ze r o

( Z ) V ( ( N )EfJ( V ) ) = O

Br an ch I f Hi g he r
Branch If ~-Zero

( C) V (Z) = 0 ( Z) V ( (N )Ef)( V)) =1

Branch lf Lower or Same
Br an ch I f < Ze ro
Br an ch I f Mi nus

(C)V(Z)=l
( N )@( V ) = 1
( N ) ~ 1

Branch If Not Equal Zero (Z)=O

24 3 2 25 3 2 27 3 2 '2£ 3 2 2E 3 2 22 3 2 2F 3 2 23 3 2 ID 3 2 2B 3 2 26 3 2

0 1

······ ······

······
· · ···· · · · · · · · · · · · · ······ ······ · · ·· · ·

·

·

·

·

··

······

BP L

Branch If Plus

(N)=O

2A 3 2

······

B V C BVS

Br an ch I f Over f I ow CI ear ( V ) = 0
Branch n Overflow Set ~V)=l

28 3 2 29 3 2

· 1· · · · · ······

~
ell
~
.~+.0..J....,~,,
.... i:: .,, ell i:: 0c;
u§

B R A BR N NOP J MP

BRanch AIways BRanch Never No Operation Jump

No n e

20 3 2

Advances only by PC+2 21 3 2

Advances only byPC+l 01 2 1

} See (Note)

6E 3 2 7E 3 3

l

* Note: Mnemonics enclosed in parentheses ( ) may be used in the 6801 Assembler

· · · · · · ······ ······ · · ····

- - - - - - - - - - - 1 r--~-----r-----·--

Type IMncemdonicl

Operation Content

:

I -------------i- o ne ·

·

~

Decrerent Index &g

j

B -~

lncr.ment Index Heg

j

g1~ ~ 1.,,,., I LDX

lndedt<g

I1u x
1-1 w STX

i I Store Ind.,x &g

I I

-~ ~ crx lc'""'"''""ttlleg. I

Logico/Arit~metic peration

Address Mode

Condition Code

IMMED DIRECT INDEX EXTND !MFA'Lcc'x 5 4 3 2 1 0
1---

(IX)- 1-+IX

f OP - + 01-' - + OP - + OP - + OP - + H I N Z V C] 09 3 1 · · · l · ·

·IXH,(M+l)~IXL (IX )+1--.lX
{M)

08 3 1 · · · l · ·

CE 3 3 DE 4 2 EE 5 2 FE 5 3

·· ® l R.

(IXH)-+M.(IXL)-+ M+ l
c~:n.U1)MLcrxL)

DF 4 2 EF 5 ~ FF 5 3
sc 4 3 9C s 2 Ac 6 2 BC6 3

··® ·· ® l R · t® t

0 P..

~1-1

DES

Decrorent Stack Pointer

I (SP)- 1--+S P

34 3 1 · · · · · ·

1

g"" ·i:~: I NS I! lncrerren t Stack Pointer

I (SP) +1-+S P

31 3 1 · · · · · ·

+> p..

I

~ ~L D S I Load Stack Pointer

i (M)--+SPH, (M+-1 )-SPL

SE 3

ITS 11 -~~ ~~
:;:>
ix:
x ]

ST_~ -+~I tore Stac~P~~~_:_r______ l

TX S X

I lrKkx P.eg-+Stack Pointer I

I

I

Stack Pointer-· Index &g 1

(SPH)--'M.(SPL)--M+-1
( IX)-1--+SP
(SP )+1--+IX

-----1-----+--

:1 9E 4 9F 4

2 AE 5 2 AF 5

2 BE 5 2 BF 5

3 3
35 3 30 3

t · · ®

R ·

· · '.ID l R ·

1 ······

1 ······

~ ~

( IXL)--..MSP;SP-1-'-'SP

i::

PS ll X Push Index Heg

1

H

(IXH }--MSP; SP-1--<SP siiH-+SP; ~MSP)--+IXH

3C 4 1 · · · · · ·

PU L X Pull Index &g

S?+l-tSP: \M3P)-....{xL

38 5 1 · · · · · ·

C LC
,.~] '2 CL I

I Cleiir Carry
Clear Interrupt Mask

I O--+('
0--+[

OC 2 1 · · · · · R OE 2 1 · R · · · ·

~3 ~

ix:
. w
'"O
I3

0
u
...
p:;

CL V S EC SE I

Clear Overflov Set Carry Set Interrupt Mask

o---V 1->C 1->I

.i:~:

SE V

Set Overflow

.., ~--------+--·

~ ~'"O TAP

Aerni tr A--> er Reg

1->V (ACCA}-iCC

J:

u0 ;~~i:: T PA

OC ~g -+ Aanltr A

(CC)--+ACCA

/

~

()

!
............ ......

OA 2 1 · · · · R ·
Ci> 2 1 · · · · · S
.J OF 2 1 · S · · · ·
OB 2 1 · · · · S 06 2 1 @@@ ·~@ {[2)
07 2 1 · · · · · ·

0)

%

~

()

-%

Type Mnemonic Code

Operation Content

rg,....,

°9tc":°i..'t-1~~8....

0
t
§

BSR JSR

h§:! U§.~.cu RT S

~ .....
Q..-1 RT I
::l 0

d

""''"' <II Ql .d.... SWI

"'iX:t

.i...:. :u0
H

WAI

Branch To Subroutine JumpTo Subroutine Return From Subroutine Return From Interrupt Soft Wire Interrupt W\i t for Interrupt

Conditions Determining Branch
(See Note)

Address Mode

Condition Code

RELATIVE DIRECT INDEX EXTND IMPL 5 4 3 2 1 0

- - - - -· OP + OP + OP + OP + OP + H I N z v c

SD 6 2

· · ·· ·· 9D 5 2 AD 6 2 BD 6 3

···· ·· 39 5 1

· ·· · · · 3B 10 1 @ @ @ @ @ @

· s. 3F 12 1

· ······· 3E 9 1

@

(Notes) (1) JSR

PC Main Program

SP Stack

PC

Subroutine

(

DIRECT~i n

9D=JSR

SP-2

n+l

Subroutine Address M (8

bit.1

c)

SP-1

(n+2)H

Next Execution Ins true tion

l n+2 Next Instruction

SP

(n+2)L

M=$00 "' $FF

(n+2)H and (n+2)L are the upper and

lower order 8 bits of n+2

PC Main Program

SP Stack

PC

Subroutine

n+~ INDEX {

AD=JSR D=Disp

SP-2

~

1---~~~~~~~~

[) SP-1

(n+2)H

Next Execution X+D Instruction
~~--~~~~~--i

n+2 Next Instruction

1---~~~-~~~~~

SP

(n+2)L

D=8 bit Unsigned Value

(n+2)H and (n+2)L are the upper and lower order 8 bits of n+2

EXTND (2) BSR

PC Main Program

SP Stack

PC

Subroutine

n

BD=JSR

_. SP-2

n+l SubroutineAddress

SP-1

SH(upper order 8bi t) r"-.

Subroutine Address '-V

n+Z SL(lower order8bit)

SP

(n+3)H (n+3)L

Next Execution Instruction
S is composed of SH and SL

n+3 Next Instruction

(n+3)H and (n+3)L are the upper and lower order 8 bits of n+3

PC Main Program

n

8D=BSR

n+l

±D=Disp

SP Stack

PC

Subroutine

-+
C)

SP-2

~ n+2.:tD

1---~~~~~~---1

SP-1

(n+2)H

Next Execution Instruction
,__..=;;~_;;.;;...;;.;;;;..;;_;.;._~-1

n+2 Next Instruction

SP

(n+2)L

D=7 bit Signed Value

n+2 is composed of (n+2)H and (n+2)L

-+ : Stack location indicating value of SP after each instruction is executed.

HITACHl119

-;-: (3) JMP

PC Main Program

lINDEX

6E=JMP n+l .___n=_Dis_p-

x+D Next Execution

l..-cl~n~s~t~r~u~c~t;i~on,,__ _

PC Main Program

I n

7E=JMP

]

I n+l 1_D_H_=_n_e_x_t_a_d_d_r_e-ss--1l

~ EXTENDED n+2 DL=next address;

l D ~~~~J'~~fi~iiion

(4) RTS

PC Subroutine
S ._t_ _39_=_RT_S_---1, Q

SP Stack
S P ± c===)

Main Program
~~~fr~~~I~~ion

SP+l

PCH

The values PCH'----------'

SP+2

PCL

and PCL are loaded n is composed of

;~~~kp;n~n~~e~he PCH and PCL

returned to main

(5) RT!

(6) SW!

~ Interrupt Program
j-4 y S r----3_B=_R_T_I__
PC Main Program

SP Stack

SP

SP+l

cc

SP+2 SP+3 SP+4 SP+5 SP+6 SP+? I

ACCB ACCA IXH IXL PCH PCL

SP Stack

PC Main Program

'-----:> Next Execution n Ins truc;_tion __

Re7urns to n+l main after '----------___,

loading all

n is composed of

information in stack into

PCH and PCL

each register

PC Interrupt Program

n 1----JF_=_s_w_r__----" c:Y~
n+l Next Instruction

PCH: upper order 8 bit of n+l PCL: lower order 8 bit of n+l

(7) WAI

PC Main Program

n

3E=WAI

c) ---.

n+l Next Instruction

PCH: upper order 8 bit of n+l PCL: lower order 8 bit of n+l

SP-7

'------> Next Execution s Ins tructiQn

SP-6

cc

Returns to

SP-5 SP-4

ACCB ACCA

interrupt program S is the address

execution after

indicating SW!

saving information interrupt-vector-

SP-3

IXH

from all registers address content

in the stack

SP-2

IXL

SP-1 ~----PC-H---1

SP

PCL

__J

3 SP Stack

SSP-P6 -7~c=c =--'--1

SP-5

ACCB

r--=> ~:-~~::-Queue-II Queues in7erruLp~ -------- . J

SP-4: SP-3

ACCA ~_H__

~fter sa~ing
information from all registers in stack

SP-2

IXL

SP-1

PCH

SP

_PC_L_ _ _ J

120 HITACHI

B ASCII CODE TABLE

Table B-1 ASCII Code

Parity Bit~~~ b 7

be

0

bs

0

b.

0

b3

b2

~ b I b 0

0

0 0 0 ···· 0 ··0 0 ·· ·0 ·0 ·0 ·

l

2

3

4

5

6

7

0 0 0 0 0 NUL DCo

SP

0

· 0 0 0

l

SOM X-ON

/

l

· 0 0

0

2 EOA TAPE

"

2

· · 0 0

3 EOM X-OFF #

3

· 0

0 0

4 EOT IA-PE'

$

4

· · 0

0

5 WRU ERROR %

5

· · 0

0

6

RU SYNC

&

6

· · · 0

7 RELL LEM (APOS) 7

·0 0 0

8 FEo

CAN

(

8

· · 0 0

I}

TAB

SI

)

I}

· · 0

0 A LF EOF

*

:

· · · 0

B VT ESC +

· · 0 0 c FF

s.

<

· · · 0

D CR s5 -

=

· · · 0 E so

Se

>

· · · · F SI

S1

/

?

@

p

'

p

A

Q

a

q

B

R

b

r

c

s

c

s

D

T

d

t

E

u

e

u

F

v

f

v

G

w

g

w

H

x

h

x

I

y

i

y

J

z

j

z

K

(

k

{

" L

I

I

M

)

m

}

N

/\

n

-

0

-

RUB

0

OUT

Characters within the double lined border may be used in comments or character constants

HITACHI 121

C HEXADECIMAL-DECIMAL CONVERSION TABLES

Hexadecimal-Decimal Conversion Table (1)

0

2 3

5 6

8

A BcDEF

0 0 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014" 0015 0 1 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0000 0031 0 2 0032 0033 0034 0035 0036 0037 0038 0039 0040 004<1 ~ 004a 0044 0045 00.W ()()4.7 0 3 0048 {)(}W 0050 0051 0052 0053 0054" 0055 0056 0057 0058 0059 0060 0061 0062 0063

0 4 0064" 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074" 0075 0076 0077 0078 0079 0 5 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 009'2 0000 0094" 0095 0 6 0006 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0100 0110 0111 0 7 OH2 0113 0114" 0115 0116 0117 Oll8 0119 0120 0121 0122 0123 0124 0125 0126 0127

0 8 0128 0129 0130 0131 0132 0133 0134" 0135 0136 0137 0138 0139 0140 014"1 0142 0143 0 9 0144 014"5 01.W 01417 014"8 014'9 0150 0151 0152 0153 0154" 0155 0156 0157 0158 0159 OA 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 OB 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191

OC OlW 0100 0194- 0195 0196 0197 0198 0199 0200 02.01 0202 0203 0204 0205 0206 02.07 OD 0208 0209 0210 0211 0012 0213 0014 0215 0216 0217 0218 0219 0220 0021 0222 0023 0 E 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 OF 024-0 0241 0242 0243 0244" 0245 02-la 0247 0248 024') 0250 0251 0252 0053 0254 0255

l 0 0256 0257 0258 0259 0260 0261 0262 0263 0264 0065 0266 0267 0268 0269 0270 0271 1 1 0272 0273 0274 0275 0276 0277 0278 0279 0080 02.81 02.82 0083 02.84 02.85 0286 0087 1 2 0288 02.89 0200 0291 0292 0200 0294 0295 0296 0097 0298 0299 0300 0301 0302 0000 l 3 0304 0305 0306 0307 0308 0309 0010 0311 0312 0313 0314 0315 0316 0317 0318 0319

l 4 032.0 0321 0322 0323 0324 0325 0326 0327 032.8 0329 0330 0331 0332 0333 0334 0335 15 0336 0337 0338 0339 0340 034"1 0342 OM3 0344 0346 0346 034"7 0348 034') 0350 0351 l 6 0352 0353 0354" 0355 0356 0357 0358 0359 0360 0361 0362 0300 0364" 0365 0366 0367 l 7 0368 0369 0370 0371 0372 0373 0374 0375 0376 0377 0378 0379 0380 0381 0382 0383

l 8 0384 0385 0386 0387 0388 0389 0390 0391 0392 0300 0394 0395 0396 0397 0398 0399 l 9 0400 0401 0402 0403 0404 ()4{)5 0406 0407 0408 0409 04-10 04-11 04-12 0413 04-14 04-15 l A 0416 04-17 0418 0419 0420 04-21 0422 0423 Oto24 0425 0426 0427 04-28 04t29 0430 0431 l B 0432 0433 0434 0485 0436 0437 0438 0489 0440 0441 0442 0443 0444 0445 0446 0447
l c 0448 044'9 0400 04"51 0462 0453 0464 0455 04o56 04o57 0458 0459 0460 0461 04a2 0463
l D 04a4 04a5 04a6 04a7 0468 0469 0470 0471 0472 0473 0474 0475 0476 0477 0478 0479 l E 0480 0481 0482 0483 0484 0485 0486 0487 0488 0489 04-90 04')1 0492 0493 ~ 04-95 1 F 0496 0497 0498 0499 0500 0501 0502 0503 05<» 0505 0506 0507 0508 0509 0510 0511

2 0 0512 0513 0514 0515 0516 0517 0518 0519 052.0 0521 0522 0523 0524 0525 0526 0527 21 0528 0529 0530 0531 0532 0533 0534" 0535 0536 0537 0538 0539 0540 054"1 0542 0543 2 2 0544 054"5 0546 0547 0548 0549 0550 0551 0552 0553 0554 0555 0556 0557 0558 0559 2 3 0560 0561 0562 0563 0564 0565 0566 0567 0568 0569 0570 0571 0572 0573 0574 0575

2 4 0576 0577 0578 0579 0580 0581 0582 0583 0584 0585 0586 0587 0588 0589 0590 0591 2 5 0592 0593 051)4. 0595 0596 0597 0598 0599 0600 0601 0600 0603 0604 0605 0606 0607 2 6 0608 0609 OtilO 0611 0612 0613 0614 0615 0616 0617 0618 0619 0620 0621 0622 0623 2 7 0624 0625 0626 0627 062.8 0629 0630 0631 0632 0633 0004 0635 0636 0637 0638 0639

2 8 0640 0641 064"2 0643 0644 0645 0646 0647 0648 064') 0650 0651 0652 0053 0654" 0655 2 9 0656 0657 0658 0659 0660 0661 0662 0663 0664 0065 0666 0667 0668 0669 0670 0671 2A 0672 0673 0674 0675 0676 0677 0678 0679 0680 0681 0682 0683 0684 0685 0686 0687 2 B 0688 0689 0690 0691 0692 0600 0694 0695 0696 0697 0698 0699 0700 0701 0702 0703

2C 0704 0705 0706 0707 0708 0700 0710 0711 0712 0713 0714 0715 0716 0717 0718 0719 2D 072.0 0721 0722 0723 0724 0725 0726 0727 072.8 07?,9 0730 0731 0732 0733 0734" 0735 2 E 0736 0737 0738 0739 0740 0741 0742 0748 0744 0745 07.W 0747 0748 074') 0750 0751 2 F 0752 0753 0754 0755 0756 0757 0758 0759 0700 0761 0762 0763 0764 0765 0766 0767

3 0 0768 0769 0770 0771 0772 0773 0774 0775 0776 0777 0778 0779 0780 0781 0782 0783 31 0784 0785 0786 0787 0788 0789 0790 0791 0792 0700 0794 0795 0796 0797 0798 0799 3 2 0800 0801 0802 0803 0804 0005 0806 0807 0800 0809 0810 0811 0812 0813 0814" 0815 3 3 0816 0817 0818 0819 0820 0821 0822 0823 0824 0825 0826 0827 0828 0829 0830 0831

3 4 0832 0833 0034 0835 0836 0837 0838 0839 084-0 0841 0842 0843 0844 0845 0846 0847 3 5 0848 0849 0850 0851 0852 0853 0854" 0855 0856 0857 0858 0859 0860 0861 0862 0863 3 6 0864" 0865 0866 0867 0868 0869 0870 0871 0872 0873 0874 0875 0876 0877 0878 0879 3 7 0880 0881 0882 0883 0884 0885 0886 0887 0088 0889 0890 08\H 0892 0893 0894 0895

122 HITACHI

Hexadecimal-Decimal Conversion Table (2)

0

2

3

4

6

8

9

A

B c

D E

F

38 0896 0897 0898 0899 0000 0001 0002 0003 ()004. 0005 0006 000'7 0008 0000 OIHO 09ll

oms 39
3A

0912 0928

0913 0929

0914 0915 0916 0917 0918 0919 0920 0930 OOH 0932 0933 0934 0035 0936

0921 0007

0922

0003 0924 0925
0009 oow 0041

0006 0927 0942 0943

3B 0044 0945 0946 0947 0948 0949 0950 0951 0952 0953 0954 0955 0956 0957 0958 0959

3C OQ60 0961 0962 0963 0064 0965 0966 0967 0968 0969 0970 0971 0972 0973 0974 0975
30 0976 0977 0978 0979 0980 0981 0982 0003 0984 0985 0986 0987 0988 0989 0900 0991 3E 0992 0993 0994 0995 0996 0997 0998 0999 1000 1001 1002 1003 1004 1005 1006 1007 3F 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023

40 1004 1026 1026 1007 1028 1029 1030 1001 1002 1003 1(64 1035 1036 1007 1038 1039 41 1040 1041 l~ 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 42 1056 1057 1058 1059 1060 1001 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 43 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087

44 1088 1089 1000 1091 1092 1093 1094 1095 1096 1097 1098 1099 HOO 1101 1102 1103 45 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 lll4 lll5 lll6 lll7 1118 llHI
46 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 47 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 ll50 1151

48 1152 1153 1154 1155 1156 1157 1158 1159 ll60 1161 1162 1163 1164 1165 ll66 ll67 49 1168 1169 1170 1171 1172 1173 1174 1175 1176 ll77 1178 1179 1180 1181 ll82 1183 4A 1184 1185 1186 1187 1188 1189 1100 1191 ll92 1193 1194 1195 1196 1197 1198 1199 4B 1200 1201 1202 1203 1204 1205 1206 12.07 1208 1209 1210 1211 1212 1213 1214 1215

4C 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 40 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247
4E 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 41" 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279

50 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 129(. 1295 5 1 1200 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 52 1312 l:H3 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 53 1328 la29 1330 13.'H 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343

54 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 55 1360 1361 1:362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 56 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 57 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1400 1407

58 1408 1400 1410 14ll 1412 1413 1414 1415 1416 1417 1418 1419 14-20 1421 14Z2 1423 59 U.24 14.25 14.26 1427 1428 14'29 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 5A 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1462 1463 1454 1465 5B 1466 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471

5C 1472 14-73 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 5D 1488 1489 1400 1491 1492 1493 1494 1495 1400 1497 1498 1400 1500 1501 1502 1503 5E 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 5F 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535

(IO 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 ti 1 1552 1553 1554 1555 1556 1557 1558 1559 1500 1561 1562 1563 1564 1565 1566 1567 ti2 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 63 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599

64 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 65 1616 1617 1618 !619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 66 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 67 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663

68 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 69 1680 1681 1682 1683 1684 1685 1686 1687 lffi8 1689 1690 1691 1692 1693 1694 1695 6A 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 6H 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727

6C 1728 17W 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 6D 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 0756 1757 1758 6E 1760 1761 1752 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 61'' 1776 1777 177~ 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791

HITACHl123

Hexadecimal-Decimal Conversion Table (3)

0

2 3 + 5 6 7 8 9A8 cDEF

70 1792 1700 l794o 1795 1796 rnn 1798 1799 1800 1801 1802 1803 18()(. 1805 1806 1807
71 1808 1809 1810 1811 1812 1813 1814" 1815 1816 1817 1818 1819 1820 1821 1822 1823 72 182' 1825 1826 182'7 182.8 1829 1830 1831 1882 1833 1834" 1835 1836 1837 1838 1839 73 1840 184"1 1842 l&ta 18M 184"5 1846 18417 1848 1849 1850 1851 1852 1853 1854" 1855

H 1856 1857 1858 1859 1800 1861 1862 1868 18M 1865 1865 1867 1868 1869 1870 1871 75 1872 1878 187+ 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884" 1885 1886 1887 76 1888 1889 1890 1891 1892 1800 1894o 1895 1896 1897 1898 1899 1000 1901 1002 1903 77 1904" 1905 1006 1907 1908 1909 1910 1911 1912 1913 191+ 1915 1916 1917 1918 1919

78 1920 19'll 19'l2 1928 192+ 1925 1926 19'l7 1928 1929 19~ 1001 l~ 1933 lm.t. 1935

79 1006 1937 l~ 1009 1940 194ol 19f.2 1943 1944. lQt.5 19f.6 19417 1948 194"9 1950 1951

7A 78

1952 1968

1958 1969

1954" 1970

1u9m55

1956 1972

1957 1973

1958 197+

1959 1975

1000 1976

1961 1977

1962 1978

1963 1979

196419al

1965 1981

1966 1982

1967 1983

7C 198+ 1985 1986 1007 1988 Hl89 1990 1991 1992 1993 1994o 1995 1996 1997 1998 1999 7D 2000 2001 2002 2003 200+ 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014" 2015 7E 2016 2017 2018 2019 2020 2001 2022 2023 WM 2005 2026 2027 2008 2029 2030 2031 7F 2032 2003 203+ 2005 2036 2037 2038 2039 2040 204"1 2042 2043 2044 2046 204o6 2047

80 2048 20.W 2050 2051 2052 2053 2054" 2055 2056 2057 2058 2059 2060 2061 2062 2063 81 2064" 2065 2A)66 2067 2068 2069 2070 2071 2072 2073 207+ 2075 2076 2077 2078 2079 82 2080 2081 2082 2083 2084" 2085 2086 2087 2088 2089 2090 2001 2092 2093 2094 2005 83 2096 2007 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111

84 2112 2113 2114 2115 2116 2117 2ll8 2119 2120 2121 2122 2123 2124o 2125 2126 2127 85 2128 2129 2130 2131 2132 2133 2134" 2135 2136 2137 2138 2139 2140 214ol 21~ 2143 86 2144 2145 214"6 21+7 2148 2149 2150 2151 2152 2153 2154" 2155 2156 2157 2158 2159 87 2160 2161 2162 2168 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175

88 2176 2177 2178 2179 2180 2181 2182 2183 2184" 2185 2186 2187 2188 2189 2100 2191 89 2192 2193 2194o 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 8A 2208 2209 2210 2211 2212 2213 221+ 2215 2216 2217 2218 2219 2220 2221 2222 2223 88 222+ 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234" 2235 2236 2237 2238 2239

8C 224oO 224"1 2242 2243 22'+ 224"5 22.46 224"7 2248 22+9 2250 2251 2252 2253 2254" 2255 8D 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 8E 2272 2273 2274" 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 BF 2288 2289 2200 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303

90 2.304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314o 2315 2316 2317 2318 2319 91 2320 2321 2322 2323 232+ 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334" 2335 92 2336 2337 2338 2339 2340 2341 2342 2343 234+ 2340 2346 2347 2348 2&W 2350 2351 93 2352 2353 2354" 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367

94 2$8 2369 2370 2371 2372 2373 2374" 2375 2376 2377 2378 2379 2380 2381 2382 2383

95 2384 2385 2386 2887 2388 2389 2390 2391 2392 2393 2394" 2395 2396 2397 2398 2399

96 97

2+00 2416

2+01 2+17

2400 2418

2+03 24-19

2+04o 2420

U05 2421

2406 2422

2+07 2423

2408
~ ...

2409 24-25

24-10 24-26

24-11 2427

2412 2428

2413 2429

2414 2430

2+15 2431

98 2432 24'33 24M 2435 2436 :!.437 2438 2439 244-0 244"1 ~ 244"3 2444 244"5 244o6 24+7 99 2448 2449 24-50 24-51 2402 2453 2454 2455 2406 2407 24.58 2459 2400 2461 2.462 2463 9A 24-64 2465 2466 24()7 2468 2.W9 2470 2471 24-72 2473 24-74 2475 24-76 24-77 24-78 24-79 98 243) 2481 2482 TM3 2484 2485 2486 24o87 2488 2489 24~ 2491 24-92 24-93 24-94 24o\:15

9C 2+96 Z.W7 2400 24-99 2:100 2501 2502 2503 2504 2505 2500 2507 2508 2509 2510 2511 90 2512 2513 25}4. 2515 25l6 2517 2518 2519 2520 2521 2522 2523 2524" 2525 2526 2527 9E 2528 25~9 2530 2531 2532 2533 3534" 2~35 2536 2537 2538 2539 2540 254"1 2542 254\~ 9F 2544" 2540 25.W 2547 2548 2549 2550 2551 2552 255.'3 2554 2555 2556 2557 2558 25fi9

AO 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574" 2f>75 Al 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2500 25!H A2 2592 25~~ 2594" 2595 2596 2597 2598 2Ml9 2600 2601 2602 2600 2.604o 2605 2600 2007 A3 2008 2609 :!610 2611 2612 2613 2614o 2615 2616 2617 2618 2619 2620 2621 2622 262!3

A4o 262+ 2625 2626 2627 2628 2629 2630 2631 2632 21E3 2634" 2635 2636 2637 2638 2639 A5 264() 2Ml 2642 2643 2644" 2645 264() 2647 2648 2649 2650 2651 2652 2653 2654 2(155 A6 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 266\:1 2670 2671 A7 2672 2673 2674" 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684" 268!) 2686 2687

124 HITACHI

Hexadecimal-Decimal Conversion Table (4)

u

2

3

4

ti

9 A BcDE F

A8 2688 2689 2600 2691 2692 :!.ti\l:~ 2694 2.ti!-15 2696 2697 2008 2699 2700 2701 2702 2703
A9 2704 2705 2706 2707 27U8 :!.709 :mu :~7 ll 2712 2713 2714 2715 2716 2717 2718 2719
AA 2720 2721 2722 2723 272+ 2n5 2726 ',!,72'/ 2728 2729 2730 2731 2732 2733 2734 2735 AU 2736 2737 2738 2739 274() 27+1 :!.H2 27.rn 2744 2745 2746 2747 2748 2749 27r() 2751

AC 275.2 2753 2754 2755 2756 27;,7 2758 :!."1:>9 2'100 2761 2762 27ro 2764 2765 2766 2767 AO 2768 27ti9 ~70 2771 2772 2773 2'774 277'El 2'776 2777 2778 2779 2780 2781 2782 2783 AE 2784 2785 2786 2787 2788 27H9 2700 2791 2792 2793 2794 2795 2796 2797 2798 2799 AF 2~U 2801 2802 2803 2804 2x11:i 28U6 :'~W7 2808 2800 2810 2811 2812 2813 2814 2815

BU 2816 2817 2818 2819 282U 2821 282.2 :>,;-<23 2824 ~25 2826 2827 2828 2829 2830 2831 Hl 28a2 2833 2834 2835 2836 28:~7 :~K:.38 :!.<·n9 284() 2841 2~ 2843 2844 2845 2846 2847 H2 2848 2849 2850 2851 2852 2853 2W>4 :!Wi5 28'El6 28f>7 2858 2859 2800 2861 2862 2863 ll3 2ii64 2865 2800 2867 2868 2869 2870 2.87l 2872 2873 2874 2875 2876 2871 2878 2879

H4 2880 2881 2882 2883 2884 2885 2H80 2?<87 2888 2889 289U 2891 2892 2893 2894 2895 ll5 2896 2897 2898 2899 2000 2901 29(12 2003 2904 2005 2906 2907 2908 2909 2910 2911
ll6 21ll2 2913 2914 2915 2\H6 2\ll 7 2018 :.'9l9 292() 2921 2922 2923 WU 2925 2926 2927
ll 7 2928 2929 2930 2931 2932 29a3 29:.H 2935 21l36 2937 2938 2939 2940 2941 2942 2943

118 2944 2945 2946 2947 2~ 2949 295U 21151 2952 2953 21l54 2955 2956 2957 2958 2959
ll9 2960 2961 2962 29ro 2004 2oo:i 2\.166 2967 2008 2969 2970 21¥71 2972 2973 2974 2975
!IA 2976 2{)77 2!178 2979 298U 2981 2982 2983 2004 2985 .2986 2987 2008 2989 2900 2991 llH 2992 299a 2!194 2995 2900 2007 2\.l\.l8 2999 3000 3001 3002 3003 3004 3005 3006 3007

BC 3008 3009 3010 3011 3012 3013 3014 3015 3016 ~illl 7 3018 3Ul9 3020 3021 3022 3023
HO au24 3025 3026 3027 3028 3029 3oao 3001 3032 3003 :1034 3035 3ffi6 3037 3038 3039
!IE 304() 3041 3042 3043 3044 3045 3046 31.»7 :~048 3(W.) 3050 3051 3052 3053 3054 3055 HF 3056 3057 3058 3059 3000 3061 aotiz 3063 3064 306~> 306ti 3067 3068 3069 3070 3071
cu 3072 3073 3074 3075 3076 3007 3078 3079 3080 arnH 3082 3083 3084 3085 3086 3087
cl 3088 308\l 3090 3091 3092 3000 3094- 30\l5 309ti :m97 3098 3099 3100 3101 3102 3100 C2 3104 :H05 3106 3107 3108 3109 3110 3111 :m2 au:~ a114 3115 3116 3117 3ll8 3119 C3 a120 ~H21 3122 3123 3124 3125 3126 3127 31.28 3129 3130 3131 3132 3133 3134 3135

C4 :H36 3137 3138 3139 314() 3141 3142 3143 3144 :H45 3146 3147 3148 3149 3150 3151

C5 Cti

3152 3168

3153 3169

3154 3170

3155 3171

3156 3172

3157 3173

3158 3174

3159 3175

3160 3176

3HH
:nn

3162 3178

3163 3179

3164 3HD

3165 3181

3166 3182

3167 3183

C7 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194- 3lll5 3196 3197 3198 3199

C8 3200 3201 3202 3200 3204 3W5 3206 32()7 32()8 320\l 3210 3211 3212 3213 3214 3215

C9 3216 3217 3218 3219 :~220 3221 3222 :~223 3224 3225 3226 3227 3228 3229 3230 3231

CA CB

3232 3248

3233 3249

3234 3250

3235 3251

3236 3252

3237 3253

3238 32:>4

3239 32!">5

324() 32"56

3241 a257

3242 3258

3243 325\l

3244
:miO

3245 3:Wl

3246 3262

3247 3263

cc 3264 3265 3200 3267 :32.68 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 co 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295
CE 3296 3297 3298 3299 33lJO 3301 3302 3300 3304 3305 3306 3307 3ao8 330P 3310 3311 CF 3312 3313 3314 3315 3316 3317 3318 3319 332-0 3321 3322 3323 3324 3325 3326 3327

DO 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 334() 3341 3342 3343 Dl 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 02 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 D3 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391

04- 3392 33\Il 3394 3395 3396 3397 3398 3399 3400 34<.ll 3402 34()3 34()4 34-05 34-06 3407 D5 34()8 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 342-0 3421 3422 3~ D6 3424 3425 3426 3427 3428 3429 34JO 34.31 3432 3433 3434 3435 3436 ~7 3438 34.39 D7 344() 3441 3442 3443 3444 3445 341() 3447 3448 344\l 3400 34<51 3452 34.'>3 3454" 3455

D8 3466 3457 3458 3469 3400 3461 3462 3463 3464 3465 3466 3467 3468 346P 3470 3471 D9 3472 3473 34<74 3475 3476 34-77 3478 347\l 3480 3481 3482 3483 3484 3485 3486 3487 DA 3488 :*19 3490 3.Wl 3492 3400 3494 3495 3400 3497 34-98 3400 3500 3501 3502 3503 DB 3504 3505 3506 3507 3500 3509 3510 3511 3512 3513 3514 ;3515 3516 3517 3518 3519

DC 352.0 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 DD 3536 3537 3538 3539 354() 3541 3542 3543 3544 3545 3546 3547 3548 :J549 3550 3551 DE 3552 3553 3554" 3555 3556 3557 3558 3559 3500 3561 3562 3563 3564 3565 3566 3567 DF 3568 3569 3570 3571 3572 3573 3574" 3575 3576 3577 3578 :~579 3580 3581 3582 3583

HITACHl125

Hexadecimal-Decimal Conversion Table (5)

0

.. 2 3

5 6 78 9ABcDEF

EO 3584 3585 3586 3587 3588 3589 3590 3591 3500 3593 3594' 3595 3596 3597 3598 3599 El 3000 3601 3602 3600 3604" 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 E2 3616 3617 3618 3619 3620 3621 3622 3623 3624" 3625 3626 3627 3628 3629 3630 3631 E3 3632 3003 363+ 3635 3636 3637 3638 3639 3640 364-1 3642 3643 3644 364.6 3646 36417

E4 3648 364Q 3650 3651 3652 3653 3654' 3655 3656 3657 3658 3659 3660 3661 3662 3663 E5 3664 3665 3666 3667 3668 3669 36?0 3671 3672 3673 3674 3675 3676 3677 3678 3679 E6 36WJ 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3003 3694 3695 E7 3600 3697 3698 3699 3700 3701 3702 3700 37()4. 3705 3706 3707 3708 3709 3710 3711

E8 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724" 3725 3728 3727 E9 3728 3729 3730 3731 3732 3733 3734 3735 3736 8737 3738 3739 3740 3741 374.2 3743 EA 3744 3745 3746 374'7 374'8 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 EB 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775

EC 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 ED 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3800 3804 ~5 3806 3807 EE 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 !i818 3819 3820 3821 3822 3823 EF 3824" 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839

FO 3840 3841 3842 3843 3844 3845 3846 384·7 3848 384(1 3850 3851 3852 3853 3854' 3855 Fl 3856 3857 3858 3859 3860 3861 3862 3863 386f. 3865 3866 3867 3868 3869 3870 3871 F2 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 F3 3888 3889 3890 3891 3892 3893 3894 3805 3896 3897 3898 3899 3900 '4901 3902 3903

F4 3904 3905 3906 3907 3sn! 3909 3910 3911 3912 :3913 3914 3915 3916 3917 3918 3919 F5 3920 3921 3002 3923 3924 3005 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 F6 3006 3937 3938 3009 3940 3941 394.2 3943 3944 3910 3946 394-7 3948 3949 3950 3951 F7 3952 3953 3954' 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967

1''8 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 F9 3984 3985 3986 3~7 3988 3989 3990 3991 3992 3993 3994- 3995 3996 3997 3998 3900 FA 4000 4001 4002 4003 4004 4005 4006 4007 4008 400Q 4010 4011 4012 4013 4014 4015 FB 4016 4017 4018 4019 4000 4021 4022 4023 402+ 4005 4026 4007 4028 4029 4030 4001

FC 4032 4033 4034 4035. 4()36 4()37 4038 403\J 4040 4()4.l 4()4.2 ~ 4044 4045 ~ 4047 FD 4048 4()4.9 4050 4051 4052 4053 4054 4055 4006 4057 4058 4059 4060 4061 4062 4063 FE 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4-079 FF 4080 4001 4082 4003 4084 4085 4006 4087 4008 4089 4000 4091 4092 4093 4094 4095

126 HITACHI

D EPROM MOUNTING METHOD The EPROMs for the 6301/6801 Assembler-Text Editor (S31MIX1-R/S61MIX2-R)
are mounted on the main module (H62EV02). Figure D-1 and Table D-1 show the proper locations.

Typuter /TTY HH6688SSDD2IOo
PS
D D
ii
· ·
·

Main Module H6 2 E V0 2

P2

tr:!

~

t--'

!!)

rt

0

11

t:ld 0
!!)
11 0.

(")

0

:::1

Pl

:::1
Cl>

()

rt

0
e1n1

ABORT RESET Console

Figure D-1 EPROM Package Locations

Table D-1 EPROM and Socket Match

Location

EPROM Name

OPT .l OPT 2 OPT 3

-5.llMIXl-R or S61Mrx:-R S31MIX1-R or S61MIX2-R S31MIX1-R or S61MIX2-R

HITACHI 127

The following points are important in mounting and replacing EPROMs. (1) Always turn the power off when removing an EPROM from the board. (2) Mount the EPROM in the proper position as shown in Figure D-2.
1J.
1 pi
0
Figure D-2 EPROM Mounting Direction If the EPROM were mounted backwards and the power applied, the EPROM will be destroyed. Always make sure that EPROMs are plugged in in the correct direction.
128 HITACHI


Acrobat 11.0.23 Paper Capture Plug-in