17.05.2015 Views

~ National ~ Semiconductor - Al Kossow's Bitsavers

~ National ~ Semiconductor - Al Kossow's Bitsavers

~ National ~ Semiconductor - Al Kossow's Bitsavers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.0 Instruction Set Reference<br />

INTRODUCTION<br />

The Instruction Set Reference section contains detailed information<br />

on the syntax and operation of each BCP instruction.<br />

The instructions are arranged in alphabetical order by<br />

mnemonic for easy access. <strong>Al</strong>though this section is primarily<br />

intended as a reference for the assembly language programmer,<br />

previous assembly language experience is not a<br />

prerequisite. The intent of this instruction set reference is to<br />

include all the pertinent information regarding each instruction<br />

on the pagels) describing that instruction. The only exceptions<br />

to this rule concerns the instruction addressing<br />

modes and the bus timing diagrams. The discussion of the<br />

instruction addressing modes occurs at the beginning of the<br />

BCP Instruction Set Overview section and, therefore, will<br />

not be repeated here. The figures for the bus timing diagrams<br />

are located at the end of this introduction rather than<br />

constantly repeating them under each instruction. On the<br />

other hand, the information that is contained under each<br />

instruction is divided into eight categories titled: Syntax, Affected<br />

Flags, Description, Example, Instruction Format,<br />

T-states, Bus Timing, and Operation. The following paragraphs<br />

explain what information each category conveys and<br />

any special nomenclature that a category may use.<br />

Syntax<br />

This category illustrates the assembler syntax for each instruction.<br />

Multiple lines are used when a given instruction<br />

supports more than one type of addressing mode or if it has<br />

an optional mnemonic. <strong>Al</strong>l capital letters, commas, (,) math<br />

symbols (+, -), and brackets ([ I) are entered into the assembler<br />

exactly as shown. Braces ({ )) surround an instruction's<br />

optional operands and their associated syntax. The<br />

text between the braces may either be entered in with or<br />

omitted from the instruction. The braces themselves should<br />

not be entered into the assembler because they are not part<br />

of the assembler syntax. Lower case characters and operands<br />

that begin with the capital R represent symbols. These<br />

must be replaced with actual register names, numbers, or<br />

equated registers and numbers. Table XXII lists all the symbols<br />

and their associated meanings.<br />

Affected Flags<br />

If an instruction sets or clears any of the ALU flags, (Le.,<br />

Negative [Nl, Zero [Zl, Carry [Cl, and/or Overflow [Vl, then<br />

those flags affected are listed under this category.<br />

Description<br />

The Description category contains a verbal discussion<br />

about the operation of an instruction, the operands it allows,<br />

and any notes highlighting special considerations the prorammer<br />

should keep in mind when using the instruction.<br />

Example<br />

Each instruction has one or more coding examples designed<br />

to show its typical usage(s). For clarity, register<br />

name abbreviations are often used instead of the register<br />

numbers, (Le., RTR is used in place of R4). Each example<br />

assumes that the ".EQU" assembler directive has been previously<br />

executed to establish these relationships. Information<br />

relating register abbreviations to register names, numbers,<br />

and purpose is located in the CPU Registers section.<br />

Instruction Format<br />

This category illustrates the formation of an instruction's<br />

machine code for each operand variation. Assembly or disassembly<br />

of any instruction can be accomplished using<br />

these figures.<br />

T-states<br />

The T -state category lists the number of CPU clock cycles<br />

required for each instruction, including operand variations<br />

and conditional considerations. Using this information, actual<br />

execution times may be calculated. For example, if the<br />

conditional relative jump instruction's condition is not met,<br />

the CPU's clock cycle is 18.867 MHz ([CCS] = 0), and no<br />

instruction wait states are requested ([IW1-0] =00), then<br />

Jcc's execution time is calculated as shown below:<br />

texecution<br />

~ 1 /(CPU clock frequency) • T-states<br />

= 1/(18.867*106 Hz) * 2<br />

= (53*10-9s) * 2<br />

= 106 ns<br />

See the section BCP Timing for more information on calculating<br />

instruction execution times.<br />

Bus Timing<br />

This category refers the user to the Bus Timing Figures 7 to<br />

12 on the following pages. These figures illustrate the relationship<br />

between software instruction execution and some<br />

of the BCP's hardware signals.<br />

Operation<br />

The operation category illustrates each instruction's operation<br />

in a symbolic coding format. Most of the operand<br />

names used in this format come directly from each instruction's<br />

syntax. The exceptions to this rule deal with implied<br />

operands. Instructions that imply the use of the accumulators<br />

use the name "accumulator" as an operand. Instructions<br />

that manipulate the Program Counter use the symbol<br />

"PC". Instructions that "push" onto or "pop" off of the internal<br />

Address Stack specify "Address Stack" as an operand.<br />

Instructions that save or restore the ALU flags and the register<br />

bank selections use those terms as operands. Two<br />

specialized operator symbols are used in the symbolic coding<br />

format, the arrow" -- " and the concatenation operator<br />

"&". The arrow indicates the movement of data from one<br />

operand to another. For instance, after the operation<br />

"Rs -- Rd" is performed the content of Rd has been replaced<br />

with the content of Rs. The concatenation operator<br />

"&" simply indicates that the operands surrounding an "&"<br />

are attached together forming one new operand. For example,<br />

"PC & [GIE] 7 ALU flags & register bank<br />

selections -- Address Stack" means that the Program<br />

Counter, the Global Interrupt Enable bit, the ALU flags and<br />

the register bank selections are combined into one operand<br />

and pushed onto the internal Address Stack. Three conditional<br />

structures are utilized in the symbolic coding format:<br />

the "Two Line If" structure, the "Blocked If" structure, and<br />

the "Blocked Case" structure. Figure 4 shows the "Two<br />

Line If" structure. If the condition is met then the operation<br />

is performed, otherwise the operation is not performed.<br />

If condition<br />

then operation<br />

FIGURE 4. Two Line If Structure<br />

2-99

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!