NEe Electronics Inc. NEe USER'S October 1986 MANUAL pPD70108 (V20TM) 8/16-Bit CMOS Microprocessor pPD70116 (V30™) 16-Bit CMOS Microprocessor NEe Electronics Inc. NEe pPD70108 (V20) 8/16-Bit CMOS Microprocessor pPD70116 (V30) 16-Bit CMOS Microprocessor October 1986 Stock No. 500350 ©1986 NEe Electronics Inc.lPrinted in U.S.A. NEe Electronics Inc. ttlEC CONTENTS Section Page Section Page 1 Introduction ............................... . 1-1 12 Instruction Set (cont) 2 Pin Description ........................... . 2-1 Subroutine Control .................... . 12-142 3 Functional Description ................... . 3-1 Stack Operation ........................ . 12-146 Execution Unit (EXU) .................. . 3-1 Branch ................................... . 12-154 Bus Control Unit (BCU) ............... . 3-4 Conditional Branch .................... . 12~157 4 Memory and I/O Configuration ......... . 4-1 Break .................................... . 12-167 Memory Configuration ................ . 4-1 CPU Control ............................ . 12-171 Memory Accessing ..................... . 4-2 Segment Override Prefix .............. . 12-176 I/O Configuration and Accessing .... . 4-3 Emulation Mode ........................ . 12-176 5 Read/Write Timing ....................... . 5-1 6 Interrupts .................................. . 6-1 Appendix Maskable Interrupts .................... . 6-2 A pPD70108170116 Instruction Index ...... . A-1 BRK Flag (Single-Step Interrupt) .... . 6-3 Interrupt Disable Timing .............. . 6-4 Table Interrupts During Block Instructions .. 6-4 1-1 pPD70108170116 Pin Identification ...... . 1-2 7 Reset Operation .......................... . 7-1 4-1 Data Type and Addressing .............. . 4-1 8 Native and pPD8080AF 6-1 Interrupt Sources ......................... . 6-1 Emulation Modes ......................... . 8-1 9-1 Signal Status in Standby Mode ......... . 9-1 Native and 8080 Mode Shifting ....... . 8-1 12-1 Operand Types ............................ . 12-1 Native to 8080 Emulation Mode ...... . 8-2 12-2 Instruction Words ......................... . 12-2 9 Standby Mode ............................ . 9-1 12-3 Operation Description ................... . 12-2 Entering Standby Mode ............... . 9-1 12-4 Flag Operations ........................... . 12-3 Status Signals in Standby Mode ...... . 9-1 12-5 Memory Addressing ...................... . 12-3 Exiting Standby Mode by 12-6 Selection of 8- and 16-Bit Registers .... . 12-3 External Interrupts ..................... . 9-1 12-7 Selection of 8-Bit and Exiting Standby Mode Segment Register ......................... . 12-3 by Reset ................................. . 9-1 10 Logical and Physical Addresses ........ . 10-1 Figure Physical Address Generation ......... . 10-1 1-1 pPD70108170116 Simplified Block Memory Segments ..................... . 10-1 Diagram .................................... . 1-1 11 Addressing Modes ........................ . 11-1 1-2 Pin Configuration, Instruction Address .................... . 11-1 40-Pin Plastic or Ceramic DIP .......... . 1-2 Memory Operand Address ............ . 11-2 1-3 Pin Configuration, 12 Instruction Set ............................ . 12-1 44-Pin PLCC .............................. . 1-3 Data Transfer ........................... . 12-4 1-4 Pin Configuration, Repeat Prefixes ......................... . 12-14 52-Pin Plastic Miniflat .................... . 1-3 Primitive Block Transfer ................ . 12-16 3-1 pPD70108170116 Block Diagram ........ . 3-2 Bit Field Manipulation ................. . 12-21 3-2 Effective Address Generator ............ . 3-3 InpuVOutput ............................ . 12-25 4-1 Memory Map .............................. . 4-1 Primitive Input/Output ................ . 12-28 4-2 Word and Double Word Placement Addition/Subtraction .................. . 12-29 in Memory ................................. . 4-1 BCD Arithmetic ........................ . 12-42 4-3 pPD70108 Memory Interface ............ . 4-2 Increment/Decrement .................. . 12-47 4-4 pPD70116 Memory Interface ............ . 4-2 Multiplication ........................... . 12-50 4-5 I/O Map .................................... . 4-3 Division .................................. . 12-56 5-1 Read Timing of pPD70108 Memory BCD Adjust ............................. . 12-61 and I/O (Sma"-Scale Systems) ......... . 5-1 Data Conversion ....................... . 12-63 5-2 Write Timing of pPD70108 Memory Comparison ............................. . 12-65 and I/O (Sma"-Scale Systems) ......... . 5-1 Complement Operation ............... . 12-68 5-3 Read Timing of pPD70116 Memory Logical Operation ...................... . 12-70 and I/O (Sma"-Scale Systems) ......... . 5-1 Bit Manipulation ........................ . 12-81 5-4 Write Timing of pPD70116 Memory Shift ...................................... . 12-100 and I/O (Small-Scale Systems) ......... . 5-1 Rotate ................................... . 12-118 NEe Electronics Inc. !tt{EC CONTENTS (coni) Figure Page Figure Page 5-5 Read Timing of pPD70108 Memory 8-1 Corresponding Registers ................. 8-1 and I/O (Large-Scale Systems) .......... 5-2 8-2 Corresponding PSW and Flags .......... 8-1 5-6 Write Timing of pPD70108 Memory 8-3 Mode Shift Operation of CPU ............ 8-2 and I/O (Large-Scale Systems) .......... 5-2 8-4 Shift from Native to 8080 Mode 5-7 Read Timing of pPD70116 Memory Using BRKEM Instruction ................ 8-3 and I/O (Large-Scale Systems) .......... 5-2 8-5 Shift from Native to 8080 Mode 5-8 Write Timing of pPD70116 Memory Using RETI Instruction ••••••••••••••• 0 ••• 8-3 and I/O (Large-Scale Systems) .......... 5-2 8-6 Shift from 8080 to Native Mode 6-1 Interrupt Vector Table ..................... 6-1 Using NMI, INT, and 6-2 pPD70108 Interrupt Acknowledge CALLN Instruction ........................ 8-4 Timing ...................................... 6-2 8-6 Shift from 8080 to Native Mode 6-3 pPD70116 Interrupt Acknowledge Using RETEM Instruction ................ 8-5 Timing ...................................... 6-2 10-1 Physical Addressing •• 0 ••••••••••••••••••• 10-1 Revision History Aug 1985 Original Issue Sep 1986 Table 1-1 revised, figures 1-3 and 1-4 added, Section 2 revised and re- arranged. Marginal arrows (~) identify significant changes in Sections 1, 2, and 12. Section t-IEC Introduction Description Figure 1-1. tlPD70108170116 Simplified Block Diagram The tlPD70108 (V20) and tlPD70116 (V30) are high- performance, low-power CMOS microprocessors with Bus Control Un" (BCUr-)---..,~--t Data a 16-bit internal architecture. The tlPD70108 has an Bus Buller and Control Address 8-bit external data bus and the tlPD70116 has a 16-bit Control external data bus. Figure 1 is a simplified block diagram. The tlPD70108170116 has a powerful instruction set Clock, Interrupt, Standby, ClK that is a superset of the tlPD8086/8088 instruction set and T-St8le logic BCU Registers INT and provides the following enhanced operations: • Multidigit BCD addition, subtraction, comparison of 1- to 254-digit BCD strings • High-speed multiplication/division • Bit field manipulations - Data transfer of 1- to 16-bit fields between Effective Address & Microcode memory and accumulator • Bit manipulation instructions - 8- or 16-bit register/memory operands - Set, clear, invert, or test any bit Dedicated hardware performs high-speed multipli- Execution Unit (EXU) cation/division (4 to 6 tiS at 8 MHz) and effective Sub-Data Bus Main Data Bus address calculation. In addition, an internal dual bus 49-000405A system reduces processing time. Pin Identification The tlPD70108170116 has three operating modes: native, emulation, and standby. Native mode executes Table 1 lists pins in alphabetical order by ~ymbol and the tlPD70108170116 instruction set; emulation mode briefly describes pin functions. Section 2 gives directly executes the tlPD8080AF instruction set. additional descriptions. The standby mode significantly reduces power Figures 1-2,1-3, and 1-4 are pin configuration drawings consumption. of the four package types: 40-pin plastic or ceramic DIP, 44-pin plastic leaded chip carrier (PLCC), and Features 52-pin plastic miniflat. D 101 instructions D 250-ns instruction execution time (8-MHz clock) D 1-Mbyte addressable memory D Various memory addressing modes D 14- x 16-bit register set D High-speed block transfers - tlPD70108: 1.0 Mbytes/second (at 8 MHz) - tlPD70116: 2.0 Mbytes/second (at 8 MHz) D Various interrupt processing functions D IEE-796 bus-compatible interface ~ D 5-, 8-, 10-MHz clock ~ D 40-pin plastic/ceramic DIP, 44-pin PLCC, and 52-pin plastic miniflat packages D Single +5-volt power source V20 and V30 are trademarks of NEC Corporation. 1-1 pPD7010sn0116 t-{EC ~ Table 1-1. pPD70108170116 Pin Identification Figure 1-2. Pin Configuration, 40-Pln Plastic or Symbol DIrection Function (Note 3) Ceramic DIP Out High-order address bitsl Processor status bits IC VDO A14 A1S Out Middle address bits A13 A16/PSO ADrADo (Note 1) In/Out Address/data bus A12 A17/PS1 AD15-ADO (Note 2) In/Out Address/data bus A11 A1S/PS2 A10 A19/PS3 ASTB (OSo) Out Address strobe Ag LBSO [HIGH] (Queue status bit 0) As S/LG BUFEN (BSo) Out Buffer enable AD7 RD (Bus status bit 0) ADs pPD HLDRQ [RQ/AKO] BUFR/W (BS1) Out Buffer read I write ADs 70108 HLDAK [RQ/AK1] (Bus status bit 1) AD4 WR [BUSLOCK] AD3 10/M [BS2] ClK In Clock AD2 BUFR/W [BS1] GND Ground AD1 BUFEN [BSo] HlDAK (ROI AK1) Out Hold acknowledge output ADo ASTB [QSo] (In/Out) (Bus hold request inputl NMI INTAK [QS1] Acknowledge output 1) INT POLL CLK READY HlDRO (ROI AKo) In Hold request input (In/Out) (Bus hold request inputl GND RESET Acknowledge output 0) IC Internally connected (Note 4) IC VOO INT In Maskable interrupt AD14 AD1S AD13 A1&1PSO INTAK (OS1) Out Interrupt acknowledge AD12 A17/PS1 (Queue status bit 1) AD11 A1S/PS2 101M (BS2) Out Access is I/O or memory AD10 A19/PS3 (Note 1) (Bus status bit 2) ADg UBE 101M (BS2) Out Access is I/O or memory ADa S/LG (Note 2) (Bus status bit 2) A D7 RD AD6 pPD HLDRQ [RQ/AKo] lBSO (HIGH) In latched bus status 0 70116 ADs HLDAK [RQ/AK1] (Note 1) (Always high) AD4 WR [BUSLOCK] NC Not connected AD3 IO/M [BS2] NMI In Nonmaskable interrupt AD2 BUFR/W [BS1] AD1 BUFEN [BSo] POll In Poll ADO ASTB [QSo] RD Out Read strobe NMI INTAK [QS1] READY In Ready INT POLL CLK READY RESET In Reset GND RESET S/lG In Small-scale system inputl 83-004104B large-scale system input UBE (Note 2) In Upper byte enable (4) Ie should be connected to ground. Voo +5-volt power supply (5) Unused input pins should be tied to ground or Voo to minimize WR (BUS lOCK) Out Write strobe power dissipation and prevent potentially harmful current flow. (Bus lock) Note: (1) pPD70108 only. (2) pPD70116 only. (3) Where pins have different functions in small- and large-scale systems, the large-scale system pin symbol and function are in parentheses. 1-2 NEe Section 1 Introduction ~ Figure 1-3. Pin Configuration, 44-Pin Plastic ~ Figure 1-4. Pin Configuration, 52-Pin Plastic Leaded Chip Carrier (PLCC) Mlnlflat I~ I~ oa: o .... 0 J: Z N ~ 0 m ~ ~ ~ ~ ~ M N ,.... 0 ~ ~ ~ ~ ~ ~ ~ ~ Mo en ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ... ... A1S/PS2 40 '" '"28 ASTB [OSo] A1S/PS2 1 0 39 ASTB [OSO] A17/PS1 41 27 INTAK [OS1] A17/PS1 2 38 INTAK [OS1] A16/PSO 42 26 POll A16/PSO 3 37 POll A15 43 25 READY A15 4 36 READY Voo 44 24 RESET VOO 5 35 RESET tJPD NC 10 70108 23 NC VOO 6 tJ PD 34 GND GND 2 22 GND GND 7 33 GND 70108 A14 3 21 ClK GND 8 32 NC A13 4 20 INT IC 9 31 GND A12 5 19 NMI A14 10 30 ClK An 6 18 NC A13 11 29 INT A12 12 28 NMI A11 13 27 NC < Q ~ ~ ~ ~ ~ 0 0 0 ~ ~ ~ ~ ~ ~ 0 ~ M 0 0 ~ N ~ ~ 0 0 ~ Q ~ '" en ~ w 10 ~ lID ~ 10 oZ~:Jena: ~ ~ ~ ~ ~ ~ ~ ~ Mo en AD1S/PS2 40 '" '"28 ASTB [OSo] AD17/PS1 41 27 INTAK [OS1] AD16/PSo 42 26 POll AD1S/PS2 10 39 ASTB [OSo] AD15 43 25 READY AD17/PS1 2 38 INTAK [OS1] Voo 44 24 RESET AD16/PSO 37 POll tJ PD NC 1 0 70116 23 NC AD15 36 READY GND 2 22 GND VOO 35 RESET AD14 3 21 ClK VOO 34 GND pPD AD13 4 20 INT GND 70116 33 GND AD12 5 19 NMI GND 32 NC AD11 6 18 NC IC 31 GND AD14 10 30 ClK AD13 11 29 INT o ~ ~ ~ ~ ~ ~ M N ~ 0 cOOOOOOOOOO AD12 12 28 NMI ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ AD11 13 27 NC 83-0041028 o 0 ~ w ~ ~ ~ ~ M N ~ 0 0 Z COO 0 0 0 0 0 0 0 0 Z ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 83-0041038 1-3 pPD7010sn0116 NEe 1-4 NEe Section Ci)) Pin Description (6 .~ This section describes the functions of input and AD1S-ADO [Address/Data Blis] output signals. Descriptions are in alphabetical order by pin symbol. Unless otherwise specified, they apply In the pPD70116 only, AD15-ADo is a time-multiplexed address/data bus. An AD bit is 1 when high and 0 when to pPD70108 and pPD70116 in small-scale and large- scale systems. low. The bus contains the lower 16 bits of the 20-bit address during T1 of the bus cycle. The bus is used as a The width of the data bus is different for the pPD70108 16-bit data bus during T2, T3, and T4 of the bus cycle. and pPD70116. Therefore, each microprocessor uses The address/data bus is tri-state and can be at a high or the address/data bus in a different manner. low level in standby mode. The bus is at high impedance Memory identification signals for the two processsors during hold acknowledge and interrupt acknowledge. are also different. The pPD70108 uses an 10/M signal; the pPD70116 uses an iO/M signal. ASTB [Address Strobe] In a small-scale system, the CPU generates ASTB to A19-A1e1PS3-PSO [Address Bus/Processor Status] latch address information at an external latch. ASTB is held to a low level in standby mode. These lines are time-multiplexed to operate as an address bus and also to output the processor status BS2-BSO [Bus Status] signals. In a large-scale system, the CPU uses these status When used as the address bus, A19-A16 are the four signals to allow an external bus controller to monitor high-order bits of the 20-bit memory address. During the current bus cycle. The external bus controller an I/O bus cycle all four bits are O. decodes BS2-BSO and generates the control signals required to perform a memory or I/O device access. Processor status signals are for memory and I/O use. PS3 is always 0 in the native mode and always 1 in the The BS2-BSO signals are tri-state outputs and become emulation mode. The contents of the interrupt enable high impedance during hold acknowledge. They are flag (IE) are carried via PS2. Signals PS1 and PSo held to a high level in the standby mode. indicate which memory segment is being accessed. BS2 BSI BSg Bus Cycle A17-PSI AI6- PSO Memory Segment 0 0 0 Interrupt acknowledge 0 0 Data segment 1 0 0 1 1/0 read 0 1 Stack segment 0 0 1/0 write 0 Program segment 0 1 Halt Data segment 0 0 0 Program fetch These pins are tri-state and become high impedance 0 1 Memory read during hold acknowledge. 0 Memory write Passive state A1s-Aa [Address Bus] I n the pPD70108 only, A15-Aa are the middle 8 bits of the BUFEN [Buffer Enable] 20-bit address. This bus is tri-state and becomes high =-:-::=:-:- In a small-scale system, BUFEN is used as the output impedance during hold acknowledge. An address bit is enable signal for an external bidirectional buffer. The 1 when high and 0 when low. CPU generates this signal during data transfer opera- tions with an external memory or I/O device or during AD7-ADO [Address/Data Bus] the input of an interrupt vector. In the pPD70108 only, ADrADo is a time-multiplexed The BUFEN signal is held to a high level in the standby address/data bus. These lines output either the lower 8 mode and becomes high impedance during hold bits of the 20-bit address or 8 bits of data. Input/output acknowledge. ~ of 16-bit data is performed in two steps: low byte followed by high byte. This is a tri-state bus and becomes high impedance during hold and interrupt acknowledge. An AD bit is 1 when high and 0 when low. 2-1 pPD7010an0116 t-IEC ~ BUFR/W [Buffer Read/Write] INT [Maskable Interrupt] In a small-scale system, the level of this signal The INT pin is used for interrupt requests that can be determines the direction of data transfer with an masked by software. This input is an active high level external bidirectional buffer. A high signal specifies and is sensed during the last clock of the current data transmission from the CPU to an external device. instruction. The interrupt will be accepted ifthe system A low signal specifies data transmission from the is in the interrupt enable state (interrupt enable flag external device to the CPU. IE = 1). The CPU generates INTAK to notify external devices that the interrupt request is being acknowl- This output can be a high or low level in the standby edged. INT must be held high until the INTAK signal is mode. It becomes high impedance during hold returned. acknowledge. If NMI and INT interrupts occur at the same time, NMI BUSlOCK [Bus lock] has priority and INT will not be accepted. A hold request will be accepted even during interrupt In a large-scale system, the CPU uses this signal to acknowledge. secure the bus while executing the instruction immedi- atelyfollowing the BUSlOCK prefix. Thesignal inhibits INT causes the microprocessor to exit the standby other bus masters in a multiprocessor system from mode. using the system bus during this time. The output is held to a high level in the standby mode, but is a low INTAK [Interrupt Acknowledge] level if the BUSlOCK instruction is executed immedi- In a small-scale system, when the CPU accepts an INT ately before a HALT instruction. signal, it asserts the INTAK signal active low. The The signal is tri-state and becomes high impedance interrupting device synchronizes with the signal and during hold acknowledge. puts the interrupt vector number on the data bus (ADrADo)· ClK [Clock] During standby mode, INTAK is held to a high level. The ClK pin is the external clock input. IO/M [IO/Memory] HlDAK [Hold Acknowledge] In a small-scale pPD70108 system, the CPU outputs In a small-scale system, HlDAK indicates the CPU has this signal to indicate either an I/O or memory access. A accepted a hold request signal (HlDRQ). While high-level output specifies an I/O access and a low- HlDAK is high, the address bus, address/data bus, and level output specifies a memory access. This output control lines are held in the high-impedance state. can be a high or low level in the standby mode. The pin is tri-state and becomes high impedance HlDRQ [Hold Request] during hold acknowledge. In a small-scale system, external devices input the HlDRQ signal to request that the CPU release the IO/M [IO/Memory] address, address/data, and control buses. In a small-scalepPD70116 system, the CPU generates this signal to specify either an I/O access or a memory IC [Internally Connected] access. A low-level output specifies an I/O access and The IC pin is used for factory tests. Normally, the a high-level output specifies a memory access. The pPD70108170116 is used with this pin at ground output can be a high or low level in the standby mode. potential. The pin is tri-state and becomes high impedance during hold acknowledge. ~ 2-2 ftt{EC Section 2 Pin Description ~ LBSO [Latched Bus Status 0] QS1, QSo [Queue Status] In a small-scale pPD70108 system, the CPU uses this In a large-scale system, the CPU uses QS1 and QSo to signal (along with the 101M and BUFR/W signals) to allow external devices, such as the floating-point inform external devices of the status of the cu rrent bus arithmetic processor chip, to monitor the status of the cycle. See below. internal CPU instruction queue. 101M BUFR/W LBSO BUS Cycle QSo Instruction Queue Status 0 0 0 Program fetch o o NOP (queue did not change) 0 0 1 Memory read o First byte of an instruction taken from queue 0 0 Memory write o Flush queue 0 1 1 Passive state Subsequent byte of instruction taken from queue 0 0 Interrupt acknowledge 0 1 1/0 read The instruction queue status indicated by these signals 0 1/0 write is the status when the execution unit (EXU) accesses Held the instruction queue. The data output from QSo and QS1 is therefore valid only for one clock immediately following queue access. NMI [Nonmaskable Interrupt] QS1 and QSo enable the floating-point processor chip The NMI signal is used for interrupt requests that to monitor the CPU's program execution status. In this cannot be masked by software The interrupt is triggered manner, the floating-point processor can synchronize on the rising edge of NMI and can be sensed during any its operation with the CPU whenever it gains control clock cycle. NMI must be held high for at least five from a floating-point operation instruction (FPO). clock cycles after its rising edge. Actual interrupt processing begins after completion of the instruction QS1 and QSo are held to a low level during standby in progress. mode. The contents of interrupt vector 2 determines the RD [Read Strobe] starting address for the interrupt servicing routine. A hold request will be accepted even during NMI The CPU outputs the RD signal during a data read from acknowledge. This interrupt will cause the micro- an 1/0 device or memory. The 101M or 101M signal processor to exit the standby mode. determines whether the read is 1/0 or memory. RD is a tri-state output and becomes high impedance during a POLL [Poll] hold acknowledge. The CPU checks the input at this pin when executing READY [Ready] the POLL instruction. If the input is low, execution continues. If the input is high, the CPU will check the READY indicates that the data transfer is complete. A state of the input every five clock cycles until the input high indicates READY is true; a low indicates READY is again becomes low. false (not ready). These functions synchronize CPU program execution When READY goes high during a read cycle, the data is with the operation of external devices. latched one clock cycle later and the bus cycle is terminated. When READY goes high during a write cycle, the bus cycle is terminated one clock cycle later..... 2-3 pPD7010sn0116 tt(EC ~ RESET [Reset] UBE [Upper Byte Enable] RESET is the CPU reset signal and is an active high USE indicates the use of the upper 8 bits (AD15-ADs) of level. This signal has priority over all other operations. the data bus. This signal is active low during T1-T4 of After RESET returns to the low level, the CPU begins the bus cycle. Sus cycles in which the signal is active execution of the program starting at address FFFFOH. are shown below: RESET causes the microprocessor to exit the standby mode. Type of Number of Bus Operation UBE ADD Bus Cycles RQ/AK1, RQ/AKO Hold Request Acknowledge Word to even address 0 0 1 In a large-scale system, these pins function as the bus Word to odd address 0* 1 hold request inputs (RQ), and the bus hold acknow- 1** 0 2 ledge outputs (AK). The RQ/AKo signal has priority over the RQ/AK1 signal. Byte to even address 0 These signals have tri-state outputs with on-chip pull- Byte to odd address 0 up resistors that keep the pins at a high level when the * First bus cycle output is at the high-impedance state. ** Second bus cycle S/LG [Small/Large] USE goes low continuously during the interrupt This signal determines the operating mode ofthe CPU. acknowledge state. The signal is held high during The signal is fixed at either a high or low level. When standby mode. The signal is a tri-state output and the signal is high level, the CPU operates in the small- becomes high impedance during a hold acknowledge. scale system mode. When the signal is low level, the Section 4, Memory Accessing, contains detailed infor- CPU operates in the large-scale system mode. A small- mation on the use of USE. scale system will have at most one additional bus master requesting use of the bus. A large-scale system WR [Write Strobe] can have more than one. In a small-scale system, the CPU asserts WR during a As noted in table 1-1, some pins have different symbols write to an 1/0 device or memory. The 101M or 101M and functions in small-scale and large-scale systems. signal selects either 1/0 or memory. The WR output is held to a high level in the standby mode. The pin is tri-state and becomes high impedance during hold acknowledge. .... 2-4 t-IEC Section 6;5) Functional Description \9) As shown in figure 3-1, the pPD70108 and pPD70116 AH Byte multiplication / division both contain two internal, independent processing units: BW Translation an execution unit (EXU) and a bus control unit (BCU). CW Loop control branch, repeat prefix The EXU controls the internal data processing that exe- cutes the instruction set of the pPD70108170116. CL Shift instructions, rotation instructions, BCD operations The BCU is the interface between the EXU and the exter- nal bus. It prefetches instructions for the instruction DW Word multiplication/division, indirect queue - 4 bytes in the pPD70108 and 6 bytes in the addressing, I/O pPD70116. It also accesses memory (upon request from the EXU) for additional operands, or stores EXU results. Pointers (SP, BP) and Index Registers (IX, IV) These registers serve as base pOinters or index registers EXECUTION UNIT (EXU) when accessing memory using based, indexed, or base The EXU includes the following functional elements: indexed addressing. • Program Counter These registers can also be used for data transfer and • General Purpose Registers (AW, BW, CW, DW) arithmetic and logical operations in the same manner as • Pointers (SP, BP) and Index Registers (IX, IY) the general-purpose registers. They cannot be used in • Temporary Register/Shifter (TA/TB) these areas as 8-bit registers. • Temporary Register C (TC) Also, the SP, IX, and IV registers act as default registers • Arithmetic and Logic Unit (ALU) for specific operations. The default assignments are: • Program Status Word (PSW) • Loop Counter (LC) SP Stack operations • Effective Address Generator (EAG) IX Block transfer, BCD string operations • Instruction Decoder (source) • Microaddress Register • Microinstruction ROM IV Block transfer, BCD string operations • Microinstruction Sequencer (destination) • Dual data bus Temporary Register/Shifter (TA/TB) Program Counter (PC) TA/TB are 16-bittemporary registers/ shifters used in the The program counter is a 16-bit binary counter that con- execution of multiply/divide and shift/rotate (including tains the segment offset of the program memory address BCD rotate) instructions. Execution of multiplication/ divi- of the next instruction which the EXU is to execute. sion instructions can be accomplished approximately The PC increments each time the microprogram fetches four times faster than when using the microprogramming a byte from the instruction queue. A new location value method. is loaded into the PC each time a branch, call, return, or When executing a multiply or divide instruction, TA+ TB break instruction is executed. At this time, the contents operates as a 32-bit temporary register / shifter. TB oper- of the PC are the same as the Prefetch Pointer (PFP). ates as a 16-bit temporary register/shifter when execut- ing shift/rotate instructions. Both TA and TB can be read General Purpose Registers (AW, BW, CW, OW) from or written to. When this is done from the internal There are four 16-bit general-purpose registers. Each bus, the upper byte and lower byte may be accessed one can be used as one 16-bit register or as two 8-bit independently. The contents of TA and TB are inputs to registers. This is accomplished by dividing the registers the ALU. into their high and low bytes (AH, AL, BH, BL, CH, CL, DH, DL). Temporary Register C (TC) Each register is also used as a default register for The TC is a 16-bit temporary register used for internal processing specific instructions. The default assign- processing such as a multiply or divide operation. The ments are: contents of TC are inputs to the ALU. AW Word multiplication/division, word I/O, data Arithmetic and Logic Unit (ALU) conversion The ALU consists of a full adder and a logical operation AL Byte multiplication/division, byte I/O, BCD unit. The ALU performs the following arithmetic rotation, data conversion, translation operations: 3-1 pPD7010S/70116 NEe Figure 3-4. pPD7010BI70116 Block Diagram ,--------------------------------------, I 12 I A 1\ I 'I 8 I Internal Address/Data Bus (IADo·IAD,e) 1\ Bus Buffer ~ I I V 4 I 'JI ~ I I ~ ADM 16 r I 'I I LBSO'[UBEJ Z I I 1~ , BUFFEN [BSOJ, BUFRIW [BS1) I Bus 101M [BSz) [Note 1) r- 8 Contro I 10/M [BSzJ [Not. 2) Unit PS ASTB [QSOJ, INTAK [QS1) (BCl,I) 55 Status RD, WR [BUSLOCKl I DSO Control I ;l--l\, OSI S/lG I \f'-y READV PFP I 1\ DP RESET POll I -"II TEMP I Vi- : I QO I: Q1 HLDRQ (RQ/AKo) T·State Bus Hold I Q2 Q3 f\r- I Control II Control HLDAK (RQ/AKtI I Q4 Q5 2 it I I II ~l Cycle Decision JI Interrupt Control I: NMI INT (-- .,J..J,.. lC I I I - JI I· Queue Standby ClK PC Control Control AW BW CW ;L- OW fl--J\ Effective Address Generator '-.["- IX i'rY" IV - BP t ~ SP ~ -.~ ~ . fL Instruction Microinstruction Bua Executlo n Unit !II ~iil ~ .. !v' Storage TC ~ (EXU) £) I TA I: SHIFTER CD '--- I TB I: CD I i I I 1 ~ .. III I: § fLSequence Control I I I II \ AlU I I I 1\ ~ V Instruction Decoder I I 'I -V II ~ I psw I - 'I v_ I Sub-data Bus Main Data Bus I ~~ ~~ L ___________________________________ ~ Notes. I. IlPD70108 only 2. IlPD70116 only 49000!43C 3-2 Section 3 t\'EC Functional Description • Add, subtract, multiply, and divide Effective Address Generator (EAG) • Increment, decrement, and two's complement The effective address generator (EAG) performs a high- The ALU also performs the following logical operations: speed effective address calculation for memory access. • AND, OR, XOR, complement While the microprogramming method normally requires • Bit test, set, clear, and complement 5 to 12 clock cycles to calculate an address, the EAG completes all the EA calculations in 2 clocks for all ad- Program Status Word (PSW) dressing modes (see figure 3-2). The PSW contains six status flags: The EXU fetches the instruction bytes that have the oper- and field and determines if the instruction will require a • V (Overflow) memory access. If it does, the EAG calculates the effec- • S (Sign) tive address and transfers it to the DP (data pointer) • Z (Zero) which generates control signals that handle the ALU and • AC (Auxiliary carry) corresponding registers. In addition, if it is necessary, the • P (Parity) EAG requests a bus cycle from the BCU. • CY (Carry) Instruction Decoder The program status word also contains four control flags: The instruction decoder decodes the first byte of an • MD (Mode) instruction into groups with specific functions and holds • DIR (Direction) them during the instruction execution. • IE (Interrupt enable) • BRK (Break) Microaddress Register When the PSW is pushed onto the stack, the word format The microaddress register specifies the starting address of the various flags is as follows: in the microinstruction ROM of the next instruction to be PSW executed. At the beginning of a new instruction, the first byte of the instruction is taken from the prefetch queue 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 and put into the microaddress register. The register then M V 0 I B S Z 0 A 0 P C specifies the starting address of the corresponding 0 I E R C y microinstruction sequence. R K The status flags are set and reset depending on the result Microinstruction ROM of each type of instruction executed. Instructions are The microinstruction ROM has 1024 microinstructions. provided that set, reset, and complement the CY flag Each microinstruction is 29 bits wide. directly. Other instructions set and reset the control flags and control the operation of the CPU. Figure 3-2. Effective Address Generator Loop Counter (LC) Mod Mem The loop counter (LC) is a 16-bit register which counts: • Loop times specified in the primitive block transfer 1 • I/O instructions controlled with repeat prefix instruc- tions such as REP and REPC EA Generator • Shifts for the mUlti-bit shift/rotate instructions The processing speed for multiple-bit rotation of a reg- ister is approximately twice as fast as when using the 1 Effective Address microprogram method. 49-000036A Example: RORC AW,CL ;CL=5 Microprogram Method Loop Counter Method 8 + (4 X 5) = 28 clocks 7 + 5 = 12 clocks 3-3 pPD7010S/70116 ttlEC Microinstruction Sequencer Prefetch Queue (QO-Q3/QO-QS) The microinstruction sequencer controls the microad- The pPD70108170116 has a prefetch queue that can dress register operation, microinstruction ROM output, store 4/6 instruction bytes that are prefetched by the and the synchronization of the EXU with the BCU. BCU. The instruction bytes stored in the queue are taken from the queue and executed by the EXU. The queue is Dual Data Bus cleared when a branch, call, return, or break instruction has been executed, or when an external interrupt has The pPD70108170116 contains a dual, 16-bit data bus been acknowledged. that consists of a main and subdata bus. The dual data bus reduces the number of processing steps for instruc- Normally, the pPD70108 prefetches a byte if the queue tion execution. For addition/subtraction and logical has one or more empty bytes. ThepPD70116 prefetches and comparison operations, processing time is approx- if the queue has one or more empty words (two bytes). imately 30% faster then in single-bus systems. If the time required to prefetch the instruction code from external memory is less than the mean execution time Example: of instructions executed sequentially, the actual instruc- ADD AW,BW ;AW-AW+BW tion cycle will be shortened by the time needed to fetch the instructions. This occurs because the next instruc- Single-Bus System Dual-Bus System tion code to be executed by the EXU will be available 1. TA-AW TA-AW, TB - BW in the queue immediately after the completion of the 2. TB-BW AW-TA+TB previous instruction. As a result, the processing speed 3. AW-TA+TB is increased when compared with a conventional CPU where the fetch and execute times do not overlap. BUS CONTROL UNIT (BCU) The queuing effect will be lowered if there are many The BCU includes the following functional elements: instructions which clear the queue; for example, a branch instruction, or a series of instructions with a short • Prefetch Pointer (PFP) instruction time. • Prefetch Oueue (00-03/00-05) • Data Pointer (DP) Data Pointer (DP) • Temporary Communication Register (TEMP) • Segment Registers (PS, SS, DSo, DS1) The DP is a 16-bit register that contains the read/write • Address Modifier (ADM) addresses of variables. Effective addresses calculated by the effective address generator are transferred to Prefetch Pointer (PFP) the DP. The PFP is a 16-bit binary counter that contains a pro- Temporary Communication Register (TEMP) gram segment offset. The offset is used to calculate a phYSical address that the Bus Control Unit (BCU) uses The TEMP is a 16-bit temporary register that stores data to prefetch the next byte or word for the instruction being transferred between the external data bus and queue. The contents of the PFP are an offset from the the EXU. Program Segment register (PS). The TEMP can be read from or written to independently The PFP is incremented each time the BCU prefetches by the upper or lower byte. Basically, the EXU completes an instruction from the program memory. A new location a write operation by transferring data to the TEMP and will be loaded into the PFP whenever a branch, call, completes a read operation by taking the data transferred return, or break instruction is executed --- this provides to the TEM P from the external data bus. a time savings of several clocks since the PC does not require adjustment. At that time, the contents of the PFP will be the same as those of the program counter (PC). 3-4 t-IEC Section 3 Functional Description Segment Registers (PS, SS, DSo, DS1) The memory addresses accessed by the pPD701081 70116 are divided into 64 Kbyte logical segments. The starting (base) address of each segment is specified by a segment register. The offset from this starting address is specified by the contents of another register or by the effective address. The pPD70108170116 uses four types of segment registers: Segment Register Default Offset PS (Program Segment) PFP SS (Stack Segment) SP, Effective Address DSo (Data Segment 0) IX, Effective Address DS1 (Data Segment 1) IY, Effective Address Address Modifier (ADM) The address modifier logic generates a physical memory or 1/0 address by adding the segment register and PFP (or DP) contents. 3-5 pPD7010S/70116 NEe 3-6 NEe Section ~ Memory and 1/0 Configuration ~ MEMORY CONFIGURATION Table 4-1 Data Type and Addressing Data Address Data Conllguratlon Memory contains instructions, interrupt handler start addresses, stack data, and general data. Some of this Instruction Code Even or odd 1-6 bytes data is stored in bytes and other in words. The Interrupt Vector Table Even 2 words/vector JlPD7010S/70116 can access up to 1 Mbyte (512 Kwords) Even or odd Word Stack of memory by using the 20-bit address bus (A19-AO)' General Variable Even or odd Byte, word, or double As the memory map in figure 4-1 shows, the first 1 Kbytes word of addresses (OH-3FFH) are used for the interrupt vector table. Parts of this area may also be used for other pur- Figure 4-2. Word and Double Word Placement in poses in some systems. The 12 bytes from address Memory FFFFOH to FFFFBH are always used by the CPU when it is reset, and therefore cannot be used for any other 1 1 FFFFFH purpose. The four bytes from addresses FFFFCH to FFFFFH are .... i" reserved for future use and are not available. Memory data can be stored in both even (Ao = 0) and Increasing High Order Byte (Bils 24-31) odd (Ao = 1) addresses. The area where the interrupt addresses (Bils 16-23) start addresses (interrupt vector table) are stored must (Bils 8-15) use even addresses. The JlPD70116 can access a word Low Order Byte (Bils 0-7) regardless of whether the word is at an even or odd address. This allows both even and odd addresses to be used for an instruction. Table 4-1 shows the type and configuration of data, and address requirements. Figure 4-2 shows the placement of word and double word data in memory. High Order Byte (Bils 8-15) Jword Low Order Byte (Bils 0-7) Figure 4-1. Memory Map OH } OOOOOH r- _____lnl_er_ru_pl_ve_C_'Or_"_ab_le_ _ _-----! ~~eo':~i~.' - - - - 1 Byte - - - 3FFH 49-0000383A 400H General FFFEFH FFFFOH RESET FFFFBH FFFFCH Reserved FFFFFH 1 Byte 4-1 pPD7010S/70116 NEe MEMORY ACCESSING banks, each containing 512 Kbytes of data (figure 4-4). Oata lines 07-00 are connected to the low-order memory Since the pP070108 data bus is only 8 bits wide, only bank and address bit Ao selects this bank when Ao=O. one byte (8 bits) is accessed during one bus cycle. Two Oata lines 015-08 are connected to the high-order bus cycles are required to access a data word from either memory bank and signal USE is used to select this bank an even or odd address. Figure 4-3 shows the interface when USE is low. Address bits 19-1 contain the physical between memory and the pP070108. Figure 4-4 shows address within a data bank where the byte of data is to the interface between memory and the pP070116. be accessed. The address space for the pP070116 is 1 Mbyte, but because the pP070116 can transfer both bytes and words of data, the physical memory appears to be two Figure 4-3. pPD70108 Memory Interface A,.-Ao'l '---------'----'~J t Address Busr:.(2::,.OB::;;;it:::!s)_ _ _ _ _ _ _ _---' Memory (1 MBytes) li OrOo\L-_ _ _ _ _ _ _ _~0~am~B~U~s(~8B~it~S)_________________~ 49-000053A Figure 4-4. pPD70116 Memory Interface 'I Address Bus (19 Bits) 'I 19 19 1 '" BSEL 7 BSEL ~7 Memory Memory High-Order Low-Order Bank Bank (512 KBytes) (512KBytes) 8 D,s-D. 80 r Oo 0'5-0 0) Data Bus (16 Bits) ) 49·000052A 4-2 t-IEC Section 4 Memory and 1/0 Configuration The following chart shows how Ao and UBE are used. twice. The word must be read from the source first and Memory transfer operations are described after the then written to the destination. If both the source and the chart. destination are odd addresses, the execution time will be maximized. The following example shows the number of clocks required to execute the MOV reg, mem instruction Type 01 Bus for both a byte and word of data. Operation UBE AO Number 01 Bus Cycles Word to even address 0 0 1 Data Processor Number 01 Clocks Word to odd address 0* 1 2 1** 0 Bytes pPD70108/70116 11 Byte to even address 1 0 Words pPD70116 (even address) 11 Byte to odd address 0 Words pPD701 08/70116 (odd 15 Notes: * First bus cycle address) ** Second bus cycle The above stack information is also true during a stack When transferring a word of data to an even address, the operation since all stack data is organized as words. pP070116 puts the low-order data byte on 07-00, the Twice as many bus cycles are required during a stack high-order data byte on 015-08, and sets both UBE and operation using an odd rather than even address. Ao to O. In this manner, both the low- and high-order memory banks are simultaneously selected and the 110 CONFIGURATION AND ACCESSING transfer is performed in one bus cycle. The pP070108170116 can access up to 64 Kbytes (32 The transfer of a word of data to an odd address requires Kwords) of 1/0 address area independent of memory. two bus cycles. In the first cycle, the pP070116 puts the However, the upper 256 bytes (FFOOH-FFFFH) are re- low-order data byte on 015-08, sets UBE to 0, sets Ao served by NEC for future use. The 1/0 address area is to one, and transfers the first byte to the high-order addressed by the lower 16 bits of the address bus. Figure memory bank. In the second cycle, thepP070116 incre- 4-5 shows the II 0 map. ments the address by +1, puts the high-order data byte . on 07-00, sets UBE to 1, sets Ao to 0, and transfers the Unlike memory, segment registers are not used in 1/0 . second byte to the low-order data bank. When the address bus carries 1/0 addresses, address bits A19-A16 are all zeros. Since data is transferred When transferring a byte of data to an even address, the between the CPU and 1/0 in bytes or words, both 8-bit pP070116 puts the data byte on 07-00, sets UBE to 1, and 16-bit 1/0 devices can be connected to the Ao to 0, and transfers the data byte to the low-order pP070116. Only 8-bit 1/0 devices can be connected to memory bank. the pP070108. When transferring a byte of data to an odd address, the In the pP070116, only one bus cycle is required to access pP070116 puts the data byte on 015-08, sets UBE to 0, a word on an even address; two bus cycles are required sets Ao to 1, and transfers the data byte to the high-order to access a word on an odd address. memory bank. When the pP070116 accesses an 8-bit 1/0 device, bits The pP070116 normally prefetches instruction ,codes in Ao and UBE select the device. Bit A1 and higher bits words. However, if a branch operation to an odd address select a device and the registers within that device. When takes place, only one byte is fetched from that odd Figure 4-5. 110 Map address. After that, instruction codes are prefetched in words. OHr----------, When the interrupt vector table is accessed in response to an interrupt, even addresses are always used. Ouring an interrupt, two bus cycles are required because two words (segment base, and offset) are required. One memory bus cycle requires four clocks. Thus, each FEFFH 1-_ _ _ _ _ _.--, time a word from an odd address is accessed, four addi- FFOOH tional clocks are required than when accessing an even- RESERVED address word. When transferring a word from one FFFFH'--_ _ _ _ _ _- - ' memory area to another, the memory must be accessed ----'1 Byte--- 49-0000S1A 4-3 JlPD7010S/70116 NEe accessing 8-bit I/O devices, only even addresses should be assigned to the device and its internal registers. This allows the registers to be selected using only even addresses. Similarly, 8-bit I/O devices with internal reg- isters assigned odd addresses must be accessed using odd addresses. If a memory-mapped I/O configuration (memory address space allocated to an I/O device) is used, the I/O addresses can be allocated to a portion of the 1 Mbyte memory area. In this manner, all CPU addressing modes and instructions can be directly performed on the I/O device. For example, if a bit operation instruction for memory is used, one line of a specific I/O port can be tested for 1 or 0, set to 1, cleared to 0, or inverted. In a memory-mapped I/O configuration, control signals from the CPU are used exactly as for memory. Therefore, the 110 device is distinguished from memory only by its address. Care must be taken so that addresses of vari- ables or the stack do not conflict with the addresses allocated to a memory-mapped I/O device. 4-4 NEe Section ~ Read/Write Timings ~ Bus Cycles and Memory Access The EXU fetches an instruction from the instruction queue and executes it. The BCU continues prefetching One bus cycle is required for each access (read/write) instructions for the instruction queue until the queue of memory or I/O. A bus cycle is basically made up of becomes full. If the EXU does not fetch an instruction four states (clocks): T1 through T4. When the microproc- from the queue because another instruction is still being essor operates at 8 MHz, one state is 125 ns. The executed and the instruction queue is full, the BCU will pPD70108 and pPD70116 fetch instructions and read not prefetch the next instruction. Instead, it automatically data, using exactly the same timing (figures 5-1, 5-3, 5-5, inserts an idle state (TI) after state T3. More idle states and 5-7). Figure 5-1. Read Timing of pPD70108 Memory and Figure 5-3. Read Timing of pPD70116 Memory and 110 (Small-Scale Systems) /10 (Small-Scale Systems) T4 ClK ClK A,./PS3-A,./PSo _ _....Ll.X...:.A.!!.,.-...:.A-'-",.'--'X"--_---'-'PS"'-3--'-P..;:.,SO'---_ _~X A,./PS3-A,./PSo _ _~Xo...:..:A""".-...:.A.:.!.!,.,-,X"---_...:.P...:S,,-3-,,,:,PS::l!O_ _ _--Ll.X UBE _ _-""X_ _ _ _ _ _ _ _ _ _--uX x _ _ _---'-A'''''5-...:.A""._ _ _ _ _...L.\x A'5- A• _ _....Ll. AD1S- ADo ===x=:::;K:::!A~'52;Ao;:)_)--~~~--+C- AD7-ADo ====x=~K=A~7~A~oJ-----<~>---t-C- ASTB _ _...J ASTB _ _.J BUFEN ~ BUFEN ~ \\...._ _ _....JI \ ....._ _-----1 BUFR/W~ _----l~_ _ _ _ _ _ _ _ _ ___'r=---'-_ BUFR/W ~_--"-_ _ _ _ _ _ _ _ _ _ __'r='---_ \\...._ _ _ _...JI \\....____--'1 101M _ _ ..J.X"'--__________..... X iQ/M _ _ ...I.X.l..-__________~X 49-00048A lBSO _ _....I.X"---_ _ _ _ _ _ _ _ _ _...L.\X 49-000050A Figure 5-4. Write Timing of pPD70116 Memory and 110 (Small-Scale Systems) Figure 5-2. Write Timing of pPD70108 Memory and /10 (Small-Scale Systems) T4 T4 1:== 1 Bus Cycle n-+-T2-1--T3-1--T4 j ClK ClK A,./PS3-A,./PS, _ _-ClX....:.A:!.!,•...:.-A2'.!!....IX"--_~PS"'-3-....:.P..;:.,SO'---_ ____'_"_X UBE ____~XOo-_ _ _ _ _ _ _ _ _ _ _ _ _ _ _uX A,./PS3-A,./PSo _ _-""X_A"",._-A-",.'-'X"'--_ _P_S"-3-_PS....::O'--_ _~X A'5- A• _ _~XOo-_ _ _...:.A"""5-...:.A"'-._ _ _ _ _~X AD,5-A,==3x=A~,;:5~Ao;:::XZ===D~';:5~Do~==>E: ASTB _ _...J AD7-ADo ====X=::3K:=!A~7~A~oJXC==:JD&:7~D~o= = = > E ASTB _ _...J BUFEN~ \\....______-...J;--- BUFEN~ \\. . ______-...J;--- BUFR/W~ BUFR/W~ \\....____...JI \ ....._ _ _ _...JI ~/M _ _ __'X"--____________~X 49-000047A 101M _ _..... X"--_________...X~ L8SO _ _... X"--_________...X.>.....- 49-000049A 5-1 pPD70108/70116 t'tIEC are inserted until the EXU finishes executing the instruc- becomes high, the BCU goes to T4 and then to T1 so tion being processed. Then it fetches the next instruction that the next instruction can be fetched. When wait state from the instruction queue. When the next instruction is TW is inserted, the current level of each signal is not fetched, the BCU advances the state of the bus cycle from changed and the read/write timing is longer for that state T4 to T1. cycle. When a memory or I/O device has a long access time, Figures 5-1 through 5-8 show read/write timing for the BCU samples the READY signal (sent from memory pPD70108170116 memory and I/O. The timing diagrams or an I/O device). If READY is low, the BCU will insert are for small- and large-scale systems. wait states TW between T3 and T4. When READY Figure 5-7. Read Timing of pPD70116 Memory and Figure 5-5. Read Timing of pPD70108 Memory and 110 (Large-Scale Systems) /10 (Large-Scale Systems) I- 1 Bus Cycle -l I- 1 Bus Cycle ~ T4 I--n - + -T2-+-T3---+-T4--j ClK T4 r-n-+-T2-+-T3--J--T4--j ClK -A-"".'--'X'-'---_-'P--"-S3"-.--_PS"'-O_ _ _~X A'./PS3-A'./PSo _ _-'-"X'"'-A""'9__ A,9/PS3-A,./PSo _ _-,X-,---,A,,,-9-_ 3-_PS-"'o'--_ _ _~X A .Llx'--_P....:S.... .!-"., • UBE _ _~X_ _ _ _ _ _ _ _ _ _ _ _~X A,5-A. _ _-'X~_ _'--A:.!.215....:-A-"'-._ _ _ _ ___<.>.X AD'5-ADo~=A~';:5~Ao0-)- - - { (:ED~'5~1~Do;::::)>----EC= E ASTB~~_ _ _ _ _ _ __ ASTB ~~_ _ _ _ _ _ _ --JI BS2 -BSo \'-_ _ _ _ _....J7 BS 2 -BSo '\ 7 \'---_ _ _ _....JI \ I ~ ____________~r___ X X X X X '--____-Jr___ £I ::~-:~-: :::t [M-R-D ----""----------' DBEN _ _ _ _ _---' L -_ _ _ ~ 49-000044A 49-000045A Figure 5-8. Write Timing of pPD70116 Memory and 110 (Large-Scale Systems) Figure 5-6. Write Timing of pPD70108 Memory and I- 1 Bus Cycle ~ 110 (Large-Scale Systems) T4 I-n-+-T2-+---T3--l-T4~ ClK T4 ClK UBE _ _ .LXlo...__ _ _ _ _ _ _ _ _- U AD'5-ADo~_A___'_'5"_-_'Ao'-'X'->--_ __"'____"___ _ A,5-A. _ _~X<>-- __---'A-""5'__-"-"A.'_____ _ _ __'_'X ASTB~_ _ _ _ _ _ _ __ _ AD7-ADo ====:):=3«~A:c7-~Ao~X==~D,.-C!D~o===E BS 2 -BSo ' \ ' - -_ _ _ _ _ _ _ _..J ASTB~_ _ _ _ _ _ _ __ aso. asl _ _XA-__X"'--_---'>-_---''''---_~_ BS 2 -BSo \\..-________--J7 1 DBEN l aSo. aSl _ _.J.X~_.J.X~_.LXlo...__.LXlo...__.LlX~ U AMWRor -- AIOWR--------, IL /: MWiiORIOWR ~L~ORI~-------.~_~----- U IL /: DBEN _ _ _ _....J 49-000043A ~ AMWii OR AiOWR - - - - - - - , ~--------' 49-00004SA 5-2 NEe Section @ Interrupts \Q) There are two types of interrlipts in the pP07010S/70116. Figure 6-1. Interrupt Vector Table One is caused by an external interrupt request and the other is caused internally by software. Both types of inter- OOOH Vector 0 Divide error rupts are vectored. When an interrupt occurs, a location 004H Break flag 1 in the interrupt vector table is selected either automat- (Single Step) ically (fixed vector) or by software (variable vector). This OOSH 2 NMI input selected location determines the start address of the OOCH BRK 3 instruction corresponding interrupt routine. 3 (Breakpoint) 010H Table 6-1 shows the types of interrupts, interrupt source, 4 BRKV instruction number of clocks required to process each interrupt, 014H 5 CHKIND instruction vector, and priority. 018H 6 Figure 6-1 shows the interrupt vector table. This table is allocated in a 1 Kbyte memory area (addresses OOOH Reserved to 3FFH) and can hold up to 256 vectors (four bytes required per vector). 07CH 31 The interrupt sources for vectors 0 to 5 are predeter- 080H mined and vectors 6 to 31 are reserved for future use. 32 General Vectors 32 to 255 are for general use. These vectors are • BRK imm 8 instruction used for the four interrupt sou rces: 2-byte break, BRKEM, • BRKEM instruction ~ • INT input (external) CALLN instructions (during emulation), and INT input. Four bytes are used for each interrupt vector. The two ,re·1 2~5 • CALLN instruction bytes of the lower address and the two bytes of the higher 49-000042A address are loaded respectively into the program coun- ter (PC) as an offset, and a segment register (PS) as Example: Vector 0 a base. Location OH OOH Table 6-1. Interrupt Sources 1H 01H Interrupt Source No. of Vector Priority 2H 02H Clocks* 3H 03H External NMI (rising-edge 58/38 2 2 triggered) PS - (003H, 002H) INT (high-level active) 68/49 32-255 3 PC - (001 H, OOOH) Software DIVU divide by 0 error 65/45 The contents of the vectors are initialized at the begin- DIV divide by 0 error 65-751 0 ning of a program. The basic steps when program 45-55 execution jumps to an interrupt routine are: CHKIND boundary 81-841 5 (SP-1, SP-2) - PSW over 53-56 BRKV instruction 60/40 4 (SP-3, SP-4) - PS BRK3 (breakpoint) 3 (SP-5, SP-6) - PC BRK irnm8 58/38 SP - SP-6 BRKEM imm8 32-255 CALLN imm8 IE - O,BRK - O,MO - 1 BRK flag 4 PS - higher vector from interrupt vector table (single step) PC - lower vector from interrupt vector table Note: *The number to the left of the slash (I) is for the pPD70108 and the number to the right is for the pPD70116. The interrupt enable (IE) and break (BRK) flags are reset when an interrupt routine is started. Therefore, maskable interrupts (INT) and single-step interrupts are disabled. pPD70108/70116 NEe MASKABLEINTERRUPTS The interrupt acknowledge cycle consists of two bus cycles. The INTAK, ASTB, and BUFEN signals are gener- If an INT input signal is a high level at the end of an ated during the first cycle. Although the bus cycle is instruction and the interrupt is enabled (IE = 1), the INT started, no read/write operation is performed and the interrupt request will be acknowledged, unless the NMI address/data bus becomes high impedance. During this or hold request signals are active at the same time. The time, a hold request is not accepted. If~e program execution then enters an iriterrupt acknowl- pPD70108170116 is in the maximum mode, the BUS- edge cycle ( figures 6-2 and 6-3). Figure 6-2. pPD70108 Interrupt Acknowledge Timing ClK ASTB RD--4------------+~--------------------, IOiM AD,..-ADo -+---------::~~=:::~:-----~-=:j Read Interrupt Vector ~pe low·Order Addr... Byte low-Order Byte o! Interrupt Vector Table o! Interrupt On.et-Word ,5 A -A. -+------------t+----------------~~~~~~===~ High"()rder Byte of Interrupt Vector Table Address BUSlOCK 49-000040A Figure 6-3. pPD70116 Interrupt Acknowledge Timing ~----------------1-------~----~/ iQ/M BUSLOCK \, ________________ ...J/ (Maximum mode only) - AD,S -ADO ------------------------->-------------_c:::r--c::r-- Low'()rder Interrupt Interrupt Byte Vector 0Haet Read Interrupt Vector ~pe Table Word Address 49-000039A 6-2 ttlEC Section 6 Interrupts LOCK signal is also generated inhibiting other devices During the first pPD7010a interrupt acknowledge bus from using the bus. Figures 6-2 and 6-3 show the timing cycle, no idle TI states are inserted in the bus cycle. for the interrupt acknowledge bus cycles. However, the pPD70116 inserts three TI states during the first interrupt acknowledge cycle. During the second The first interrupt acknowledge cycle is necessary to interrupt acknowledge cycle, five TI states are inserted synchronize the external interrupt controller with the in the bus cycles of both microprocessors. Both the pPD7010a170116. When the INTAK, ASTB, and BUFEN pPD7010a and pPD70116 read an a-bit vector during the signals are output during the second interrupt acknowl- second interrupt acknowledge cycle. edge cycle, the external interrupt controller puts the inter- rupt vector number on the data bus (ADrADo). The number of cycles required to save the contents of After the second interrupt acknowledge cycle has been the PSW, PS, and PC are different for the two microproc- completed, the location in the interrupt vector table cor- essors. This is because the width of the pPD7010a data responding to the vector obtained during the interrupt bus is smaller than that of the pPD70116. Two bus cycles acknowledge cycle is accessed. Before calling the inter- are required forthepPD7010a to read the offset word and rupt routine, the contents of the PSW, PS, and PC are segment word. Two bus cycles per word are also saved in the stack. The interrupt start address is then required to save the PSW, PS, and PC. The pPD70116 loaded into the PS and PC registers from the interrupt performs each of these operations in one bus cycle. The vector table and the interrupt routine is started. pPD70116 UBE signal remains low during the first and second interrupt acknowledge cycles and during the The following are sequential lists of interrupt acknowl- subsequent accessing of the offset and segment words. edge operations performed by the pPD7010a and pPD70116. BRK FLAG (SINGLE.STEP INTERRUPT) pPD70108 ThepPD7010a170116 is provided with a single-step inter- (1) Acknowledge cycle (first) rupt function that is useful for program debugging. The (2) Acknowledge cycle (second) Break Flag (bit a of the PSW) controls this interrupt. There (3) Save lower byte of PSW to stack is no instruction that directly sets or resets the BRK flag; (4) Save higher byte of PSW to stack therefore, the PSW must be saved from the stack to (5) Save lower byte of PS to stack control the BRK flag. By restoring the contents of the (6) Save higher byte of PS to stack PSW from the stack, the BRK flag can be set or reset by (7) Save lower byte of PC to stack using OR and AND instructions on the PSW in the stack. (a) Save higher byte of PC to stack When the BRK flag is set, an interrupt routine specified (9) SP - SP-6 by vector 1 starts after the current instruction has been (10) Read lower byte of offset word to PC executed. The BRK and interrupt enable (IE) flags are (11) Read higher byte of offset word to PC also reset at this point. (12) Read lower byte of segment word to PS The debug program checks the number of single steps (13) Read higher byte of segment word to PS while the interrupt routine is being executed.lfthe single- (14) Jump to interrupt start address step operation can be terminated, a memory operation pPD70116 instruction resets the BRK flag that is saved in the stack. The program then returns to the main routine and the (1) Acknowledge cycle (first) next sequence of instructions is successively carried out. (2) Acknowledge cycle (second) If the program returns to the main routine without chang- (3) Save PSW word to stack ing the BRK flag, the BRK flag (1 in the PSW) will be (4) Save PS word to stack restored from the stack. The program then executes one (5) Save PC word to stack instruction of the main routine and the vector 1 interrupt (6) Sp· - SP-6 occurs again. (7) Read offset word to PC (a) Read segment word to PS (9) Jump to interrupt start address 6-3 pPD70108/70116 NEe INTERRUPT DISABLE TIMING INTERRUPTS DURING BLOCK INSTRUCTIONS NMI and INT interrupts are not acknowledged when If an external interrupt (NMI or INT with interrupts • An instruction that directly sets data in the segment enabled) occurs while a primitive block transfer, compar- register is being executed; for example ison,or 1/0 instruction is being executed, the CPU will MOV sreg, reg16 acknowledge the interrupt and branch to the interrupt MOV sreg, mem16 address. At the beginning of the interrupt routine, the contents of the CW register (a counter for block data) will • The program is between one of the following and the be saved to the stack. After the contents of the CW have next instruction been restored at the end of the interrupt routine, the MOV sreg, reg16 execution of the CPU will be returned to the original MOV reg16, sreg routine. In this manner, the interrupted block operation MOV sreg, mem16 is resumed. MOV mem16, sreg If prefix instructions have existed before the block oper- POP sreg ation instruction, up to three will be retained. • Program execution is between one of the following three types of prefix instructions and the next single When the program returns from the interrupt routine, instruction execution must return to the address at which the prefix instruction is held. For this reason, thepP070108170116 Segment override prefix (PS:, SS:, OSO:, OS1:) modifies the return address (minus one address per Repeat prefix (REPC, REPNC, REP, REPE, REPZ, prefix instruction) when it is saved. REPNE, REPNZ) Bus lock prefix (BUSLOCK) To best use the pP0701 08170116, do not place more than three prefix instructions before a block operation • Program execution is between the EI instruction and instruction. the next instruction (INT only) Correct Example: Only an NMI request signal generated during the above interrupt disable timing will be internally retained. The BUSLOCK request will be acknowledged on completion of the sub- REPC sequent single instruction. NMI - CMPBKB SS: src-block, dst-block In the correct example, the BUSLOCK, REPC, and SS instructions are executed when program execution has been returned from the NMI interrupt process. Incorrect Example: BUSLOCK REP REPC NMI - CMPBK SS: src-block, dst-block In the incorrect example, only the REP, REPC, and SS instructions will be executed when the program returns from the NMI interrupt process. Since more than three prefix instructions were placed before the block oper- ation instruction, program execution incorrectly returns to the REP instruction instead of the BUSLOCK instruction. 6-4 NEe Section 7J Reset Operation U To reset and initialize the pPD70108170116, a positive pulse must be present on the RESET pin for at least four clock periods. A CPU reset signal initializes the pPD70108170116 as follows. • Clears the following registers to OOOOH. PFP (prefetch pointer) PC (program counter) SS (stack segment) DSo (data segment 0) DS1 (data segment 1) • Sets PS (program segment) register to FFFFH • Flushes the instruction queue • Sets or resets the following PSW (program status word ( flags: MD = 1 (native mode) DIR = 0 (address direction used during block transfer, Autoincrements) IE = 0 (INT disabled) BRK = 0 (single-step interrupt disabled) All other registers are undefined. After the reset signal returns to the low level, the CPU begins execution of the program starting at address FFFFOH. 7-1 pPD70108/70116 NEe 7-2 Section (f5) fttIEC Native and pPD8080AF Emulation Modes (Q) The pP070108/70116 has two CPU operating modes: The bus hold function (available by the hold request/ native and 8080 emulation. In native mode, the acknowledge signal) and standby function (available pP070108170116 executes all the instructions given in when the HLT instruction is executed) can be used in Section 12, with the exception of the RETEM and CALLN emulation mode in the same way as in native mode. instructions. In 8080 mode, the microprocessor executes The pP070108170116 operates in terms of its normal the instruction set for the pP08080AF and the RETEM BCU hardware even in emulation mode. Therefore, I/O and CALLN instructions. These modes are selected by operations between the pP0701 08/70116 and peripheral special instructions or by using an interrupt. The most circuits or memory are exactly the same as those significant bit of the PSW is a mode (MO) flag that con- performed in native mode. However, the BUSLOCK and trols mode selection. POLL functions are unavailable for use in emula- tion mode. NATIVE AND 8080 MODE SHIFTING When the operating mode is changed from native to Figure 8.1. Corresponding Registers emulation or vice versa, the registers will be mapped into the emulation mode as shown in figure 8-1. The lower Native Mode 8080 Mode eight bits of the AW register and both the lower and ~~}- ~= higher eight bits of the BW, CW, and OW registers of the H L HL pP070108170116 serve as the accumulator and six general-purpose registers of the pP08080AF. Figure 8-2 B C BC shows the lower eight bits of the PSW of the pP070108/ o E DE 70116 serving as pP08080AF flags. These flags corre- spond to the lower eight bits of the PSw. ~ The SP register serves as the stack pOinter of the pP08080AF in native mode while the BP register acts as BP }-- I SP IX the stack pointer in the emulation mode. In this way, the IV pP070108170116 employs independent stack pointers and stack areas in each mode. Using independent stack pointers prevents destruction of the contents of a stack pointer in one mode due to misoperation of the stack pointer in the other mode. The AH, SP, IX, and IY registers and the four segment registers (PS, SS, OSo, OS1) are not PS OSo SS J- ·Code Segment ·Data Segment OS, addressable from emulation mode. In emulation mode, the segment base of the program is determined by the PS register whose contents have been specified by an interrupt vector before the CPU entered emulation mode. The segment base of the memory oper- ands (including the stack) is determined by the OSo reg- -EBJ- ca~ ·User transparent in 8080 mode Flags 49-000031 A ister whose contents the programmer specifies before the CPU enters emulation mode. Figure 8.2. Corresponding PSW and Flags : 9 8 7 6 5 4 3 2 0 I IE BRK S Iz I 0 I AC 0 I P I 1 CV I PSW 7 6 5 4 3 2 0 I S z I 0 AC 0 I P I 1 C I Flag 49-000030A 8-1 pPD7010S/70116 NEe To determine externally ifthepPD70108170116 is in emu- NATIVE TO 8080 EMULATION MODE lation mode, confirm that the processor status PS3 signal Two instructions cause the operating mode to be output during apPD70108170116 bus cycle has become changed from native the 8080 emulation mode. These high. This signal is always at a low level in native mode. instructions are BRKEM (break for emulation) and RETI Figure 8-3 shows the mode shift operation of the CPU. (return from interrupt). The CPU can reenter emulation mode when INT is pres- ent (even if interrupts are disabled) and restart program BRKEM immS Instruction execution beginning with the instruction after the. HLT instruction. This is true only if the CPU entered the The BRKEM instruction starts the 8080 emulation mode. standby mode from emulation mode. It saves the contents of the PSW, PS, and PC, and resets the MD flag to O. The segment base and offset values are If RESET or NMI is present instead of INT - or if INT is then loaded into the PS and PC registers respectively present while interrupts are enabled - the CPU will enter from the interrupt vector table. The interrupt vector native mode from standby mode. If this happens, the CPU number is specified by the immediate operand of the can reenter emulation mode from native mode; in other BRKEM instruction. words, from the NMI or INT interrupt routine in native mode, through execution of the RETI instruction. If the When the 8080 emulation mode is started by the BRKEM CPU entered standby mode from native mode, the CPU instruction (MD = 0), the CPU executes the program in can reenter native mode by inputting RESET, NMI, or INT the 64 Kbyte segment area specified by the contents of regardless of whether interrupts are disabled or enabled. the PS, starting from the address indicated by the con- Figure 8-3. Mode Shift Operation of CPU HALT--- 49-0001428 8-2 ttlEC Section 8 Native and pPD8080AF Emulation Modes tents of the PC. The instruction code fetched at this pOint Figure 8-5. Shift trom Native to 8080 Mode Using is interpreted as the pPD8080AF instruction and is exe- RETllnstruction cuted (figure 8-4). RETllnstruction The RETI instruction is generally used when returning PC program execution to the main routine from an interrupt Memory Stack AI1I8 PS routine started by an external interrupt or BRK, or CALLN instruction. When the RETI instruction restores the con- IL.. _ _ _ _ l FLAG tents of the PSW, PS, and PC, it also restores the status of the mode (MD) flag before the mode was changed from 8080 to native. This restored MD flag allows the CPU to be returned to the emulation mode again (figure 8-5). For this reason, if the RETI instruction is executed in Native Mode 8080 Emulation Mode Reglater Sat Reglater Sat native mode at the end of the interrupt routine that has been started by the interrupt instruction CALLN, or by an external interrupt while the CPU is in 8080 mode, the CPU can reenter 8080 mode. Native Mode 8080 Mode 8080 EMULATION TO NATIVE MODE 49-000034A The following signals and instructions are used to change the operating mode from 8080 to native. • RESET • NMlorlNT • CALLN (call native) • RETEM (return from emulation) Figure 8-4. S#lift trom Native to 8080 Emulation Mode Using BRKEM Instruction PC Memory PS Stack AI1IB I PSW 1 :1 1 0 - - 'I MD r--' I I I---~ Interrupt r---- Vector Table I PSW FLAG Imm8x4+2 Segment Base PS imm8x4 Offset PC J PC Native Mode 8080 Emulation Mode Regiater Set Register Sat '- . Native Mode 8080 Emulation Mode- 49-000035A 8-3 pPD70108/70116 ttlEC RESET Operation vector to the segment register (PS) and the offset to the program counter (PC) (figure 8-6). When the RESET signal is present, a reset operation is performed on the CPU the same as in native mode. The When the RETI instruction is executed at the end of the 8080 emulation in progress is aborted. interrupt routine, program execution can be returned to the main routine in 8080 emulation mode from the inter- NMI or INT Operation rupt routine in native mode started by the CALLN instruction. When the NMI or INT signal is present, the interrupt process is performed the same as in native mode. Pro- RETEM Instruction gram execution of the CPU will return to the main routine from the interrupt routine in native mode. From native The RETEM instruction is used exclusively as a return mode, the CPU can reenter the 8080 emulation mode by from 8080 mode to native mode when the BRKEM instruc- executing the RETI instruction (figure 8-6). tion caused the shift to the 8080 mode. The RETEM instruction is executed in 8080 emulation mode; program CALLN Instruction execution of the CPU will return from the BRKEM inter- rupt routine to the main routine. Consequently, the con- The CALLN instruction is used exclusively in the emu- tents of the PS, PC, and PSW are restored and the CPU lation mode when calling a native mode subroutine not reenters native mode. At this time, the MD ,flag (MD=1), written in 8080code.lfthe CALLN instruction is executed which was saved to the stack by the BRKEM instruction, in 8080 mode, it causes the CPU to save the contents is restored, causing the CPU to enter native mode of the PS, PC, and PSW, and sets the mode flag to 1. This (figure 8-7). instruction also loads the segment base of an interrupt Figure 8-6. Shift From 8080 to Native Mode Using NMI, INT, or CALLN Instruction PC Memory Stack Area PS : L.. _ _ _ _ _ I FLAG 1----:----IH Interrupt Vector Table Sagment Base Offset I NatIve Mode 8080 Emulation Mode Register Set Register Set NatIve Mode Emulation Mode 49-000033A 8-4 NEe Section 8 Native and pPD8080AF Emulation Modes Figure 8-7. Shift from 8080 to Native Mode Using RETEM Instruction PC PS Memory stack area PSW Native mode 8080 Emulation mode register set register set . Native mode Emulation mode - 49-000032A EMULATION NESTING In a native mode called by CALLN or an NMI or INT interrupt from emulation mode, emulation mode can- not be called again by a BRKEM instruction. If this nesting is attempted, MD won't work normally, and normal operation cannot be expected. 8-5 pPD70108/70116 NEe 8-6 t\'EC Section {Q\ Standby Mode @ ThepPD70108/70116 can operate in a standby mode. In EXITING STANDBY MODE BY standby mode, program execution can be terminated EXTERNAL INTERRUPTS and resumed as required while retaining all internal state information. The clock is not supplied to any circuitry The pPD70108/70116 will exit standby mode when NMI except those required by the hold and standby functions. or INT is asserted. When the standby mode is released As a result, power consumption in the standby mode can by an INT signal, the operation the CPU next performs be reduced to approximately one-tenth of that required depends upon the state of the IE flag when the HALT for the native or emulation mode. All CPU registers pres- instruction is executed. ent before standby mode are retained. Releasing Standby Mode with NMI ENTERING STANDBY MODE Whether the CPU enters standby mode from the native Standby mode is entered whenever the HALT instruction or emulation mode, the standby mode is unconditionally is executed in native or 8080 mode. released when the NMI interrupt is present. If the RETI instruction is executed at the end of the NMI servicing STATUS SIGNALS IN STANDBY MODE routine, the CPU will reenter the mode that existed before the CPU entered the standby mode. The program is then Although the bus hold function can be used in the resumed starting from the instruction which immediately standby mode, the CPU reenters the standby mode when follows the HALT/HLT instruction that caused the the hold acknowledge cycle is completed. standby mode. Table 9-1 shows the status of each output signal in st~ndby mode. Releasing Standby Mode with INT Table 9-1. Signal Status in Standby Mode When Interrupts are Disabled (01). On exiting standby mode, the CPU enters the mode that was set before output Signal Status standby mode. For example, if standby mode was set Large-scale aS1, aSO Fixed at low level while the CPU was in native mode, the CPU returns to system mode native mode when it exits standby mode. If the CPU was BS2-BSO Fixed at high level in emulation mode when standby mode was set, it returns BUS LOCK Fixed at high level (fixed at to the 8080 mode. Program execution will be resumed low level if BUSLOCK starting from the instruction immediately following the instruction was decoded HALT or HLT instruction. before HALT instruction) Note: When exiting the stanby mode by INT (interrupts disabled), INT Small-scale INTAK Fixed at high level must be kept at a high level, until the instruction immediately system mode BUFEN following the HALT/HLT instruction is executed. Therefore, INT WR must remain at a high level for at least 15 clocks. This assumes RD the instruction queue is empty after executing the HALT/HLT ASTB Fixed at low level instruction. If wait states are inserted, the number of inserted wait states must be added to the 15 clocks. BUFR/W Fixed at either high or .!Q/M (pPD70108) low level When Interrupts are Enabled (EI). Standby mode is 101M (pPD70116) exited when the interrupt routine in native mode is LBSO (pPD70108) started, regardless of whether the CPU was in native or Large- and UBE (pPD70116) Fixed at high level emulation mode before standby mode was set. If a RETI small-scale A19/PS3-A16/PSO Fixed at either high or system modes A15-A8 (pPD70108) low level instruction is executed at the end of the interrupt routine, the CPU will return to the mode that was present just AD7-ADO (pPD70108) AD15-ADO (pPD70116) before standby mode was entered. Program execution will start at the instruction immediately following the HALT/HLT instruction. The control outputs are maintained at inactive levels during the standby mode. The presence of a RESET EXITING STANDBY MODE BY RESET Signal, an external interrupt (NMI or INT), or a bus request Standby mode is unconditionally exited when RESET from an external bus master will cause the pPD701081 becomes active regardless of whether the standby mode 70116 to exit the standby mode. was set while the CPU was in native or emulation mode. On exiting the standby mode, a normal CPU reset oper- ation is performed in the native mode. 9-1 pPD7010S/70116 NEe 9-2 ttiEC Section ~ Logical and Physical Addresses U\gJ '0' The pPD70108/70116 has a 20-bit address bus (the Unless a specific program is executing an instruction lower 8/16 bits are also used as a data bus) and can that modifies a segment base - for example, a branch access up to 1 Mbyte of memory area. The processor instruction or a variable reference in another segment employs a memory segment architecture that allows the - the addresses in the program can be determined by 1 Mbyte memory area to be treated as logical addresses. the offset from the contents of a segment register. The The logical addresses are not necessarily the same program can be loaded to any memory area simply by number as the physical addresses where data is stored. loading the contents Of the segment reigster with the first physical address of the memory area to which the pro- PHYSICAL ADDRESS GENERATION gram is to be loaded. To obtain a physical address, the contents of a segment By using segmentation, a program stored in an external register are multiplied by 16 and an offset value known file such as a floppy disk can be loaded to any available as the "effective address" is then added to the segment buffer memory. It will run when the program is called by register. The result is used as a physical address. The the program currently being executed by the CPU. In this contents of the segment register and the offset value are manner, a program stored in a file or separated into many treated as unsigned data. Also, since the segment reg- files can be loaded to an available memory area. This ister value is multiplied by 16, the segment register may is called "dynamically relocatable code." only access physical memory locations which are on a 16 byte boundary; for example, locations OOH, 10H 20H, MEMORY SEGMENTS and so on. Four types of segments are used: Program, Stack, Data Figure 10-1 shows the relation between a segment reg- 0, and Data 1. The physical address in memory of a ister, offset, and physical address. segment location is calculated by shifting the value in the segment register to the left four places. An offset value Using the memory segment method of addressing, you ("effective address") is then added to the shifted segment can write programs and only be concerned with the register value; this sum is the phYSical address. contents of the segment registers and the offset value of the contents. The contents of the segment registers may The logical segment is specified by one of the four 16-bit be a default or specified as an override. If the contents registers: PS, SS, DSO, DS1. Each 16-bit register corre- of a segment register constitute address 0, the offsets of sponds to one of four logical segments as follows: the addresses in the segment specified by that segment Segment Register Default Offset register can be treated as logical addresses. PS PFP A program written as a aggregate of segments specified SS SP, Effective Address by logical addresses is compiled, assembled, and treated DSO IX, Effective Address as object modules. Each object module has its own seg- DS1 IY, Effective Address ment name, size, partition, and control information. These object modules are tied together by the linker and The function of each segment register is described the segment bases corresponding to physical addresses below. are specified. The object modules can then be loaded into memory. Figure 10-1. Physical Addressing . .191._ _ _ _ _ _1_6-_Bit_Seg_me_nl_R_eg_lst_er_ _ _ _ _4 . .31._ _0_----'°1 Segment Regislerx16 + [5 16-_B_iIOff_set_ _ _ _ _ _ ...._ _ _ _ _ _ _ ---'1 EffecliveAddress 2O-Bit Physical Address 49-000038A 10-1 pPD70108/70116 fttIEC Program Segment Data Segment 0 The first address of the program segment is determined The first address of data segment 0 is determined by the by the program segment (PS) register. The offset from the contents of data segment 0 (OSO) register. The offset from first address is specified by the prefetch pointer (PFP). the first address is specified by an effective address. This segment is primarily used for instruction codes. When executing a block transfer or BCD string operation Data in this segment can be accessed as general var- instruction, this segment is used to store the source block iables or source block data by using the segment over- data. However, the offset is determined then by the con- ride prefix (PS:) instruction. tents of the IX register. When the BP is specified as base register, the default Stack Segment segment register is SS. In this case, you can override with The first address of the stack segment is determined by the segment override prefix (OSO:), and the data in data the stack segment (SS) register. The offset from the first segment 0 can be addressed with OSO + BP. address is specified by the stack pOinter (SP). This seg- ment is used as an area that saves the contents of the Data Segment 1 PC (return address), PSw, and general purpose registers. The first address of data segment 1 is determined by the The data in the stack segment can be accessed by using data segment 1 register (OS1). The offset from the first the segment override prefix.(SS:) instruction. address is specified by the IV register. This segment is When addressing the stack, the SS register automatically used to store the destination block data when executing becomes the segment register if the BP register is spec- a block transfer or BCD string operation instruction. The ified as the base register. The offset is specified by the data in this segment can be accessed as general var- effective address. iables (offset determined by an effective address). The data can also be accessed as source block data (offse~ determined by the contents of the IX register,). 10-2 NEe Section cfI cfI Addressing Modes U U INSTRUCTION ADDRESS Register Addressing The current address of the J.IPD70108170116 program In register addressing, the contents of any 16-bit register counter (PC) is automatically incremented to the starting specified by the 3-bit register field in the instruction are location of the next instruction every time the current loaded to the PC as a branch address. This addressing instruction is about to be executed. In addition, the method allows the use of all eight 16-bit registers (AW, microprocessor employs the following instruction ad- BW, CW, DW, IX, IY, SP, and BP). Register addressing is dressing modes: used when executing the following instructions: CALL regptr16 • Direct • Relative BR regptr16 • Register Example: • Register Indirect CALL AW • Indexed BR BW • Based • Based Index Register Indirect Addressing Direct Addressing In register indirect addressing, a 16-bit register (IX, IY, or BW) is specified by the register field in an instruction. The In direct addressing, two bytes of immediate instruction specified register then addresses memory. data are directly loaded to the PC or, two bytes are loaded into the PS and two other bytes are loaded into the PC. The addressed contents are then loaded to the PC (or The immediate data is then used by the PS and PC as to both the PC and PS) as a branch address. a branch address. Direct addressing is used when CALL memptr16 executing the following instructions: CALL memptr32 CALL far-proc BR memptr16 CALL memptr16 BR memptr32 CALL memptr32 Example: BR far-label CALL WORD PTR [IX] BR memptr16 CALL DWORD PTR [IY] BR memptr32 BR WORD PTR [BW] BR DWORD PTR [IX] Relative Addressing Note: Instruction code memptr16 and memptr32 are generated by the In relative addressing, 1 or 2 bytes of immediate instruc- assembler in response to keywords WORD PTR, and DWORD tion data are treated as a signed displacement value and PTR, respectively. added to the contents ofthe PC. The result ofthis addition is the effective address and is used as a branch address. Indexed Addressing The sign bit of an 8-bit displacement value is extended In indexed addressing, 1 or 2 bytes of immediate data and added to the contents of the PC as a 16-bit value. in an instruction are treated as a signed displacement When addition is performed, the contents of the PC value and are added to the contents of a 16-bit register indicate the first address of the next instruction. that serves as an index register (IX or IY). Relative addressing is used when executing the follow- The result of this addition addresses memory and is ing instructions: loaded to the PC as a branch address. CALL near-proc CALL memptr16 BR near-label CALL memptr32 BR short-label BR memptr16 Conditional branch instruction short-label BR memptr32 11-1 pPD70108/70116 ttlEC Example: MEMOAYOPEAANDADDAESS CAll var [IX] [2] Several addressing modes and registers are used for CAll var [IV] particular instruction formats. The memory operand BR var [IV] addressing modes are listed below and discussed in the BR var [IX + 4] following sections. Based Addressing • Register In based addressing, 1 or 2 bytes of immediate data in • Immediate an instruction are treated as a signed displacement value • Direct and are added to the contents of a 16-bit register (BP • Register Indirect or BW) that serves as a base register. The contents of • Autoincrement/Oecrement the memory addressed by the result of this addition are • Indexed loaded to the PC as an effective address. • Based • Based Indexed Based addressing is used when executing the following • Bit instructions: Register Addressing CAll memptr16 CAll memptr32 In register addressing, the contents of the register field BR memptr16 (reg = 3-bit field, sreg = 2-bit field) in an instruction, BR memptr32 addresses a register. See figure 11-1. Example: CAll var [BP + 2] Figure 11-1. Bit Format CAll var [BP] BR var [BW] [2] BR var [BP] 49-000655A Note: Instruction code memptr16 is generated by the assembler if variable var has a word attribute. If it has a double word attribute, instruction code memptr32 is generated. The 3-bit field "reg" is used with bit W of the same instruction and indicates whether a word or a byte reg- Based Indexed Addressing ister is to be specified. Eight types of word registers (AW, In based indexed addressing, 1 or 2 bytes of immediate BW, CW, OW, BP, SP, IX, IV) and eight types of byte reg- data in an instruction are treated as a signed displace- isters (Al, AH, Bl, BH, Cl, CH, Ol, OH) are specified. ment value. This value is added to the contents of a 16-bit The 2-bit field "sreg" specifies four types of segment register that serves as a base register (BP or BW) and registers (PS, SS, OSo, and OS1). Sometimes the oper- to the contents of a 16-bit register that serves as an index ation code of an instruction specifies a register. Register register (IX or IV). The result of this addition is the effective addressing is employed when executing instructions address. The addressed memory contents are loaded to that have the following operand formats: the PC as a branch address. Based indexed addressing is used when executing the following instructions: Format Item reg AW, BW, CW, OW, SP, BP, IX, IV, Al AH, CAll memptr16 Bl,BH,Cl,CH,Ol,OH CAll memptr32 reg16 AW, BW, CW, OW, SP, BP, IX, IV BR memptr16 reg8 Al, AH, Bl, BH, Cl, CH, Ol, OH BR memptr32 sreg PS, SS, OSo, OS1 Example: acc AW, Al CAll var [BP] [IX] Example: CAll var + [BW 2] [IVI When MOV reg, reg is specified: BR var [BW] [2] [IX] MOV BP,SP BR var [BP + 4] [IV] MOV Al,Cl Note: Instruction code memptr16 is generated by the assembler if variable var has a word attribute. If it has a double word attribute, instruction code memJ'tr32 is generated. 11-2 NEe Section 11 Addressing Modes Immediate Addressing Example: When SUB mem,reg is specified: In immediate addressing, one or two bytes of immediate SUB [IX],AW data in an instruction are used. Immediate addressing is used when executing instruc- Autoincrementl Decrement Addressing tions that have the following operand formats: Autoincrementl decrement addressing falls into the cate- Format Item gory of register indirect addressing. imm 8/16-bit immediate data The contents of a default register addresses a register imm16 16-bit immediate data or memory. Then - if a byte operation is performed - imm8 8-bit immediate data the contents of the default register are automatically pop-value 16-bit immediate data incremented/ decremented by one. If a word operation If imm is specified alone, the assembler checks the value is used, the register contents are incremented/decre- of imm written as an operand or the attribute of other mented by two. The address is automatically modified by operands that may be written at the same time. The this addressing function. This addressing method is assembler then judges whether the value of imm is 8 or always applicable to default registers and is used when 16 bits. The status of the word/byte specifying bit W is executing the instructions that have the following oper- then determined. and formats: Example: Format Default Register When MOV reg,imm is specified: dst-block IY MOV AL, 5 ;Byte - specified by AL. src-block IX When MUL reg16, reg16, imm16 is specified: This addressing will control block data instructions when MUL AW,BW,1000H ;word - specified by it is used in combination with counter CW that counts ;AWand BW. the number of repetitions of the operation. Direct Addressing Indexed Addressing In direct addressing, the immediate data in an instruction In indexed addressing, one or two bytes of immediate addresses memory. data in an instruction are treated as a signed displace- Direct addressing is used when executing the instruc- ment value and are added to the contents of a 16-bit tions that have the following operand formats: register that serves as an index register (IX or IY). The result of this addition forms the effective address used Format Item to address a memory operand. Indexed addressing is mem 16-bit variable specifying 8 or 16-bit useful when accessing an array of data. The displace- memory data ment value indicates the starting address of the array. dmem 16-bit variable specifying 8 or 16-bit The contents of the index register determine the address memory data of the data to be accessed. imm4 4-bit variable specifying bit length of the bit field data This addressing method is employed when executing the instructions that have the following operand formats: Example: When MOV mem,imm is specified: Format Method MOV WORDVAR, 2000H mem var [IX], var [IY] When MOV acc,dmem is specified: mem16 var [IX] MOV AL, BYTEVAR mem8 var [IX] Example: Register Indirect Addressing When TEST mem,imm is specified: In register indirect addressing, a 16-bit register (IX, IY, or TEST BYTEVAR[IX], 7FH BW) is determined by the register field in an instruction. TEST BYTEVAR[IX+8],7FH The specified register then addresses memory. TEST WORDVAR[IX] [8], 7FFFH Register indirect addressing is used when executing the Note: If variable var has a byte attribute, a byte operand is speci- instructions that have the following operand formats: fied. If it has a word attribute, a word operand is specified. The assembler generates an instruction code to each Format Method operand. mem [IX], [IY], [BW] 11-3 pPD70108/70116 NEe Based Addressing Format Item In based addressing, one or two bytes of immediate data mem var [base register] [index register] in an instruction are treated as a signed displacement mem16 var [base register] [index register] value and are added to the contents of a 16-bit base mem8 var [base register] [index register] register that serves as a base register (BP or BW). The Example: result of this addition forms the effective address used When PUSH mem16 is specified: to address a memory operand. PUSH WORD-VAR [BP] [IX] Based addressing is useful to access structural data that PUSH WORD-VAR [BP+2] [IX+6] is stored at separate memory locations. The base register PUSH WORD-VAR [BP] [4] [IX] [8] indicates the starting address of each structural data and the displacement value selects one piece of data from Bit Addressing each structural data. In bit addressing, three or four bits of immediate data in This addressing method is employed when executing the an instruction, or the lower three or four bits of the CL instructions that have the following operand formats: register, specify one bit of an 8 or 16-bit register or memory location. Format Method With bit addressing, a specific single bit in a register or mem var[BP],var[BW] memory can be tested for 0 or 1, set, cleared, or inverted mem16 var[BP] without affecting the other bits. When using the AND or mem8 var[BP] OR instruction to set or reset a bit, a byte or word mask Example: has to be prepared to change one bit. Bit addressing is When SHL mem,1 is specified: used when executing the instructions that have the SHL BVTEVAR[BP],1 following operand formats: SHL WORDVAR[BP+2],1 Item Format SHL BVTEVAR[BP] [4],1 imm4 Bit number of word operand Note: If variable var has a byte attribute, a byte operand is specified. imm3 Bit number of byte operand If it has a word attribute, a word operand is specified. The CL CL assembler generates an instruction code corresponding to each operand. Example: TEST1 reg8,CL Based Indexed Addressing TEST1 AL,CL One or two bytes of immediate data in an instruction are NOT1 reg8,imm3 treated as a signed displacement value that is added to NOT1 CL,S the contents of two 16-bit registers. One of the registers CLR1 mem16,CL is a base register (BP or BW) and the other is an index CLR1 WORDVAR[IX],CL register (IX or IV). The result of the addition forms the SET1 mem16,imm4 SET1 WORDVAR[BP],9 effective address that is used to address a memory operand. Since based indexed addressing allows accessing data by modifying the contents of both the base and index registers, it is useful when accesing arrays of structural data. For example, the contents of the base register indicate the first address of each structural data. The displace- ment value in turn indicates the offset from that first address to the first address of a data array. The index register indicates a specific data in the data array. Based indexed addressing is used when executing instructions that have the following operand formats: 11-4 NEe Section cfl u)) Instruction Set U~ The following sections include instruction formats, Table 12-1. Operand Types descriptions, and examples for the pPD7010S170116 Identifier Description instruction set. For an alphabetical listing by instruction mnemonic, see Appendix A. reg 8- or 16-bit general-purpose register reg8 8-bit general-purpose register The number of clocks assumes the instruction byte(s) have been prefetched and includes the following times: reg16 16-bit general-purpose register mem 8- or 16-bit memory location • Decoding • EA generation mem8 8-bit memory location • Operand fetch mem16 16-bit memory location • Execution mem32 32-bit memory location The following is a description of the contents of tables dmem 16-bit direct memory address 12-1 through 12-7. imm 8- or 16-bit immediate data Table Contents imm3 3-bit immediate data 12-1 Identifier and description for the different imm4 4-bit immediate data types of pPD7010S170116 operands imm8 8-bit immediate data 12-2 Identifiers and descriptions for pPD7010S/ imm16 16-bit immediate data 70116 instruction words acc AW or AL accumulator 12-3 Identifier and description of the operations sreg Segment register for the pPD7010S170116 instruction set src-table Name of 256-byte translation table 12-4 Identifier and description for the different src-block Name of source block addressed by IX register status flags dst-block Name of destination block addressed by IV register 12-5 Information about memory addressing, to near-proc Procedure within the current program segment selection of S- and 16-bit registers, 12-7 and selection of segment registers. far-proc Procedure located in another program segment near-label Label in current program segment short-label Label within range of -128 or +127 bytes from end of instruction far-label Label in another program segment regptr16 16-bit general-purpose register containing an offset within the current program segment memptr16 16-bit memory address containing an offset within the current program segment memptr32 32-bit memory address containing the offset and segment data of another program segment pop-value Number of bytes of the stack to be discarded (O-64K, usually even addresses) fp-op Immediate value to identify instruction code of the external floating point processer chip R Register set (AW, BW, CW, DW, SP, BP, IX, IV) DS1-spec (1) DS1 (2) Segment of group name assumed to DS1 Seg-spec (1) Any name or segment register (2) Segment or group name assumed to segment register [] Optional, may be omitted 12-1 pPD7010S/70116 tt{EC Table 12-2. Instruction Words Table 12-3. Operation Description Identifier DescriptiDn Identifier Description W Word/Byte specification bit (1 = word, AW Accumulator (16 bits) 0= byte) AH Accumulator (high byte) reg 8/16-bit general register specification bit (000-111 ) AL Accumulator (low byte) BW BW register (16 bits) mod,mem Memory addressing specification bits (mod = 00-10, mem = 000-111) CW CW register (16 bits) (disp-Iow) Optional 16-bit displacement lower byte CL CL register (low byte) (disp-high) Optional 16-bit displacement higher byte OW OW register (16 bits) disp-Iow 16-bit displacement lower byte for PC relative SP Stack pointer (16 bits) addition PC Program counter (16 bits) disp-high 16-bit displacement higher byte for PC PSW Program status word (16 bits) relative addition imm3 Hit immediate data IX Index register (source) (16 bits) PS Program segment register (16 bits) imm4 4-bit immediate data imm8 8-bit immediate data DS1 Data segmen~ 1 register (16 bits) imm16-low DSO Data segment 0 register (16 bits) 16-bit immediate data lower byte imm16-high 16-bit immediate data higher byte SS Stack segment register (16 bits) addr-Iow 16-bit direct address lower byte AC Auxiliary carry flag addr-high 16-bit direct address higher byte CY Carry flag P Parity flag sreg Segment register specification bit Sign-extension specification bit (1 = sign S Sign flag s extension, 0 = no sign extension) Z Zero flag offset-low Low byte of 16-bit offset data loaded to PC DIR Direction flag offset-high High byte of 16-bit offset data loaded to PC IE Interrupt enable flag seg-Iow Low byte of 16-bit segment data loaded V Overflow flag to PS BRK Break flag pop-value-low Low byte of 16-bit data which specifies number of bytes of stack to be discarded MD Mode flag pop-value-high ( ... ) Values in parentheses are memo~ contents High byte of 16-bit data which specifies number of bytes of stack to be discarded disp Displacement (8 or 16 bits) disp8 8-bit displacement added to PC temp Temporary register (8, 16, or 32 bits) X Operation codes for extemal floating point seg Immediate segment data (16 bits) XXX processor chip offset Immediate offset data (16 bits) YYY ZZZ - + Transfer direction Addition Subtraction X Multiplication Division % Modulo AND Logical and OR Logical or XOR Exclusive or XXH 2-digit Hexadecimal data XXXXH 4-digit Hexadecimal data 12-2 NEe Section 12 Instruction Set Table 12-4. Flag Operations Table 12-6. Selection of 8- and 16-8it Regls_ters Identifier Description reg w=o W=1 (blank) No change 000 AL AW o Cleared to 0 001 CL CW Set to 1 010 DL DW x Set or cleared according to the result 011 BL BW U Undefined 100 AH SP R Value saved earlier is restored 101 CH BP 110 DH IX Table 12-5. Memory Addressing 111 BH IV mod mem 00 01 10 Table 12-7. Selection of Segment Registers 000 BW+IX BW + IX + disp8 BW + IX + disp16 sreg 001 BW+ IV BW + IV + disp8 BW + IV + disp16 00 DS1 010 BP + IX BP + IX + disp8 BP + IX + disp16 01 PS 011 BP+ IV BP + IV + disp8 BP + IV + disp16 10 SS 100 IX IX + disp8 IX + disp16 11 DSO 101 IV IV + disp8 IV + disp16 110 Direct Address BP + disp8 BP + disp16 111 BW BW + disp8 BW + disp16 12-3 pPD7010S/70116 tt{EC DATA TRANSFER MOV mem,reg MOVreg,reg Move register to memory Move register to register 7 o 7 o 1 o o o 1 o o W 1 0 0 0 1 o 1 W I I I mod reg mem 1 1 reg reg I I (disp-Iow) reg - reg I I (disp-high) Transfers the c::ontents of the 8- or 16-bit register spec- ified by the second operand to the 8- or 16-bit register specified by the first operand. (mem) - reg Bytes: 2 Transfers the contents of the 8- or 16-bit register spec- ified by the second operand to the 8- or 16-bit memory Clocks: 2 location specified by the first operand. Transfers: None Bytes: 2/3/4 Flag operation: None Clocks: Example: When W=O: 9 MOV BP,SP When W= 1: 13, pPD70108 MOV AL,CH 13, pPD70116 odd addresses 9, pPD70116 even addresses Transfers: 1 Flag operation: None Example: MOV [BP][IX],AW MOV BYTE-VAR,BL 12-4 t-IEC Section 12 Instruction Set MOV reg,mem MOVmem,imm Memory to register Immediate data to memory 7 o 7 o 1 o o o 1 o 1 W 1 1 o o o 1 1 W I I I I I mod reg mem mod o o o mem I I I I (disp-Iow) (disp-Iow) I I I I (disp-high) (disp-high) reg - (mem) I I I imm8- or imm16-low Transfers the 8- or 16-bit memory contents specified by the second operand to the 8- or 16-bit register specified . I . I Imm16-hlgh by the first operand. Bytes: 2/3/4 (mem) - imm Clocks: Transfers the 8- or 16-bit immediate data specified by the When W= 0: 11 second operand to the 8- or 16-bit memory location When W = 1: 15, pPD70108 addressed by the first operand. 15, pPD70116 odd addresses 11, pPD70116 even addresses Bytes: 3/4/5/6 Transfers: 1 Clocks: When W= 0: 11 Flag operation: None When W = 1: 15, pPD70108 Example: 15, pPD70116 odd addresses MOV AW,[BW][IY] 11, pPD70116 even addresses MOV CL,BYTE_VAR Transfers: 1 Flag operation: None Example: MOV BYTE PTR [BP][IX],O MOV WORD PTR [BW],12 MOV [BP][IX],5 ;Note: assembler assumes ;WORD PTR as default. MOV BYTE_VAR,123 MOV WORD_VAR,1000H 12-5 JlPD70108/70116 NEe MOVreg,imm MOV acc,dmem Immediate data to register Memory to accumulator 7 3 2 o 7 o 1 o 1 1 W reg 1 o 1 o o o o W I I I I imm8- or imm16-low addr-Iow I I I I imm16-high addr-high reg - imm When W = 0 AL - (dmem) Transfers the 8- or 16-bit immediate data specified by the When W = 1 AH - (dmem + 1), AL - (dmem) second operand to the 8- or 16-bit register specified by Transfers the memory contents addressed by the second the first operand. operand to the accumulator (AL or AW) specified by the first operand. Bytes: 2/3 Bytes: 3 Clocks: 4 Clocks: Transfers: None WhenW=O: 10 Flag operation: None When W = 1: 14: pPD70108 pPD70116 odd addresses Example: MOV BP,8000H 10: pPD70116 even addresses Transfers: 1 Flag operation: None Example: MOV AW,WORD_VAR MOV AL,BYTE-VAR t-{EC Section 12 Instruction Set MOV dmem,acc MOV sreg,reg16 Accumulator to memory Register to segment register 7 o 7 o 1 o 1 o o o 1 W 1 o o o 1 1 o I I addr-Iow 1 o sreg reg I I addr-high sreg +- reg16 sreg: SS,DSo,DS1 Transfers the contents of the 16-bit register specified by When W = 0, (dmem) +- AL the second operand to the segment register (except PS) When W = 1, (dmem + 1) +- AH, (dmem) +- AL specified by the first operand. External interrupts (NMI, INT) or a single-step break is not accepted between this Transfers the contents of the accumulator (AL or AW) instruction and the next. specified by the second operand to the 8- or 16-bit mem- ory location addressed by the first operand. Bytes: 2 Bytes: 3 Clocks: 2 Clocks: Transfers: None WhenW=O: 9 Flag operation: None When W = 1: 13, pPD70108 13, pPD70116 odd addresses Example: MOV SS,AW 9, pPD70116 even addresses Transfers: 1 Flag operation: None Example: MOV WORD_VAR,AW MOV BYTE_VAR,AL 12-7 pPD7010S/70116 t\'EC MOV sreg,mem16 MOV reg16,sreg Memory to segment register Segment register to register 7 o 7 o 1 o o o 1 1 1 o 1 o o o 1 1 o o I I I I mod o sreg mem 1 1 o sreg reg I I (disp-Iow) reg 16 - sreg Transfers the contents of the segment register specified I I (disp-high) by the second operand to the 16-bit register specified by the first operand. sreg - (mem16) sreg: SS,DSo,DS1 Bytes: 2 Transfers the 16-bit memory contents addressed by the Clocks: 2 second operand to the segment register (except PS) specified by the first operand. However, external inter- Transfers: None rupts (NMI, INT) or a single-step break is not accepted Flag operation: None during the period between this instruction and the next. Example: MOV AW,DS1 Bytes: 2/3/4 Clocks: When W= 0: 11 When W = 1: 15, pPD70108 15, pPD70116 odd addresses 11, pPD70116 even addresses Transfers: 1 Flag operation: None Example: MOV DSO,[BW][IX] MOV SS,WORD_VAR 12-8 ftt{EC Section 12 Instruction Set MOY mem16,sreg MOY DSO,reg16,mem32 Segment register to memory 32-bit memory to 16-bit register and DSO 7 0 7 o 1 0 0 0 1 1 0 0 1 1 0 0 0 1 0 1 I I I I I I I I mod 0 sreg mem mod reg mem . I I . I I (dlsp-Iow) (dlsp-Iow) I I I I I (disp-high) (disp-high) (mem16) - sreg reg 16 - (mem32) Transfers the contents of the segment register specified DSo - (mem32 2) + by the second operand to the 16-bit memory location Transfers the lower 16 bits (offset word of a 32-bit pointer addressed by the first operand. variable) addressed by the third operand to the 16-bit register specified by the second operand, and the higher Bytes: 2/3/4 16 bits (segment word) to the DSo segment register. Clocks: Bytes: 2/3/4 WhenW=O: 10 WhenW= 1: 14, pPD70108 Clocks: 14, pPD70116 odd addresses 26, pPD70108 10, pPD70116 even addresses 26, pPD70116 odd addresses Transfers: 1 18, pPD70116 even addresses Flag operation: None Transfers: 2 Example: Flag operation: None MOV [I~],PS Example: MOV DSO,BW,DWORD_VAR 12-9 pPD70108/70116 NEe MOV DS1,reg16,mem32 MOVAH,PSW 32-bit memory to 16-bit register and DS1 PSWtoAH 7 o 7 o 1 1 0 0 0 1 0 o I 1 I 0 o 1 1 1 1 1 I I I mod reg mem AH - S,Z,X,AC,X,P,X,CY Transfers flags S, Z, AC, P, and CY of PSW to the AH . I I (dlsp-Iow) register. Bits 5, 3, and 1 are undefined. Bytes: 1 I I (disp-high) Clocks: 2 reg16 - (mem32) Transfers: None DS1 - (mem32 + 2) Flag operation: None Transfers the lower 16 bits (offset word of a 32-bit pointer Example: MOV AH,PSW variable) addressed by the third operand to the 16-bit register specified by the second operand, and the higher 16 bits (segment word) to the DS1 segment register. Bytes: 2/3/4 Clocks: 26, pPD70108 26, pPD70116 odd addresses 18, pPD70116 even addresses Transfers: 2 Flag operation: None Example: MOV DS1,IY,DWORD_VAR 12-10 NEe Section 12 Instruction Set MOV PSW,AH LDEA reg16, mem16 AH to PSW Load effective address to register <; 7 o 7 o I1 I 0 o 1 1 1 1 o 1 o o o 1 1 o 1 I I I S,Z,X,AC,X,P,X,CY - AH mod reg mem Transfers bits 7, 6, 4, 2, 0 of the AH register to flags S, I I Z, AC, P, and CY of PSw. (disp-Iow) Bytes: 1 I I Clocks: 3 (disp-high) Transfers: None reg16 - mem16 Flag operation: Loads the effective address (offset) generated by the second operand to the 16-bit general-purpose register P CY specified by the first operand. Used to set starting x x address values to the registers that automatically specify the operand for TRANS or block instructions. Example: MOV PSW,AH Bytes: 2/3/4 Clocks: 4 Transfers: None Flag operation: None Example: LDEA BW,TABLE[IX] 12-11 JlPD7010S/70116 t-{EC TRANS no operand XCH reg,reg TRANS sre-table Exchange register with register TRANSB no operand Translate byte 7 o 7 o 1 o o 0 o 1 1 W I 1 I 1 o 1 o 1 1 1 1 1 reg reg AL - (BW +AL) reg ... reg Transfers to the AL register one byte specified by the BW ~.xchanges t~e contents of the 8- or 16-bit register spec- and AL registers from the 256-byte conversion table. This Ified by the first operand with the contents of the 8- or time, the BW register specifies the starting (base) 16-bit register specified by the second operand. address of the table, while the AL register specifies the offset value within 256 bytes of the starting address. Bytes: 2 Bytes: 1 Clocks: 3 Clocks: 9 Transfers: None Transfers: 1 Flag operation: None Flag operation: None Example: Example: XCH CW,BW XCH AH,AL TRANS TABLE TRANS TRANSB 12-12 NEe Section 12 Instruction Set XCH mem,reg XCH AW,reg16 XCH reg,mem XCH reg16,AW Exchange memory with register Exchange accumulator with register 7 o 7 o I 1 o o o o 1 1 W 1 o reg I I AW .... reg16 mod reg mem Exchanges the contents of the accumulator (AW only) I I (disp-Iow) specified by the first operand with the contents of the 16-bit register specified by the second operand. I I (disp-high) Bytes: 1 Clocks: 3 (mem) .... reg Transfers: None Exchanges the 8- or 16-bit memory contents addressed by the first operand with the contents of the 8- or 16-bit Flag operation: None register specified by the second operand. Example: Bytes: 2/3/4 XCHAW,DW XCH CW,AW Clocks: When W=O: 16 When W=1: 24, pPD70108 24, pPD70116 odd addresses 16,pPD70116 even addresses Transfers: 2 Flag operation: None Example: XCH WORD_VAR,CW XCH AL,TABLE[BW] 12-13 pPD70108/70116 t\'EC REPEAT PREFIXES REPNC (no operand) REPC (no operand) Repeat while no carry Repeat while carry 7 o 7 o I 0 I 1 1 o o 1 o o I 0 I 1 1 o o 1 o 1 While CW =F 0, the block comparison instruction (CMPBK or CMPM) placed in the following byte is exe- While CW =F 0, the block comparison instruction cuted and CW is decremented (-1). If the result of the (CMPBK or CMPM) placed in the following byte is exe- comparison instruction is CY = 1, the instruction termi- cuted and CW is decremented (-1). If the result of the nates. CW is checked against the condition immediately block comparison instruction is CY =F 1, the instruction before the execution ofthe block comparison instruction. terminates. CW is checked against the condition imme- Therefore, if CW = 0 the first time the REPNC instruction diately before the execution of the block comparison is executed, the program will proceed immediately to the instruction. Therefore, if CW = 0 the first time the REPC instruction following the block comparison instruction instruction is executed, the program will proceed imme- and the block comparison instruction will not be exe- diately to the instruction following the block comparison cuted at all. The contents of CY immediately before the instruction and the block comparison instruction will not first execution of the REPNC iristruction are "don't care." be executed at all. The contents of CY immediately before the first execution of the REPC instruction are "don't Bytes: 1 care." Clocks: 2 Bytes: 1 Transfers: None Clocks: 2 Flag operation: None Transfers: None Example: REPNC CMPMB Flag operation: None Example: REPC CMPBKW 12-14 NEe Section 12 Instruction Set REP/REPE/REPZ REPNE/REPNZ (no operand) Repeat/repeat while equal/repeat while zero Repeat while not equal/repeat while not zero REP (no operand) 7 o REPE/REPZ (no operand) I 1 I 1 1 1 o o 1 o 7 o I1 I 1 1 1 o o 1 1 While CW =F 0, the block comparison instruction (CMPBK, CMPM) is executed and CW is decremented (-1). If the result of the block comparison instruction is While CW =F 0, the following instruction is executed and Z =F 0 or CW becomes 0, the instruction terminates. CW CW is decremented (-1). is checked against the condition immediately before the REP is used with MOVBK, LDM, STM, OUTM, or INM execution of the block comparison instruction. Conse- instructions and performs repeat operations while quently, if CW = 0 the first time the REPNE/REPNZ CW =F O. The Z flag is disregarded. instruction is executed, the program will proceed imme- diately to the instruction following the block comparison REPZ or REPE is used with the CMPBK or CMPM instruction, and the block comparison instruction will not instruction. A program will exit the loop if the comparison be executed at all. result by each block instruction is Z =F 1 or when CW becomes O. A zero flag check is performed to test the result of the block comparison instruction. The contents of Z imme- CW is checked against the condition immediately before diately before the first execution of the REPNE/REPNZ the execution of REP/REPE/REPZ instruction. Conse- instruction are "don't care." quently, if CW=O the first time the REP/REPE/REPZ instruction is executed, the program will move to the Bytes: 1 instruction following the block instruction and the block Clocks: 2 instruction will not be executed at all. Transfers: None A zero flag check is performed against the result of the block instruction. The contents immediately before the Flag operation: None first execution of the REPE/REPZ instruction are Example: "don't care." REPNE CMPMB Bytes: 1 REPNZ CMPBKW Clocks: 2 Transfers: None Flag operation: None Example: REP MOVBKW REPZCMPBKW REPECMPMB 12-15 pPD7010S/70116 NEe PRIMITIVE BLOCK TRANSFER Single operation: When W=O: 11 MOVBK/MOVBKB/MOVBKW When W=1: 19, pPD7010S (repeat) MOVBK [DS1-spec:]dst-block,[Seg-spec:] 19, pPD70116 odd, odd addresses src-block 15, pPD70116 odd, even addresses (repeat) MOVBKB (no operand) 11, pPD70116 even, even addresses (repeat) MOVBKW (no operand) Transfers: Move block/move block byte/move block word Repeat: 2/rep 7 0 Single operation: 2 o o 1 o W Flag operation: None Examples: When W = 0, (IV) - (IX) DIR = 0: IX - IX + 1, IV - IV + 1 1. MOV AW,SEG SRC_BLOCK DIR = 1: IX-IX - 1, IV - IV - 1 ;point to source When W = 1, (IV + 1, IV) - (IX + 1, IX) MOV DSO,AW DIR=O: IX -IX+2, IV-IV+2 ;segment and offset DIR = 1: IX -IX - 2, IV -IV- 2 MOV IX,OFFSET SRC_BLOCK MOV AW,SEG DST_BLOCK Transfers the block addressed by the IX register to the ;point to destination block addressed by the IV register by repeating the data MOV DS1,AW word byte. In order to transfer the next byte/word, the MOV IV,OFFSET DST_BLOCK IX or IV register is automatically incremented (+1 or +2) MOV CW,22 or decremented (-1 or -2) each time a byte/word is ;set count transferred. The direction of the block is determined by REP MOVBKW the direction flag (DIR). ;move 22 words Byte or word specification is made by the attribute of the 2. MOV IX,SP operand when the MOVBK is used. If the MOVBKB or ;source will be stack MOVBKW is used, the type is specified by the instruction. MOV DS1,IV,DST_DWPTR The destination block must always be located within ;fetch pOinter to destination the segment specified by the DS1 segment register. The MOV CW,5 default segment for the source block register is DSo, and ;set count a segment override is permitted. The source block may REP MOVBK DS1 :DST_BLOCK,SS:[IX] be located in a segment specified by any of the segment ;move from stack (override prefix) registers. ;to destination Bytes: 1 DATAO SEGMENT AT 0 SRC_BLOCK DW 22 DUP (?) Clocks: SRCJ)WPTR DD SRC_BLOCK Repeat: DST_DWPTR DD DST_BLOCK When W=O: 11+S/rep DATAO ENDS When W=1: 11+16/rep, pPD7010S DATA1 SEGMENT AT 1000H pPD70116 odd, odd DST_BLOCK DW 22 DUP (?) addresses DATA1 ENDS 11+16/rep,pPD70116 odd, even addresses 11+S/rep, pPD70116 even, even addresses 12-16 NEe Section 12 Instruction Set CMPBK/COMPBKB/CMPBKW Single operation: (repeat) CMPBK [Seg-spec:]src-block,[DS1-spec:]dst- When W=O: 13 block When W=1: 21, pPD7010S (repeat) CMPBKB (no operand) 21, pPD70116 odd, odd (repeat) CMPBKW (no operand) addresses 17: pPD70116 odd, even Compare block/compare block byte/compare block addresses word 13: pPD70116 even, even 7 o addresses 1 0 1 o o 1 1 W Transfers: Repeat: 1 / rep WhenW=O: (IX) - (IV) Single operation: 2 DIR=O: IX - IX+1, IV - IV+1 Flag operation DIR=1: IX - IX-1, IV - IV-1 When W=1: (IX+1, IX) - (IV+1, IV) DIR=O: AC P CV IX - IX+2, IV - IV+2 DIR=1: IX - IX-2, IV - IV-2 X X X Repeatedly compares the block addressed by the IV reg- ister with the block addressed by the IX register, byte by Example: byte or word by word. The result of the comparison is MOV DSO,IX,SRC-DWPTR shown by the flag. In order to process the next byte or ;point to areas to compare word, IX and IV are automatically incremented (+1 or +2) MOV DS1,IV,DST-DWPTR or decremented (-1 or -2) each time one byte or word MOV CW,16 is processed. The direction of the block is determined ;set count by the direction flag (DIR). REPNC CMPBKB ;compare 16 pairs of bytes The byte or word specification is made by the attribute BCWZ GREATER of the operand when CMPBK is used. If CMPBKB or ;if CW = 0, then SRC ~ DST CMPBKW is used, it is specified directly to be the byte LESS: or word type. The destination block must always be located within the segment specified by the DS1 register. The default seg- ment register for the source block is DSo and a segment override prefix is permitted. Bytes: 1 Clocks: Repeat: When W=O: 7+14/rep When W=1: 7+22/rep, pPD7010S pPD70116 odd, odd addresses 7+1S/rep, pPD70116 odd, even addresses 7+14/rep, pPD70116 even, even addresses 12-17 pPD70108/70116 ttlEC CMPM/CMPMB/CMPMW Clocks: Repeat: (repeat) CMPM [DS1-spec:]dst-block When W=O: 7+10/rep (repeat) CMPMB (no operand) When W=1: 7+14/rep,pPD70108 (repeat) CMPMW (no operand) 7+14/rep, pPD70116 odd addresses Compare multiplel compare multiple byte I compare 7+10/rep, pPD70116 even addresses multiple word Single operation: 7 o WhenW=O: 7 When W=1: 11, pPD70108 1 o 1 o 1 1 1 W 11, pPD70116 odd addresses 7, pPD70116 even addresses WhenW=O: (AL) - (IV) DIR=O: IY-IY+1, Transfers: DIR=1: IY -IY-1 Repeat: 1 I rep WhenW=1: AW - (IY+1, IV) Single operation: 1 DIR=O: IY-IY+2 Flag operation DIR=1: IY-IY-2 Repeatedly compares the block addressed by the IY with AC P CY the accumulator (AL or AW). To process the next byte or x x x word, the IY is automatically incremented (+1 or +2) or decremented (-1 or -2) each time one byte or word is processed. The direction of the block is determined by Example: the direction flag (DIR). Byte or word specification is MOV DS1,IY,DST_DWPTR made by the attribute of the operand when CMPM is ;point to destination block used. If CMPMB or CMPMW is used, it is specified MOV AL,'I\ directly by the instruction. MOV CW,20 ;search for first '1\ The destination block must always be located within the REPNZ CMPMB segment specified by the DS 1 segment register. Bytes: 1 12-18 t-IEC Section 12 I nstruction Set LDM/LDMB/LDMW Flag operation: None (repeat) LDM [Seg-spec:]src-block Example: (repeat) LDMB (no operand) (repeat) LDMW (no operand) ;Add a constant to a string MOV DS1,IY,DST_DWPTR Load multiple/load multiple byte/load multiple word ;point DS1 :IY to string 7 o MOV IX,IY ;point DS1 :IX to same area o 1 1 o W MOV CW,10 ;Iength of string When W=O: AL - (IX) HERE: LDM BYTE PTR DS1 :[IX] DIR=O: IX -IX+1 ;fetch byte (from DS1, with DIR=1: IX -IX-1 segment override prefix), When W=1: AW - (IX+1, IX) increment IX DIR=O: IX -IX+2 ADD AL,20H DIR=1: IX - IX-2 ;add constant Transfers the block addressed by the IX register to the STMB ;replace modified value at accumulator (AL or AW). To process the next byte or word DS1:IY, the IX register is automatically incremented (+1 or +2) ;increment IY or decremented (-1 or -2) each time one byte or word DBNZ HERE is processed. The direction of the block is determined ;Ioop until CW =0 by the direction flag (DIR). Byte or word specification is made by the attribute of the operand when LDM is used. If LOMB or LDMW is used, it is specified directly to be /the byte or word type. The instruction may have a repeat prefix, but is usually used without one. The default segment register for the source block is DSo, and therefore segment override is possible. The source block may be located within the segment specified by any (optional) segment register. Bytes: 1 Clocks: Repeat: When W=O: 7+91 rep When W=1: 7+13/rep:pPD70108 7+13/rep: pPD70116 odd addresses 7+9/rep : pPD70116 even addresses Single operation: WhenW=O: 7, When W=1: 11,pPD70108 11, pPD70116 odd addresses 7, pPD70116 even addresses Transfers: Repeat: 11 rep Single operation: 1 12-19 pPD70108/70116 ttiEC STM/STMB/STMW Example: (repeat) STM [OS1-spec:]dst-block ;Fill memory area with a constant (repeat) STMB (no operand) MOV DS1,IY,DST_DWPTR (repeat) STMW (no operand) ;point to block XOR AW,AW Store multiple/store multiple byte/store multiple word ;zero the accumulator 7 o MOV CW,10 ;count = 10 o 1 o 1 W REP STMW ;fill 10 words with zero When W=O: (IY) - AL DIR=O: IY - IY+1 DIR=1: IY -IY-1 When W=1: (IY+1,1y) - AW DIR=O: IY - IY+2 DIR=1: IY -IY-2 Transfers the contents of AL or AW to the block ad- dressed by IY. To process the next byte or word, IY is automatically incremented (+1 or +2) or decremented (-1 or -2) each time one byte or word is processed. The direction of the block is determined by the direction flag (DIR). Byte or word specification is made by the attribute of the operand when STM is used. If STMB or STMW is used, it is specified directly to be the byte or word type. The destination block must always be located within the segment specified by the DS1 segment register. Bytes: 1 Clocks: Repeat: When W=O: 7+4/rep When W=1: 7+8/rep: pPD70108 7+8/rep: pPD70116 odd addresses 7+4/rep: pPD70116 even addresses Single operation: When W=O: 7 When W=1: 11, pPD70108 11, pPD70116 odd addresses 7, pPD70116 even addresses Transfers: Repeat: 1 / rep Single operation: 1 Flag operation: None 12-20 Section 12 ttlEC Instruction Set BIT FIELD MANIPULATION (0-15) will be valid for the 8-bit register of the second INSTRUCTIONS operand that specifies the bit length (maximum length: 16 bits). 0 specifies a 1-bit length, and 15 specifies a ~ INS reg1, reg2 16-bit length. Insert bit field (register) Bit field data may overlap the byte boundary of memory. 7 0 Note: For correct operation the upper four bits of the 8-bit registers 0 0 0 0 1 1 1 1 used as first and second operands must be set to O. Bytes: 3 0 0 1 1 0 0 0 1 Clocks: I 35-113: pPD70108 1 1 reg2 reg1 35-113: pPD70116 odd addresses 31-117: pPD70116 even addresses 16-bit field - AW Transfers: 2 or 4 Transfers the lower data bits of the 16-bit AW register (bit Flag operation: length is specified by the 8-bit register of the second operand) to the memory location determined by the byte P CV offset (addressed by the DS1 segment register and the IV index register) and bit offset (specified by the 8-bit u u register of the first operand). Example: INS DL,CL (See below for detailed After the transfer, the IV register and the 8-bit register specified by the first operand are automatically updated example) to point to the next bit field. Only the lower 4 bits (0-15) will be valid for the 8-bit register of the first operand that specifies the bit offset (maximum length: 15 bits). Also, only the lower 4 bits (IV) Byteoflset : lI :: 'II :- Byte boundary ( Segment base (0$1) 49.000011A 12-21 pPD70108/70116 NEe INS reg8,imm4 Transfers: 2 or 4 Insert bit field (immediate data) Flag operation: 7 0 P CY 0 0 0 0 1 1 1 1 u u 0 0 1 1 1 0 0 1 Example: I MOV DS1,IY,DST_DWPTR 1 1 0 0 0 reg8 ;Point to destination MOV Cl,3 I ;Start at bit 3 imm4 MOV Dl,4 ;Insert 5 bits 16-bit field +- AW (A) MOV AW,5555H Transfers the lower data bits of the 16-bit AW register (bit ;Pattern to insert (A) length specified by the 4-bit immediate data of the (B) INS Cl,Dl second operand) to the memory location determined by ;Insert 5 bits at bit 3 (B) the byte offset (addressed by the DS1 segment register (C) INS Cl,12 and the IY register) and bit offset (specified by the 8-bit ;Insert 13 bits at bit 8 (C) register of the first operand). After the transfer, the IY at (A) memory = register and the 8-bit register specified by the first oper- and are updated to point to the next bit field; MSB xxx lSB MSB I lSB X XXXX XXXX XXX X XXX X XXXX XXXX XXXX Only the lower 4 bits (0-15) for the 8-bit register of the Cl = 3, IY = base first operand (15 bits maximum length) are valid. The immediate data value of the second operand (16 bits at (B) memory = I ~ XXXX XXXX XXXX XXXX XXXX XXXX 1010 1XXX maximum length) is valid only from 0-15. Cl = 8, IY = base ospecifies a 1-bit length, and 15 specifies a 16-bit length. at (C) memory = I The bit field data may overlap the byte boundary of ~ XXXX XXX X XXX1 0101 0101 0101 1010 1XXX memory. Cl = 5, IY = base + 2 Note: For correct operation, set the upper four bits of the 8-bit register used as the first operand to O. Bytes: 4 Clocks: 75-103: pPD70108 75-103: pPD70116 odd addresses 67-87: pPD70116 even addresses 12-22 ttlEC Section 12 Instruction Set ~ EXT reg 1, reg2 valid. Only the lower 4 bits of the 8-bit regis~er of the second operand (maximum length: 16 bits) are valid. Extract bit field (register) 7 0 ospecifies a 1-bit length, and 15 specifies a 16-bit length. Bit field data may overlap the byte boundary of memory. I 0 0 0 0 1 1 1 1 Note: For correct operation, the upper 4 bits of the 8-bit registers used as first and second operands must be set to O. I0 0 1 1 0 0 1 1 Bytes: 3 I I Clocks: ~ I1 1 reg2 reg1 34-59: J.IPD70108 34-59: J.IPD70116 odd addresses AW - 16-bit field 26-55: J.IPD70115 even addresses Loads the bit field data (bit length specified by the 8-bit Transfers: 1 or 2 register of the second operand) into the AW register. The segment base of the memory location of the bit field is Flag operation: specified by the DSo register, the byte offset by the IX index register, and the bit offset by the 8-bit register of P CY the first operand. At the same time zeros are loaded to the remaining upper bits of the AW register. u u After the transfer, the IX register and the 8-bit register Example: EXT CL,DL (See below for detailed specified by the first operand are updated to point to the example) next bit field. Only the lower 4 bits (0-15) of the 8-bit register of the first operand (maximum length: 15 bits) are Bit Bit (IX) ~' Offset Byte Offset ; lI :: 'II ~MemOry Awl 15 0 - I 0 Byte Boundary Segment Base (080) ,49.000012A 12-23 pPD70108/70116 NEe EXT reg8,imm4 Clocks: 25-52: pPD70108 Extract bit field (immediate data) 25-52: pPD70116 odd addresses 7 0 21-44: pPD70116 even addresses 0 0 0 0 1 1 1 Transfers: 1 or 2 Flag operation: 0 0 1 1 1 0 1 1 AC P CY 1 1 0 0 0 reg u u u I imm4 Example: MOV DSO,IX,SRC-DWPTR AW +- 16-bit field ;Point to area to extract MOV [IX],5555H Loads bit field data from the memory location specified ;Fill in sample patterns by the byte offset to the AW register (addressed by the MOV [IX+2],3333H DSo segment register and the IX index register) and MOV CL,3 the bit offset (specified by the 8-bit register of the first ;Start at bit 3 operand). (A) MOV DL,4 The bit length is specified by the 4-bit immediate data ;(A) of the second operand. (B) EXT CL,DL ;Extract 5 bits starting at 3 (B) After the transfer, the IX register and the 8-bit register (C) EXT CL,12 specified by the first operand are updated to point to the ;Extract 13 bits starting at 8 (C) next bit field. Only the lower 4 bits (0-15) of the 8-bit register ofthe first operand (maximum length: 15 bits) will be valid. The immediate data value of the second oper- and (maximum length: 16 bits) will bevalid only from 0-15. MSB at (A) memory = LSB MSB 0011 0011 0011 0011 0101 0101 I 0101 LSB 0101 CL = 3, IX = base, AW = unknown Zero specifies a 1-bit length, and 15 specifies a 16-bit at (B) length. Bit field data may overlap the byte boundary of CL = 8, IX = base, AW = (0000 0000 000)01010 memory. at (C) Note: For correct operation, set the upper 4 bits of the 8-bit register CL = 5, IX = base + 2, AW = (000)1 0011 0101 0101 used as the first operand to O. Bytes: 4 Bil Bit (IX) OIIset Byte OIIsel &id' lI :: 'jI ~ Memory 15 I 0 Byte Boundary Segment Base Awl 0 W$l1 (050) 49000012AI 12-24 NEe Section 12 Instruction Set INPUTIOUTPUT IN acc,DW IN acc,imm8 Input to device indirectly specified by OW Input specified I/O device 7 o 7 o I 1 I 1 1 o 1 1 o W 1 1 1 o o 1 o W When W=O: AL - (OW) I When W=1: AH - (OW+1 ),AL - (OW) immS Inputs the contents of the I/O device specified by the OW register to the accumulator (AL or AW) specified by the When W=O AL - (immS) first operand. When W=1 AH - (immS+1), AL - (immS) Inputs the contents of the I/O device specified by the Bytes: 1 second operand to the accumulator (AL or AH) speci- Clocks: fied by the first operand. When W=O: S Bytes: 2 When W=1: 12,pP070108 12, pP070116 odd addresses Clock: S, pP070116 even addresses WhenW=O: 9 When W=1: 13, pP07010S Transfers: 1 13,pP070116 odd addresses Flag Operation: None 9, pP070116 even addresses Example: IN AL,OW Transfers: 1 Flag operation: None Example: IN AL,20H IN AW,4SH 12-25 pPD7010S/70116 NEe OUT imm8,8cc OUT DW,8cc Output to directly specified I/O device Output to indirectly specified (by OW) I/O device 7 o 7 0 1 1 1 o o 1 1 W 111110111 W 1 immB When W=O: (OW) +- AL When W=1: (OW+1) +- AH, (OW) +- AL When W=O: (immB) +- AL Outputs the contents of the accumulator (AL or AW) spec- When W=1: (immB+1) +- AH, (immB) +- AL ified by the second operand to the I/O device specified by the first operand. Outputs the contents ofthe accumulator (AL or AH) spec- ified by the second operand to the I/O device specified Bytes: 1 by the first operand. Clocks: Bytes: 2 When W=O: B When W=1: 12, pP07010B Clocks: 12, pP070116 odd addresses When W=O: B B, pP070116 even addresses When W=1: 12, pP07010B 12, pP070116 odd addresses Transfers: 1 B, pP070116 even addresses Flag operation: None Transfers: 1 Example: OUT OW,AW Flag operation: None Example: OUT 30H,AW 12-26 t\'EC Section 12 Instruction Set OUT DW,acc Output to indirectly specified (by OW) 1/0 device 7 o 1 1 W When W=O: (OW) - AL When W=1: (OW+1) - AH, (OW) - AL Outputs the contents ofthe accumulator (AL or AW) spec- ified by the second operand to the 1/0 device specified by the first operand. Bytes: 1 Clocks: When.W=O: 8 When W=1: 12, pP070108 12, pP070116 odd addresses 8, pP070116 even addresses Transfers: 1 Flag operation: None Example: OUT OW,AW 12-27 pPD7010S/70116 NEe PRIMITIVE INPUT/OUTPUT Bytes: 1 (repeat) INM [DS1-spec:]dst-block,DW Clocks: Repeat: Input multiple When W=O: 9+8/rep 7 o When W=1: 9+16/rep: pP070108 I0 I 1 1 o 1 1 o W 9+16/rep: pP070116 odd-odd addresses 9+12/rep: pP070116 odd-even When W=O: (IY) - (OW) addresses Oir=O: IY - IY+1 9+8/rep: pP070116 even-even Oir=1: IY -IY-1 addresses When W=1: (IY+1,IY) - (OW+1,OW) Oir=O: IY - IY+2 Single operation: Oir=1: IY -IY-2 When W=O: 10 When W=1: 18,pP070108 Transfers the contents of the I/O device addressed by 18, pP070116 odd-odd addresses the OW register to the memory location addressed by the 14, pP070116 odd-even addresses IY index register. 10, pP070116 even-even addresses When this instruction is paired with a repeat prefix (REP), Transfers: the REP prefix controls the number of times the transfer Repeat: 2/rep will be repeated. When transfers are repeated, the con- Single operation: 2 tents (address of the I/O device) of the OW register are fixed. However, to transfer the next byte or word, the IX Flag operation: None index register is automatically incremented (+1 or +2) Example: or decremented (-1 or-2) each time one byte or word MOV CW,30 is transferred. The direction of the block is determined MOV IY,OFFSET BYTE-VAR by the direction flag (OIR). REP INM BYTE_VAR,OW Byte or word specification is performed according to the ;Input 30 bytes attribute of the operand. The destination block must always be located within the segment specified by the OS1 segment register, and a segment override prefix is prohibited. 12-28 NEe Section 12 Instruction Set OUTM DW,[seg-spec:]src-block ADDITION/SUBTRACTION Output multiple ADD reg,reg 7 o Add register with register to register I0 i 1 1 o 1 1 1 W 7 o o o o o o o 1 W When W=O: (OW) - (IX) OIR=O: IX - IX+1 0IR=1: IX - IX-1 1 1 reg reg When W=1: (OW+1, OW) - (IX+1,IX) OIR=O: IX -IX+2 reg - reg + reg 0IR=1: IX - IX-2 Adds the contents of the 8- or 16-bit register specified Transfers the memory contents addressed by the IX by the second operand to the contents of the 8- or 16-bit index register to the 1/0 device addressed by the OW register specified by the first operand. Stores the result register. When this instruction is paired with a repeat in the register specified by the first operand. prefix (REP), REP controls the number of times the Bytes: 2 transfer will be repeated. When transfers are repeated, the contents (address of the 1/0 device) of the OW reg- Clocks: 2 ister are fixed. However, to transfer the next byte or word, Transfers: None the IX index register is automatically incremented (+1 or +2) or decremented (-1 or -2) each time one byte or Flag operation: word is transferred. The direction or the block is deter- mined by the direction flag (OIR). V S z AC P CY X X Byte or word specification is performed according to the attribute of the operand. The default segment register for I I I X i X X X the source block is OSo, and segment override is pos- Example: AOO AW,BW sible. The source block may be located within the seg- ment specified by any (optional) segment register. Bytes: 1 Clocks: Repeat: When W=O: 9+8/rep When W=1: 9+16/rep,pP070108 9+16/rep, pP070116 odd-odd addresses 9+12/rep, pP070116 odd-even addresses 9+8/rep, pP070116 even-even addresses Single operation: When W=O: 10 When W=1: 18, pP070108 18, pP070116 odd-odd addresses 14, pP070116 odd-even addresses 10, pP070116 even-even addresses Transfers: Repeat: 2 I rep Single operation: 2 Flag operation: None Example: REP OUTM OW,BYTE PTR OS1 :[IX] 12-29 pPD70108/70116 NEe ADD mem,reg ADD reg,mem Add memory with register to memory Add register with memory to register 7 0 7 0 0 0 0 0 0 0 0 W 0 0 0 0 0 0 1 W I I I I mod reg mem mod reg mem I I I I (disp-Iow) (disp-Iow) I I I I (disp-high) (disp-high) (mem) - (mem) + reg reg - reg + (mem) Adds the contents of the 8- or 16-bit register specified Adds the 8- or 16-bit memory contents addressed by the by the second operand to the 8- or 16-bit memory con- second operand to the contents of the 8- or 16-bit reg- tents addressed by the first operand. Stores the result in ister specified by the first operand. Stores the result in the memory location addressed by the first operand. the register specified by the first operand. Bytes: 2/3/4 Bytes: 2/3/4 Clocks: Clocks: When W=O: 16 When W=O: 11 When W=1: 24, pPD70108 When W=1: 15, pPD70108 24, pPD70116 odd addresses 15, pPD70116 odd addresses 16, pPD70116 even addresses 11, pPD70116 even addresses Transfers: 2 Transfers: 1 Flag operation: Flag operation: AC P CY AC P CY x x x x x x Example: Example: ADD WORD_VAR,AW ADD AW,WORD_VAR ADD [IX],CW ADD BW,[BP](IX] 12-30 NEe Section 12 Instruction Set . ADD reg,imm ADD mem,imm Add register with immediate data to register Add memory with immediate data to memory 7 o 7 0 1 o o o o o S W 1 0 0 0 0 0 S W I I I 1 1 o o o reg mod 0 0 0 mem I I I I I imm8 or imm16-low (disp-Iow) I I I I imm16-high (disp-high) I I I reg - reg + imm imm8 or imm16-low Adds the 8- or 16-bit immediate data specified by the I I second operand to the contents of the 8- or 16-bit reg- imm16:-high ister specified by the first operand, and stores the result in the register specified by the first operand. (mem) - (mem) + imm Bytes: 2/3/4 Adds the 8- or 16-bit immediate data specified by the Clocks: 4 second operand to the 8- or 16-bit memory contents addressed by the first operand. Stores the result in the Transfers: None memory location addressed by the first operand. Flag operation: Bytes: 3/4/5/6 Clocks: P CY When W=O: 18 x x When W=1: 26, pPD70108 26, pPD70116 odd addresses Example: ADD DL,10 18, pPD70116 even addresses Transfers: 2 Flag operation: AC P CY x x x Example: ADD BYTE_VAR[BP],100 ADD WORD_VAR[BW][IX],1234H 12-31 pPD7010S/70116 NEe ADDacc,imm ADDC reg,reg Add accumulator with immediate data to accumulator Add with carry, register with register to register 7 o 7 o o o o o o 1 o W o o o 1 o o 1 W I I I imm8 or imm16-low 1 1 reg reg I I imm16-high reg - reg + reg + CY Adds the contents of the 8- or 16-bit register specified When W=O: AL - AL imm by the second operand and the contents of the carry flag When W=1: AW - AW imm to the contents of the 8- or 16-bit register specified by the first operand. Stores the result in the register spec- Adds the 8- or 16-bit immediate data specified by the ified by the fi rst operand. second operand to the contents of the accumulator (AL or AW) specified by the first operand. Stores the result Bytes: 2 in the accumulator specified by the first operand. Clocks: 2 Bytes: 2/3 Transfers: None Clocks: 4 Flag operation: Transfers:. None Flag operation: p CY x x AC p CY x x x Example: ADDC BW,DW Example: ADD AL,3 ADD AW,2000H 12-32 Section 12 ttlEC Instruction Set ADDC mem,reg AD DC reg,mem Add with carry. memory with register to memory Add with carry. register with memory to register 7 0 7 0 0 0 0 1 0 0 0 W 0 0 0 1 0 0 1 W I I I I mod reg mem mod reg mem I I I I (disp-Iow) (disp-Iow) I I I I (disp-high) (disp-high) (mem) - (mem) + reg + CY reg - reg + (mem) + CY Adds the contents of the 8- or 16-bit register specified Adds the 8- or 16-bit memory contents addressed by the by the second operand and the contents of the carry second operand and the contents of the carry flag to the flag to the 8- or 16-bit memory contents addressed by contents of the 8- or 16-bit register specified by the first the first operand. Stores the result in the memory location operand. Stores the result in the register specified by the addressed by the first operand. first operand. Bytes: 2/3/4 Byte: 2/3/4 Clocks: Clocks: When W=O: 16 When W=O: 11 When W=1: 24. pPD70108 When W=1: 15. pPD70108 24. pPD70116 odd addresses 15. pPD70116 odd addresses 16. pPD70116 even addresses 11. pPD70116 even addresses Transfers: 2 Transfers: 1 Flag operation: Flag operation: P CY P CY x x x x Example: AD DC Examples: ADDC AW.WORD_VAR ADDC BW.[BP][IX] 12-33 pPD70108/70116 NEe ADDC reg,imm ADDC mem,imm Add with carry, register with immediate data to register Add with carry, memory with immediate data to memory 7 0 7 o 1 0 0 0 0 0 S W o o o o o S W I I 1 0 1 0 reg mod o 1 o mem I I I I I imm8 or imm16-low (disp-Iow) I I I I imm16-high (disp-high) I I I reg +- reg + imm + CY imm8 or imm16-low Adds the 8- or 16-bit immediate data specified by the I I second operand and the contents of the carry flag to the imm16-high contents of the 8- or 16-bit register specified by the first operand. Stores the result in the register specified by the (mem) +- (mem) + imm + CY first operand. Adds the 8- or 16-bit immediate data specified by the Bytes: 3/4 second operand and the contents of the carry flag to the Clocks: 4 8- or 16-bit memory contents addressed by the first oper- and. Stores the result in the memory location addressed Transfers: None by the first operand. Flag operation: Bytes: 3/4/5/6 Clocks: AC P CY When W=O: 18 x x x When W=1: 26, pPD70108 26, pPD70116 odd addresses Example: 18, pPD70116 even addresses ADDC CW,404H Transfers: 2 ADDC DL,3 Flag operation: P CY x x Example: AD DC WORD_VAR,2000H 12-34 NEe Section 12 Instruction Set AD DC acc,imm SUB reg,reg Add with carry, accumulator with immediate data to Subtract register from register to register accumulator 7 o 7 o o o 1 o 1 o 1 W o o o 1 o 1 o W I I I 1 1 reg reg imm8 or imm16-low reg - reg - reg I I imm16-high Subtracts the contents of the 8- or 16-bit register spec- ified by the second operand from the contents of the 8- or When W=O: AL - AL + imm8 + CY 16-bit register specified by the first operand. Stores the When W=1: AW - AW + imm16 + CY result in the register specified by the first operand. Adds the 8- or 16-bit immediate data specified by the Bytes: 2 second operand and the contents of the carry flag to the Clocks: 2 accumulator (AL or AW) specified by the first operand. Stores the result in the accumulator specified by the first Transfers: None operand. Flag operation: Bytes: 2/3 Clocks: 4 p CY Transfers: None x x Flag operation: Example: SUB BW,CW p CY x x Example: ADDC AL,7 12-35 pPD70108/70116 NEe SUB mem,reg SUB reg,mem Subtract register from memory to memory Subtract memory from register to register 7 o 7 0 o o o o o W 0 0 0 1 0 1 W I I I I mod reg mem mod reg mem I I (mem) +- (mem) - reg (disp-Iow) Subtracts the contents of the 8- or 16-bit register spec- I I ified by the second operand from the 8- or 16-bit memory (disp-high) contents addressed by the first operand. Stores the result in the memory location addressed by the first operand. reg +- reg - (mem) Bytes: 2/3/4 Subtracts the 8- or 16-bit memory contents addressed Clocks: by the second operand from the 8- or 16-bit register When W=O: 16 specified by the first operand. Stores the result in the When W=1: 24, pPD70108 register specified by the first operand. 24, pPD70116 odd addresses Bytes: 2/3/4 16, pPD70116 even addresses Clocks: Transfers: 2 When W=O: 11 Flag operation: When W=1: 15, pPD70108 15, pPD70116 odd addresses 11, pPD70116 even addresses AC P CY x x x Transfers: 1 Flag operation: Example: SUB WORDIVAR,BW P CY SUB [IX],AL x x Example: SUB 12-36 NEe Section 12 Instruction Set SUB reg,imm SUB mem,imm Subtract immediate from register to register Subtract immediate data from memory to memory 7 o 7 o 1 o o o o o S W 1 o o o o o S W I I I 1 1 1 o 1 reg mod 1 o 1 mem I I I I I imm8 or imm16-low (disp-Iow) I I I I imm16-high (disp-high) I I I reg - reg - imm imm8 or imm16-low Subtracts the 8- or 16-bit immediate data specified by I I the second operand from the contents of the 8- or 16-bit imm16-high register specified by the first operand. Stores the result in the register specified by the first operand. (mem) - (mem) - imm Bytes: 3/4 Subtracts the 8- or 16-bit immediate data specified by Clocks: 4 the second operand from the 8- or 16-bit memory con- tents addressed by the first operand. Stores the result in Transfers: None the memory location addressed by the first operand. Flag operation: Bytes: 3/4/5/6 Clocks: P CY When W=O: 18 x x When W=1: 26, pPD70108 26, pPD70116 odd addresses Example: SUB IX,4 18, pPD70116 even addresses Transfers: 2 Flag operation: P CY x x Example: SUB 12-37 pPD7010S/70116 NEe SUB acc,imm SUBC reg,reg Subtract immediate data from accumulator Subtract with carry, register from register to register to accumulator 7 o 7 o o o o 1 1 o 1 W o o o 1 1 o W I I I 1 1 reg reg imm8 or imm16-low reg +- reg - reg - CY I I imm16-high Subtracts the contents of the 8- or 16-bit register spec- ified by the second operand and the contents of the carry When W=O: AL +- AL - imm8 flag from the 8- or 16-bit register specified by the first When W=1: AW +- AW - imm16 operand. Subtracts the 8- or 16-bit immediate data specified by Bytes: 2 the second operand from the accumulator (AL or AW) Clocks: 2 specified by the first operand. Stores the result in the accumulator specified by the first operand. Transfers: None Bytes: 2/3 Flag operation: Clocks: 4 p CY Transfers: None x x Flag operation: Example: SUBC BW,DW AC p CY x x x Example: SUB AL,8 12-38 t-IEC Section 12 Instruction Set SUBC mem,reg SUBC reg,mem Subtract with carry, register from memory to memory Subtract with carry, memory from register to register 7 o 7 0 o o o o o W 0 0 0 1 1 0 1 W I I I I mod reg mem mod reg mem I I I I (disp-Iow) (disp-Iow) I I I I (disp-high) (disp-high) (mem) +- (mem) - reg - CY reg +- reg - (mem) - CY Subtracts the contents of the 8- or 16-bit register spec- Subtracts the contents of the 8- or 16-bit memory ad- ified by the second operand and the contents of the carry dressed by the second operand and the contents of the flag from the 8- or 16-bit memory contents specified by carry flag from the 8- or 16-bit register specified by the the first operand. Stores the result in the memory location first operand. Stores the result in the register specified addressed by the first operand. by the first operand. Bytes: 2/3/4 Bytes: 2/3/4 Clocks: Clocks: When W=O: 16 When W=O: 11 When W=1: 24, pPD70108 When W=1: 15, pPD70108 24, pPD70116 odd addresses 15, pPD70116 odd addresses 16, pPD70116 even addresses 11, pPD70116 even addresses Transfers: 2 Transfers: 1 Flag operation: Flag operation: P Cy P CY x x x x Example: SUBC Example: SUBC 12-39 pPD70108/70116 NEe SUBC reg,imm SUBC mem,imm Subtract with carry, immediate data from register Subtract with carry, immediate data from memory to register to memory 7 o 7 o 1 0 0 0 0 0 S W 1 o o o o o S W I I 1 0 1 1 reg mod o 1 1 mem I I I I I imm8 or imm16-low (disp-Iow) I I I I imm16-high (disp-high) I I I reg -- reg - imm - CY imm8 or imm16-low Subtracts the contents of the 8- or 16-bit immediate data I I specified by the second operand and the contents of the imm16-high carry flag from the 8- or 16-bit register specified by the first operand. Stores the result in the register specified (mem) -- (mem) - imm - CY by the first operand. Subtracts the contents of the 8- or 16-bit immediate data Bytes: 3/4 specified by the second operand and the contents of Clocks: 4 the carry flag from the 8- or 16-bit memory contents addressed by the first operand. Stores the result in the Transfers: None memory location addressed by the first operand. Flag operation: Bytes: 3/4/5/6 P CY Clocks: When W=O: 18 x x When W=1: 26, pPD70108 26, pPD70116 odd addresses Example: SUBC DL,10 18, pPD70116 even addresses Transfers: 2 Flag operation: P CY x x Example: SUBC 12-40 ttlEC Section 12 Instruction Set SUBC acc,imm Subtract with carry, immediate data from accumulator to accumulator 7 0 I0 0 0 1 1 1 0 W I I I I immS or imm16-low I I I imm16-high When W=O: AL - AL - immS .::... CY When W=1: AW - AW - imm16 - CY Subtracts the S- or 16-bit immediate data specified by the second operand and the contents of the carry flag from the accumulator (AL or AW) specified by the first operand. Stores the result in the accumulator specified by the first operand. Bytes: 2/3 Clocks: 4 Transfers: None Flag operation: V S z AC p CY I X I X : X : X X X Example: SUBC AL,S 12-41 I1 PD70108/70116 NEe BCD ARITHMETIC byte are all zero. The carry flag will not be set unless there is a carry out ofthe upper 4 bits ofthe highest byte. When ADD4S [DS1-spec:]dst-string,[seg-spec:]src-string Cl is odd, the contents of the upper 4 bits of the highest ADD4S (no operand) byte of the result are undefined. Add nibble string The destination string must always be located within the 7 o segment specified by the DS1 segment register. Segment override is prohibited. o o o o 1 1 1 1 The default segment register for the source string is DSo o o 1 o o o o o and segment override is possible. The source string may be located within the segment specified by any (optional) segment register. BCD string (IY,Cl) - BCD string (IY,Cl) + BCD string (IX,Cl) The format for the packed BCD string follows. Adds the packed BCD string addressed by the IX index Bytes: 2 register to the packed BCD string addressed by the IY index register. Stores the result in the string addressed Clocks: + 7 19n, where n = one-half the number of BCD digits by the IY register. The length of the string (number of BCD digits) is specified by the Cl register and can vary from Transfers: 3n 1 to 254 digits. Flag operation: When the number of digits is even, the zero and carry flags will be set according to the result of the operation. P CY When the number of digits is odd, the zero and carry flags may not be set correctly. In this case, (Cl = odd), the zero u X flag will not be set unless the upper 4 bits of the highest Example: See example for CMP4S IX IV ByteOflset Memo; Digit Offset +m +CL i :: i +4 +3 +1 j +2 +1 +0 0 I 49.000013A 12-42 tt1EC Section 12 Instruction Set SUB4S [DS1-spec:]dst-string,[seg-spec:]src-string is a carry out of the upper 4 bits of the highest byte. When SUB4S (no operand) CL is odd, the contents of the upper 4 bits of the highest byte of the result are undefined. Subtract nibble string The destination string must always be located within the 7 0 segment specified by the DS1 segment register. Segment 0 0 0 0 1 1 1 1 override is prohibited. The default segment register for the source string is DSo, ~I 0 0 1 0 0 0 1 0 and segment override is possible. The source string may be located within the segment specified by any (optional) BCD string (IY,CL) - BCD string (IY,CL) - BCD string segment register. (IX,CL) The format for the packed BCD string is shown as Subtracts the packed BCD string addressed by the IX follows. index register from the packed BCD string addressed by Bytes: 2 the IY index register. Stores the result in the string addressed by the IY register. Clocks: 7 + 19 n, where n = one-half the number of BCD digits The length of the string (number of BCD digits) is spec- ified by the CL register and can vary from 1 to 254 digits. Transfers: 3n When the number of digits is even, the zero and carry Flag operation: flags will be set according to the result of the operation. When the number of digits is odd, the zero and carry flags P CY may not be set correctly. In this case, (CL = odd), the zero flag will not be set unless the upper 4 bits of the highest u X byte are all zero. The carry flag will not be set unless there Example: See example for CMP4S IX IV ! Byte Offset +m +1 +0 , i Memo7 Digi10ffset +CL i :: i +4 +3 , I +2 +1 i 0 49 OCXX1LlA 12-43 pPD70108/70116 NEe CMP4S Example: [DS1-spec:]dst-string,[seg-spec:]src-string ;pPD70116 BCD string operation CMP4S (no operand) MOV AW,PS ;Set both data Compare nibble string ;segments to MOV DSO,AW ;same as program 7 o MOV DS1,AW ;segment o o o o 1 1 1 1 MOV IX,OFFSET STRO ;Point to BCD strings o MOV IY,OFFSET STR1 o o 1 o 1 1 o MOV Cl,8 ;Eight digits ;instrings (A) BCD string (IY,Cl) - BCD string (IX,Cl) CMP4S ;Compare (B) Subtracts the packed BCD string addressed by the IX ADD4S ;Add stringO index register from the packed BCD string addressed by ;to string1 (C) the IY index register. The result is not stored and only CMP4S ;Compare again (D) the flags are affected. The length of the string (number SUB4S ;Subtract stringO of BCD digits) is specified by the Cl register and can vary ;from string1 (E) from 1 to 254 digits. SUB4S ;again (result is zero) (F) When the number of digits is even, the zero and carry SUB4S ;and again flags will be set according to the result of the operation. ;(underflow) (G) When the number of digits is odd, the zero and carry flags HALT may not be set correctly. In this case, (Cl = odd), the zero flag will not be set unless the upper 4 bits of the highest STRO OW 4321 H,0765H byte are all zero. The carry flag wili not be set unless there ;BCD# 07654321 is a carry out of the upper 4 bits of the highest byte. When STR1 OW 4321 H,0765H Cl is odd, the contents of the upper 4 bits of the highest ;BCD# 07654321 byte of the result are undefined. The default segment register for the source string is DSo ; at (A), STRO = 7654321, and segment override is possible. STR1 = 7654321, Z=?, CY =? The source string may be located within the segment = ; at (B), STRO 7654321, STR1 = 7654321, Z = 1, CY = 0 specified by any (optional) segment register. The format ; at (C), STRO = 7654321, for the packed BCD string is shown below. STR1 = 15308642, Z = 0, CY = 0 Bytes: 2 ; at (D), STRO = 7654321, STR1 = 15308642, Z = 0, CY = 0 Clocks: 7 + 19n, where n =one-halfthe numberof BCD ; at (E), STRO = 7654321, digits . STR1 = 7654321, Z = 0, CY = 0 Transfers: 2 ; at (F), STRO = 7654321, STR1 = 00000000, Z = 1, CY = 0 Flag operation: ; at (G), STRO = 7654321, STR1 = 92345679, Z = 0, CY = 1 v S Z AC P CY U U X U U X IX IV Byte Off'"-set_~-.:.;+m~,----.,..--1H Memo; Digit Offset + CL i $$ i +4 +3 +1 i +2 +1 " ! i 0 : 49(J(J(i)' iA 12-44 NEe Section 12 Instruction Set ROL4 reg8 ROL4 mem8 Rotate left nibble, 8-bit register Rotate left nibble, 8-bit memory 7 0 7 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 0 I I 1 1 0 0 0 reg mod 0 0 0 mem I I (disp-Iow) I I reg8 (disp-high) Higher Lower .----- ALL 4 Bits 4 Bits I-- (mem8) 49.000024A - ALL Higher 4 Bits Lower 4 Bits I--- Treats the byte data of the 8-bit register specified by the operand as a two-digit BCD and uses the lower 4 bits of the AL register (ALJ to rotate that data one digit to the left. 49- 16 bits: CY -1, V-1 imm8 Performs signed multiplication of the contents of the reg16 - (MEM16) X imm8 16-bit register specified by the second operand. (If a two- Product:::; 16 bits: CY - 0, V - 0 operand description, then performs signed multiplication Product> 16 bits: CY - 1, V - 1 on the contents specified by the first operand.) Performs signed multiplication on the 8-bit immediate data spec- Performs signed multiplication of the contents of the ified by the third operand. (If a two-operand description 16-bit memory contents addressed by the second oper- then performs signed multiplication on the data specified and and the 8-bit immediate data specified by the third by the second operand.) operand. Stores the result in the 16-bit register specified by the first operand. When the source register and the destination register are the same, a two-operand description is acceptable. Bytes: 3/4/5 Bytes: 3 Clocks: 38 to 44, pPD70108 Clocks: 28 to 34 (according to data) 38 to 44, pPD70116 odd addresses Transfers: None 34 to 40, pPD70116 even addresses Flag operation: Transfers: 1 Flag operation: AC P CY U U x AC P CY U U x Example: MUL AW,BW,10 Example: ;AW= BW*10 MUL CW,WORD_VAR,7 MUL CW,25 ;CW = [WORD_VAR)*7 ;CW=CW*25 MUL AW,[IX),22 ;AW = [IX)*22 12-54 NEe Section 12 Instruction Set MUL reg16,reg16,imm16 MUL reg16,mem16,imm16 MUL reg16,imm16 Multiply signed, 16-bit memory X 16-bit immediate data Multiply signed, 16-bit register X 16-bit immediate data to 16-bit register to 16-bit register 7 0 7 0 1 1 0 1 0 0 0 0 1 1 0 1 0 0 1 I I mod reg mem 1 1 reg reg I I I I (disp-Iow) imm16-low I I I I (disp-high) imm16-high I I imm16-low reg16 - reg16 X imm16 If product:::; 16 bits: CY - 0, V - 0 I I If product> 16 bits: CY - 1, V - 1 imm16-high Performs signed multiplication of the contents of the reg16 - (mem16) X imm16 16-bit register specified by the second operand - the first operand, when a two-operand description - and the If product:::; 16 bits: CY - 0, V - 0 16-bit immediate data specified by the third (second) If product> 16 bits: CY - 1, V - 1 operand. Stores the result in the 16-bit register specified Performs signed multiplication of the 16-bit memory con- by the first operand. tents specified by the second operand and the 16-bit When the source register and the destination register are immediate data specified by the third operand. Stores the the same, a two-operand description is possible. result in the 16-bit register specified by the first operand. Bytes: 4 Bytes: 4/5/6 Clocks: 36 to 42 (according to data) Clocks: 46 to 52, JlPD70108 Transfers: None 46 to 52, JlPD70116 odd addresses Flag operation: 42 to 48, JlPD70116 even addresses Transfers: 1 AC P CY Flag operation: U U x AC P CY Example: MUL AW,BW,200H U U x ;AW = BW*200H MUL IX,300 Example: ;IX = IX*300 MUL CW,WORD_VAR,200H ;CW = [WORD_VAR]*200H MUL AW,[IX],850 ;AW = [IX]*850 12-55 pPD7010S/70116 t-IEC DIVISION DIVU memS DIVU regS Divide unsigned, 8-bit memory Divide unsigned, 8-bit register 7 o 7 o 1 1 a 1 1 o 1 1 1 1 o 1 1 o I I mod 1 o mem 1 1 1 o reg I I (disp-Iow) temp -AW I I When temp -;- reg 3::; FFH: (disp-high) AH - temp % reg8 AL - temp -;- reg8 temp-AW When temp -;- reg8 > FFH: When temp -;- (mem8) = FFH: (SP-1,SP-2) - PSW, AH - temp % (mem8), (SP-3,SP-4) - PS, AL - temp -;- (mem8). (SP-5,SP-6) - PC, When temp -;- (mem8) FFH: > SP - SP - 6, (SP-1,SP-2) - PSW, IE-O, (SP-3,SP-4) - PS, BRK-O, (SP-5,SP-6) - PC, PS - (003H, 002H), SP - SP - 6 PC - (001 H, OOOH) IE-a, Divides (using unsigned division) the contents of the AW BRK-O, 16-bit register by the contents of the 8-bit register spec- PS - (003H, 002H), ified by the operand. The resulting quotient is stored in PC - (001 H, OOOH), the AL register. Any remainder is stored in the AH register. Divides (using unsigned division) the contents of the AW When the quotient exceeds FFH (the capacity of the AL 16-bit register by the 8-bit memory contents specified by a destination register) the vector interrupt is generated. the operand. The quotient is stored in the AL register and When this occurs, the quotient and remainder become the remainder, if any, is stored in the AH register. undefined. This usually occurs when the divisor is O. The When the quotient exceeds FFH - the capacity of the fractional quotient is rounded off. AL destination register - the vector 0 interrupt is gener- Bytes: 2 ated. When this occurs, the quotient and remainder become undefined. This especially occurs when the di- Clocks: 19 visor is O. The fractional quotient is rounded off. Transfers: None Bytes: 2/3/4 Flag operation: Clocks: 25 Transfers: 1 AC P CY U U U Flag operation: Example: AC P CY MaV AW,204 U U U MaV CL,10 DIVU CL Example: ;AL = 20, AH = 4 MaV AW,3410 MaV [BW],19 DIVU [BW] ;AL = 179, AH = 9 12-56 NEe Section 12 Instruction Set DIVU reg16 DIVU mem 16 Divide unsigned, 16-bit register Divide unsigned, 16-bit memory 7 0 7 o 1 1 1 1 0 1 1 1 1 1 o 1 1 1 I I 1 1 1 1 0 reg mod 1 1 o mem I I temp - DW,AW (disp-Iow) When temp -7- reg16 > FFFFH: (SP-1,SP-2) - PSw, I I (SP-3,SP-4) - PS, (disp-high) (SP-5,SP-6) - PC, SP -SP-6 temp - DW,AW IE-O, When temp -7- (mem16) > FFFFH: BRK-O (SP-1,SP-2) +- PSW, PS +- (003H, 002H), (SP-3,SP-4) - PS, PC +- (001 H, OOOH) (SP-5,SP-6) +- PC, All other times: SP +- SP-6 DW - temp % reg16, AW +- temp -7- reg16 IE-O, BRK +- 0, Divides (using unsigned division) the contents of the DW PS +- (003H, 002H), and AW 16-bit register pair by the contents of the 16-bit PC +- (001 H, OOOH) register specified by the operand. The quotient is stored All other times: in the AW register. The remainder, if any, is stored in the DW +- temp % (mem16), AL +- temp -7- (mem16) DW register. When the quotient exceeds FFFFH (the capacity ofthe AW destination register) the vector 0 inter- Divides (using unsigned division) the contents of the DW rupt is generated, and the quotient and remainder and AW 16-bit register pair by the 16-bit memory con- become undefined. This most often occurs when the tents specified by the operand. The quotient is stored in divisor is O. The fractional quotient is rounded off. the AW register. The remainder, if any, is stored in the DW register. Bytes: 2 When the quotient exceeds FFFFH (the capacity of the Clocks: 25 AW destination register) the vector 0 interrupt is gener- Transfers: None ated and the quotient and remainder become undefined. This especially occurs when the divisor is O. The frac- Flag operation: tional quotient is rounded off. Bytes: 2/3/4 AC P CY U U U Clocks: 35, pPD70108 35, pPD701'16 odd addresses Example: 31, pPD70116 even addresses MOV DW,0348H MOV AW,2197H Transfers: 1 ;DW,AW = 03482197H Flag operation: MOV BW,2000H DIVU BW P CY ;AW = 1A41 H,DW = 0197H U U Example: MOV DW,O MOV AW,100 MOV [IX][BX],5 DIVU [IX][BX] ;AW = 0014H = 20,DW = 0 12-57 IlPD70 10S/70116 NEe DIV reg8 DIV mem8 Divide signed, 8-bit register Divide signed, 8-bit memory 7 o 7 o 1 1 o 1 1 o 1 1 0 1 1 o I I 1 1 1 1 1 reg mod 1 1 mem I I temp +-AW (disp-Iow) When temp -;- reg8 > 0 and temp -;- reg8 > 7FH or temp -;- reg8 > 0 and temp -;- reg8 > 0-7FH-1: I I (SP-1,SP-2) +- PSw, (disp-high) (SP-3,SP-4) +- PS, (SP-5,SP-6) +- PC, temp +-AW SP +- SP - 6, When temp -;- (mem8) > 0 and (mem8) > 7FH or IE +-0, temp -;- (mem8) < 0 and temp -;- (mem8) > 0-7FH-1: BRK +- 0, (SP-1,SP-2) +- PSw, PS +- (003H, 002H), (SP-3,SP-4) +- PS, PC +- (001 H, OOOH) (SP-5,SP-6) +- PC, All other times: SP +- SP - 6, AH +- temp % reg8, IE +-0, Al +- temp -;- reg8 BRK +- 0, PS +- (003H, 002H), Divides (using signed division) the contents of the AW PC +- (001 H, OOOH), 16-bit register by the contents of the 8-bit register spec- All other times: ified by the operand. The quotient is stored in the Al 8-bit AH +- temp % (mem8), Al +- temp -;- (mem8) register. The remainder, if any, is stored in the AH register. The maximum value of a positive quotient is +127 (7FH), Divides (using signed division) the contents of the AW and the minimum value of a negative quotient is 16-bit register by the contents of the 8-bit memory loca- -127 (81 H). tion specified by the operand. The quotient is stored in the 8-bit Al register, while the remainder, if any, is stored When a quotient is greater than either maximum value(s) in the AH register. The maximum value of a positive quo- the quotient and remainder become undefined, and the tient is +127 (7FH), and the minimum value of a negative vector 0 interrupt is generated. This especially occurs quotient is -127 (81 H). When a quotient is greater than when the divisor is O. A fractional quotient is rounded off. either maximum value(s), the quotient and remainder The remainder will have the same sign as the dividend. become undefined and the vector 0 interrupt is Bytes: 2 generated. Clocks: 29 to 34 (according to data) This especially occurs when the divisor is O. A fractional quotient is rounded off. The remainder will have the same Transfers: None sign as the dividend. Flag operation: Bytes: 2/3/4 Clocks: 35 to 40 (according to data) AC P CY u u u Transfers: 1 Flag operation: Example: MOV AW,-247 P CY MOV Cl,3 u u DIV Cl ;Al = -82,AH = -1 Example: MOV AW,1234 MOV [BW], -20 DIV [BW] ;Al = -61, AH = 14 12-58 t-{EC Section 12 Instruction Set DIV reg16 stored in the DW register. The maximum value of a pos- itive quotient is +32,767 (7FFFH) and the minimum value Divide signed, 16-bit register of a negative quotient is -32,767 (8001 H). When the 7 o quotient is greater than either maximum value(s), the 1 1 1 1 o 1 1 1 quotient and remainder become undefined, and the vec- tor 0 interrupt is generated. This especially occurs when the divisor is O. A fractional quotient is rounded off. The 1 1 1 1 1 reg remainder will have the same sign as the dividend. Bytes: 2 temp - DW,AW When temp ...;- reg16 > 0 and temp ...;- reg16 < 7FFFH or Clocks: 38 to 43 (according to the data) temp...;- reg16 < 0 and temp...;- reg16 > 0-7FFFH-1: Transfers: None (SP-1,SP-2) - PSW, (SP-3,SP-4) - PS, Flag operation: (SP-5,SP-6) - PC, SP - SP - 6, AC P CY IE-O, BRK-O, u u u PS - (003H, 002H), PC - (001 H, OOOH) Example: All other times: MOV DW,0123H DW - temp % reg16, AW - temp ...;- reg16 MOV AW,4567H MOV CW,1000H Divides (using signed division) the contents of the DW DIV CW and AW 16-bit register pair by the contents of the 16-bit ;AW = 1234H, DW = 0567H register specified by the operand. The quotient is stored in the AW 16-bit register, while the remainder, if any, is 12-59 pPD70108/70116 NEe DIVmem16 remainder, if any, is stored in the OW register. The max- imum value of a positive quotient is +32,767 (7FFFH), and Divide signed, 16-bit memory the minimum value of a negative quotient is -32,767 7 0 (8001 H). When ·the quotient is greater than either max- imum value(s), the quotient and remainder become unde- 1 1 1 1 0 1 1 1 fined and the vector 0 interrupt is generated. This I I I especially occurs when the divisor is O. A fractional quo- mod 1 1 1 mem tient is rounded off. The remainder will have the same sign as the dividend. I I (disp-Iow) Bytes: 2/3/4 I I Clocks: (disp-high) 48 to 53, pPD70108 48 to 53, pPD70116 odd addresses temp-DW,AW 44 to 49, pPD70116 even addresses When temp -:- (mem16) >0 and temp -:- (mem16) <7FFFH or temp -:- (mem16) < 0 and temp -:- (mem16) > Transfers: 1 0-7FFFH-1: Flag operation: (SP-1,SP-2) - PSW, (SP-3,SP-4) - PS, AC P CY (SP-5,SP-6) - PC, u u u SP-SP-6, IE-O, Example: BRK-O, MOV DW,O PS - (003H, 002H), MOV AW,-34 PC - (001 H, OOOH) MOV [IY], -2 All other times: DIV [IY] OW - temp % (mem16), AW - temp -:- (mem16) ;AW = 17, OW = 0 Divides (using signed division) the contents of the OW and the AW 16-bit register pair by the contents of the 16-bit memory location specified by the operand. The quotient is stored in the AW 16-bit register, while the 12-60 Section 12 ttlEC Instruction Set BCD ADJUST ADJ4A (no operand) ADJBA (no operand) Adjust Nibble Add Adjust byte add 7 o 7 o I o I 0 I 1 o o 1 1 1 I ~ I 0 I 1 1 o 1 1 1 When AL AND OFH < 9 or AC=1: AL-AL+6, Adjusts the result of unpacked decimal addition stored CY -CYORAC, in the AL register into a single unpacked decimal number. AC-1 The higher 4 bits become zero. When AL > 9FH or CY=1: When AL AND OFH > 9 or AC=1: AL-AL+60H, AL-AL+6, CY-1 AH-AH+1, Adjusts the result of packed decimal addition stored in AC-1, the AL register into a single packed decimal number. CY-AC, AL - AL AND OFH Bytes: 1 Bytes: 1 Clocks: 3 Clocks: 3 Transfers: None Transfers: None Flag operation: Flag operation: V s z AC P CY V s z AC P CY I X I X I X I X X X I U IU I U I X U X Example: ADJ4A Example: ADJBA 12-61 pPD70108/70116 NEe ADJBS (no operand) ADJ4S (no operand) Adjust byte subtract Adjust nibble subtract 7 o 7 o I0 I 0 I 1 I 1 1 1 1 1 1 1 1 1 When AL AND OFH > 9 or AC=1: When AL AND OFH > 9 or AC=1: AL-AL-6, AL-AL-6, AH-AH-1, CY-ACORCY, AC-1, AC-1, CY-AC, When AL> 9FH or CY=1: AL - AL AND OFH AL-AL- 60H, CY-1 Adjust the result of unpacked decimal subtraction stored in the AL register into a single unpacked decimal number. Adjusts the result of packed decimal subtraction stored The higher 4 bits become zero. in the AL register into a single packed decimal number. Bytes: 1 Bytes: 1 Clocks: 7 Clocks: 7 Transfers: None Transfers: None Flag operation: Flag operation: V S z AC P CY V S z AC P CY I U U U X U X U X X X X X I I I I I I I Example: ADJBS Example: ADJ4S 12-62 NEe Section 12 Instruction Set DATA CONVERSION CVTOB (no operand) CVTBO (no operand) Convert decimal to binary Convert binary to decimal 7 0 7 0 1 1 0 1 0 1 0 1 1 1 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 AL - AH X OAH + AL AH-O AH -AL+OAH AL - AL ... 0/0 OAH Converts a two-digit unpacked decimal number in the AH and AL registers into a single 16-bit binary number. Converts the binary 8-bit value in the AL register into a The value in the AH is multiplied by 10. The product is two-digit unpacked decimal number. added to the contents of the AL register and the result The quotient of AL divided by 10 is stored in the AH is stored in AL. AH becomes O. register. The remainder of this operation is stored in the Bytes: 2 AL register. Clocks: 7 Bytes: 2 Transfers: None Clocks: 15 Flag operation: Transfers: None Flag operation: p CY x u p CY x u Example: CVTOB Example: CVTBO 12-63 pPD7010S/70116 t-IEC CVTBW (no operand) CVTWL (no oPEtrand) Convert byte to word Convert word to long word 7 o 7 o I 1 I 0 o 1 1 o o o I 1 I 0 o 1 1 o o When AL < BOH: When AW < BOOOH: AH-O OW-O All other times All other times: AH - FFH OW - FFFFH Expands the sign of the byte in the AL register to the AH Expands the sign of the word in the AW register to the register. Use this instruction to produce a double-length OW register. Use this instruction to produce a double- (word) dividend from a byte before a byte division is length (double-word) dividend from a word before a word performed. . division is performed. Bytes: 1 Bytes: 1 Clocks: 2 Clocks: 4 or 5 (according to data) Transfers: None Transfers: None Flag operation: None Flag operation: None Example: CVTBW Example: CVTWL 12-64 NEe Section 12 Instruction Set COMPARISON CMP mem,reg CMP reg,reg Compare memory and register Compare register and register 7 0 7 o 0 0 1 1 1 0 0 W o o 1 1 1 o 1 W I I mod reg mem 1 reg reg I I (disp-Iow) reg - reg I I (disp-high) Subtracts the contents of the 8- or 16-bit register spec- ified by the second operand from the contents of the 8- or 16-bit register specified by the first operand. The result (mem) - reg is not stored and only the flags are affected. Subtracts the contents of the 8- or 16-bit register spec- Bytes: 2 ified by the second operand from the 8- or 16-bit memory contents addressed by the first operand. The result is not Clocks: 2 stored and only the flags are affected. Transfers: None Bytes: 2/3/4 Flag operation: Clocks: When W=O: 11 AC P CY When W=1: 15, pPD70108 x x x 15, pPD70116 odd addresses 11, pPD70116 even addresses Example: Transfers: 1 CMP AW,BW Flag operation: CMP CH,DL AC P CY x x x Example: CMP WORD_VAR,IX CMP BYTE_VAR,CL CMP [BW],AH 12-65 pPD7010S/70116 ttlEC CMP reg,mem CMPreg,imm Compare register and memory Compare register and immediate data 7 0 7 o 0 0 1 1 1 0 1 W 1 0 0 0 0 0 S W I I I mod reg mem 1 1 1 1 1 reg I I I I I (disp-Iow) imm8 or imm16-low I I I I (disp-high) imm16-high Subtracts the 8- or 16-bit memory contents addressed reg - imm by the second operand from the contents of the 8- or Subtracts the 8- or 16-bit immediate data specified by 16-bit register specified by the first operand. The result the second operand from the contents of the 8- or 16-bit is not stored and only the flags are affected. register specified by the first operand. The result is not reg - (mem) stored and only the flags are affected. Bytes: 2/3/4 Bytes: 3/4 Clocks: Clocks: 4 When W=O: 11 Transfers: None When W=1: 15, pPD70108 15, pPD70116 odd addresses Flag operation: 11, pPD70116 even addresses Transfers: 1 AC P CY Flag operation: x x x AC P CY Example: CMP BL,5 x x x CMP DW,1200H Example: CMP AW,[IX] CMP CH,BYTE_VAR 12-66 NEe Section 12 Instruction Set CMP mem,imm CMP acc,imm Compare memory and immediate data Compare accumulator and immediate data 7 o 7 o o o o o o S W o o 1 1 1 1 o W I I I I I mod 1 1 mem imm8 or imm16-low I I I I (disp-Iow) imm16-high I I When W=O: AL - imm8 (disp-high) When W=1: AW - imm16 I I I imm8 or imm16-low Subtracts the 8- or 16-bit immediate data specified by the second operand from the accumulator (AL or AW) I I specified by thefirst operand. The result is not stored and imm16-high only the flags are affected. (mem) - imm Bytes: 2/3 Subtracts the 8- or 16-bit immediate data specified by Clocks: 4 the second operand from the 8- or 16-bit memory con- Transfers: None tents addressed by the first operand. The result is not stored and only the flags are affected. Flag operation: Bytes: 3/4/5/6 AC P CY Clocks: x x x When W=O: 13 When W=1: 17, JlPD70108 Example: 17, JlPD70116 odd addresses 13, JlPD70116 even addresses CMP AL,O CMP AW,800H Transfers: 1 Flag operation: AC P CY x x x Example: CMP BYTE PTR [BW],3 CMP WORD_VAR,7000H 12-67 pPD7010S/70116 NEe COMPLEMENT OPERATION NOTmem NOT reg Not memory Not register 7 o 7 o 1 1 1 o 1 W 1 1 1 1 o 1 1 W t t t mod o 1 o mem 1 1 o 1 o reg t t (disp-Iow) reg +- reg t t (disp-high) Inverts (by performing a 1's complement) each bit of the 8- or 16-bit register specified by the operand and stores the result in the specified register. (mem) +- (mem) Bytes: 2 Inverts (by performing a 1's complement) each bit of the 8- or 16-bit memory location addressed by the operand Clocks: 2 and stores the result in the addressed memory location. Transfers: None Bytes: 2/3/4 Flag operation: None Clocks: Example: When W=O: 16 NOT BW When W=1: 24, pPD70108 NOT CL 24, pPD70116 odd addresses 16, pPD70116 even addresses Transfers: 2 Flag operation: None Example: NOT WORD_VAR[IX][2] NOT BYTE PTR [IY] 12-68 Section 12 t\'EC Instruction Set NEG reg NEG mem Negate register Negate memory 7 o 7 o 1 1 1 o 1 1 W 1 1 1 1 0 1 1 W I I 1 o 1 1 reg mod 0 1 mem reg +- reg + 1 I I (disp-Iow) Takes the 2's complement of the contents of the 8- or I I 16-bit register specified by the operand. (disp-high) Bytes: 2 (mem) +- (mem) + 1 Clocks: 2 Takes the 2's complement of the 8- or 16-bit memory Transfers: None contents addressed by the operand. Flag operation: Bytes: 2/3/4 Clocks: When W=O: 16 When W=1: 24, pPD70108 24, pPD70116 odd addresses Note: * = 0 if the contents of the operand register is O. 16, pPD70116 even addresses Example: Transfers: 2 NEG BL Flag operation: NEG AW Note: * = 0 if the contents of the memory operand is O. Example: NEG WORD_VAR NEG BYTE PTR [BW][IX] 12-69 pPD7010S/70116 NEe LOGICAL OPERATION TEST mem,reg or TEST reg,mem TEST reg,reg Test register and memory Test register and register 7 o 7 o 1 o o o o 1 o W 1 o o o o 1 o W I I mod reg mem 1 1 reg reg I I (disp-Iow) reg AND reg I I (disp-high) ANDs the contents of the 8- or 16-bit register specified by the first operand and the 8- or 16-bit register specified by the second operand. The result is not stored and only (mem) AND reg the flags are affected. ANDs the contents of the 8- or 16-bit second operand Bytes: 2 and the contents of the 8- or 16-bit first operand. Clocks: 2 The result is not stored and only the flags are affected. Transfers: None Bytes: 2/3/4 Flag operation: Clocks: When W=O: 10 When W=1: 14, pPD70108 P CY 14,pPD70116 odd addresses x o 10, pPD70116 even addresses Transfers: 1 Example: TEST AW,CW Flag operation: TEST CL,AH AC P CY u x o Example: TEST BYTE_VAR,DL TEST AH, [IX] 12-70 NEe Section 12 Instruction Set TEST reg,imm TEST mem,imm Test immediate data and register Test immediate data and memory 7 o 7 o 1 1 o 1 1 W 1 1 1 o 1 W I I 1 1 o o o reg mod o o o mem I I I I I imm8 or imm16-low (disp-Iow) I I I I imm16-high (disp-high) reg AND imm I I I imm8 or imm16-low ANDs the contents of the 8- or 16-bit register specified I I by the first operand and the 8- or 16-bit immediate data imm16-high specified by the second operand. The result is not stored and only the flags are affected. (mem) AND imm Bytes: 3/4 ANDs the 8- or 16-bit memory contents addressed by the Clocks: 4 first operand and the 8- or 16-bit immediate data spec- ified by the second operand. The result is not stored and Transfers: None only the flags are affected. Flag operation: . Bytes: 3/4/5/6 Clocks: AC P CY When W=O: 11 u x o When W=1: 15, pPD70108 15, pPD70116 odd addresses Example: 11, pPD70116 even addresses TEST CW,1 Transfers: 1 TEST AL,50H Flag operation: AC P CY u x o Example: TEST BYTE PTR [BW],80H TEST WORD_VAR,OOFFH 12-71 JlPD7010S/70116 tttfEC TEST acc,imm AND reg,reg Test immediate data and accumulator AND register with register to register 7 o 7 o 1 o 1 o 1 o o W o o 1 o o o W I I I imm8 or imm16-low 1 1 reg reg I I imm16-high reg +- reg AND reg ANDs the contents of the 8- or 16-bit register specified When W=O: AL AND imm8 by the first operand and the contents of the 8- or 16-bit When W=1: AW AND imm16 register specified by the second operand. Stores the result in the register specified by the first operand. ANDs the contents of the accumulator (AL or AW) spec- ified by the first operand and the 8- or 16-bit immediate Bytes: 2 data specified by the second operand. The result is not Clocks: 2 stored and only the flags are affected. Transfers: None Bytes: 2/3 Flag operation: Clocks: 4 Transfers: None Flag operation: AC p CY Example: AND IX,AW u x o Example: TEST AL,12H TEST AW,8000H 12-72 Section 12 ttlEC Instruction Set AND mem,reg AND reg,mem AND memory with register to memory AND register with memory to register 7 0 7 0 0 0 1 0 0 0 0 W 0 0 1 0 0 0 1 W I I I I I mod reg mem mod reg mem . I I I I (dlsp-Iow) (disp-Iow) I I I I (disp-high) (disp-high) (mem) - (mem) AND reg reg - reg AND (mem) ANDs the 8- or 16-bit memory contents addressed by the ANDs the contents of the 8- or 16-bit register specified first operand and the contents of the 8- or 16-bit register by the first operand and the 8- or 16-bit memory contents specified by the second operand. Stores the result in the addressed by the second operand. Stores the result in memory location addressed by the first operand. the register specified by the first operand. Bytes: 2/3/4 Bytes: 2/3/4 Clocks: Clocks: When W=O: 16 When W=O: 11 When W=1: 24,pPD70108 When W=1: 15,pPD70108 24, pPD70116 odd addresses 15, pPD70116 odd addresses 16, pPD70116 even addresses 11, pPD70116 even addresses Transfers: 2 Transfers: 1 Flag operation: Flag operation: AC P CY P CY u x o x o Example: Example: AND [BW][IX]3,AL AND CL,BYTE_VAR AND WORD_VAR,CW AND DW,[IY] 12-73 pPD70108/70116 t-{EC AND reg,imm ANDmem,imm AND register with immediate data to register AND memory with immediate data to memory 7 o 7 0 1 0 0 0 0 0 0 W 1 0 0 0 0 0 0 W I I I 1 1 1 0 0 reg mod 1 0 0 mem I I I I I imm8 or imm16-low (disp-Iow) I I I I imm16-high (disp-high) I I I reg - reg AND imm imm8 or imm16-low ANDs the contents of the 8- or 16-bit register specified I I by the first operand and the 8- or 16-bit immediate data imm16-high specified by the second operand. Stores the result in the register specified by the first operand. (mem) - (mem) AND imm Bytes: 3/4 ANDs the 8- or 16-bit memory contents addressed by the Clocks: 4 first operand and the 8- or 16-bit immediate data spec- ified by the second operand. Stores the result in the Transfers: None memory location addressed by the first operand. Flag operation: Bytes: 3/4/5/6 Clocks: AC P CY When W=O: 18 u x 0 When W=1: 26, pPD701 08 26, pPD70116 odd addresses Example: 18, pPD70116 even addresses AND CL,OFEH Transfers: 2 AND DW,14H Flag operation: AC P CY u x o Example: AND BYTE PTR [1Y],30H AND [IY],3000H 12-74 NEe Section 12 Instruction Set AND acc,imm OR reg,reg AND accumulator with immediate data to accumulator OR register and register to register o 7 o o 1 o o 1 o W o o o o o 1 W I I I imm8 or imm16-low 1 1 reg reg I I imm16-high reg +- reg OR reg ORs the contents of the 8- or 16-bit register specified by When W=O: AL +- AL AND imm8 the first operand and the contents of the 8- or 16-bit When W=1: AW +- AW AND imm16 register specified by the second operand. Stores the result in the register specified by the first operand. ANDs the contents of the accumulator (AL or AW) spec- ified by the first operand and the 8- or 16-bit immediate Bytes: 2 data specified by the second operand. Stores the result Clocks: 2 in the accumulator specified by the first operand. Transfers: None Bytes: 2/3 Flag operation: Clocks: 4 Transfers: None AC p CY Flag operation: u x o AC p CY Example: u x o OR AL,AH OR BW,CW Example: AND AL,80H AND AW,OFH 12-75 JlPD7010S/70116 ttlEC OR mem,reg OR reg,mem OR memory and register to memory OR register and memory to register 7 0 7 0 0 0 0 0 1 0 0 W 0 0 0 0 1 0 1 W I I I I I mod reg mem mod reg mem I I I I (disp-Iow) (disp-Iow) I I I I (disp-high) (disp-high) (mem) - (mem) OR reg reg - reg OR (mem) ORs the 8- or 16-bit memory contents addressed by the ORs the contents of the 8- or 16-bit register specified by first operand and the contents ofthe 8- or 16-bit register the first operand and the 8- or 16-bit memory contents specified by the second operand. Stores the result in the addressed by the second operand. Stores the result in memory location addressed by the first operand. the register specified by the first operand. Bytes: 2/3/4 Bytes: 2/3/4 Clocks: Clocks: When W=O: 16 When W=O: 11 When W=1: 24, pPD70108 When W=1: 15, pPD70108 24, pPD70116 odd addresses 15, pPD70116 odd addresses 16, pPD70116 even addresses 11, pPQ70116 even addresses Transfers: 2 Transfers: 1 Flag operation: Flag operation: AC P CY AC P CY u x o u x o Example: Example OR BYTE_VAR,CL OR CL,[IX) OR WORD_VAR [BP),AW OR CW,WORD_VAR 12-76 NEe Section 12 Instruction Set OR reg,imm ORmem,imm OR register with immediate data to register OR memory with immediate data to memory 7 o 7 0 1 0 0 0 0 0 0 W 1 0 0 0 0 0 0 W I I 1 1 0 0 1 reg mod 0 0 1 mem I I I I I imm8 or imm16-low (disp-Iow) I I I I imm16-high (disp-high) I I I reg - reg OR imm imm8 or imm16-low ORs the contents of the 8- or 16-bit register specified by , I I the first operand and the 8- or 16-bit immediate data imm16-high specified by the second operand. Stores the result in the register specified by the first operand. (mem) - (mem) OR imm Bytes: 3/4 ORs the 8- or 16-bit memory contents addressed by the Clocks: 4 first operand and the 8- or 16-bit immediate data spec- ified by the second operand. Stores the result in the Transfers: None memory location addressed by the first operand. Flag operation: Bytes: 3/4/5/6 Clocks: AC P CY When W=O: 18 u x o When W=1: 26, pPD70108 26, pPD70116 odd addresses Example: 18, pPD70116 even addresses OR CL,80H Transfers: 2 OR AW,OFH Flag operation: V S z AC P CY I 0 I X I X U I X 0 Example: OR BYTE_VAR,2 OR WORD PTR [IX),OFH 12-77 pPD70108/70116 NEe OR acc,imm XOR reg,reg OR accumulator with immediate data to accumulator Exclusive OR, register and register to register 7 o 7 o o o o o 1 1 o W o o 1 1 o o 1 W I I I imm8 or imm16-low 1 1 reg reg I I imm16-high reg - reg XOR reg XORs the contents of the 8- or 16-bit register specified When W=O: AL - AL OR imm8 by the first operand and the 8- or 16-bit register specified When W=1: AW - AW OR imm16 by the second operand. Stores the result in the register specified by the first operand. ORs the contents ofthe accumulator (AL or AW) specified by the first operand and the 8- or 16-bit immediate data Bytes: 2 specified by the second operand. Stores the result in the Clocks: 2 accumulator specified by the first operand. Transfers: None Bytes: 2/3 Flag operation: Clocks: 4 Transfers: None AC p CY Flag operation: u x o AC p CY Example: u x o XOR AL,AH XOR CW,BW Example: OR AL,34H OR AW,1 12-78 NEe Section 12 Instruction Set XOR mem,reg XOR reg,mem Exclusive OR, memory and register to memory Exclusive OR, register and memory to register 7 0 7 0 0 0 1 1 0 0 0 W 0 0 1 1 0 0 1 W I I I I mod reg mem mod reg mem I I I I (disp-Iow) (disp-Iow) I I I I (disp-high) (disp-high) (mem) - (mem) XOR reg reg - reg XOR (mem) XORs the 8- or 16-bit memory contents addressed by the XORs the contents of the 8- or 16-bit register specified first operand and the contents of the 8- or 16-bit register by the first operand and the 8- or 16-bit memory contents specified by the second operand. Stores the result in the addressed by the second operand. Stores the result in memory location addressed by the first operand. the register specified by the first operand. Bytes: 2/3/4 Bytes: 2/3/4 Clocks: Clocks: When W=O: 16 When W=O: 11 When W=1: 24, pPD70108 When W=1: 15, pPD70108 24, pPD70116 odd addresses 15, pPD70116 odd addresses 16,pPD70116 even addresses 11,pPD70116 even addresses Transfers: 2 Transfers: 1 Flag operation: Flag operation: AC P CY AC P CY u x o u x o Example Example XOR [BW],CL XOR BH,[IX] XOR WORD_VAR,BP XOR AW,WORD_VAR 12-79 pPD70108/70116 NEe XOR reg,lmm Exclusive OR, memory with immediate data to memory Exclusive OR, register with immediate data to register 7 o 7 o 1 0 o o o o 0 W 1 o o o o o o W I I I mod 1 1 o mem 1 1 1 1 o reg I I I imm8 or imm16-low I I I imm8 or imm16-low I I imm16-high I I imm16-high I I reg - reg XOR imm (disp-Iow) XORs the contents of the 8- or 16-bit register specified I I by the first operand and the 8- or 16-bit immediate data (disp-high) specified by the second operand. Stores the result in the register specified by the first operand. (mem) - (mem) XOR imm Bytes: 3/4 XORs the 8- or 16-bit memory contents addressed by the first operand and the 8- or 16-bit immediate data spec- Clocks: 4 ified by the second operand. Stores the result in the Transfers: None memory location addressed by the first operand. Flag operation: Bytes: 3/4/5/6 Clocks: When W=O: 18 When W=1: 26, pPD70108 26, pPD70116 odd addresses 18, pPD70116 even addresses Example XOR CL,2 Transfers: 2 XOR IX,OFFOOH Flag operation: XORmem,imm AC P CY u x o Example: XOR BYTE PTR [1y],OFH XOR WORD_VAR,OFH 12-80 NEe Section 12 Instruction Set XORacc,imm BIT MANIPULATION Exclusive OR, accumulator with immediate data to TEST1 reg8,CL accumulator Test bit CL of the S-bit register 7 o 7 0 o o 1 1 o 1 o W 0 0 0 0 1 1 1 1 I I I immS or imm16-low 0 0 0 1 0 0 0 0 I I imm16-high 1 1 0 0 0 reg XORs the contents of the accumulator (AL or AW) spec- When bit CL of regS=O: Z-1 ified by the first operand and the S- or 16-bit immediate When bit CL of regS=1: Z-O data specified by the second operand. Stores the result in the accumulator specified by the first operand. Sets the Z flag to 1 when bit CL of the S-bit register (specified by the first operand) is O. Resets the Z flag to When W=O: AL - AL XOR immS When W=1: AW - AW XOR imm16 o when bit CL is 1. Only the lower 3 bits of CL are used to address the bit. Bytes: 2/3 Bytes: 3 Clocks: 4 Clocks: 3 Transfers: None Transfers: 1 Flag operation: Flag operation: AC p CY p CY u x o u o Example: Example: TEST1 AL,CL XOR AL,OFFH XOR AW,SOOOH 12-S1 pPD70108/70116 NEe TEST1 mem8,CL TEST1 reg16,CL Test bit CL of the 8-bit memory Test bit CL of the 16-bit register 7 o 7 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 0 o o o 0 0 0 1 0 0 0 1 I I mod 0 0 0 mem 1 1 0 0 0 reg I I (disp-Iow) When bit CL of reg16 = 0: Z+-1 When bit CL of reg16 = 1: Z+-O I I (disp-high) Sets the Z flag to 1 when bit CL of the 16-bit register (specified by the first operand) is O. Resets the Z flag to When bit CL of (mem8) = 0: Z +- 1 o when the bit is 1. Only the lower 4 bits of CL are used to address a bit. When bit CL of (mem8) = 1: Z +- 0 Sets the Z flag to 1 when bit CL of the 8-bit memory Bytes: 3 (addressed by the first operand) is O. Resets the Z flag Clocks: 3 to 0 when the CL bit is 1. Only the lower 3 bits of CL are Transfers: 1 used to address the bit. Flag operation: Bytes: 3/4/5 Clocks: 12 P CY Transfers: 1 u o Flag operation. - Example: TEST1 AW,CL Efl ~ ~ A~ ! : ~y Ii I i Example: TEST1 BYTE PTR [BW],CL 12-82 ttlEC Section 12 Instruction Set TEST1 mem16,CL TEST1 regS, imm3 Test bit CL of the 16-bit memory Test bit imm3 of the 8-bit register 7 0 7 0 0 0 0 0 1 1 1 0 0 0 0 1 1 0 0 0 1 0 0 0 ~ 0 0 0 0 0 0 I I mod 0 0 0 mem 1 0 0 0 reg I I I (disp-Iow) imm3 I I (disp-high) When bit imm3 of reg8 = 0: Z +- 1 When bit imm3 of reg8 = 1: Z +- 0 When bit CL of (mem16) = 0: Z +- 1 Sets the Z flag to 1 when bit imm3 of the 8-bit register When bit CL of (mem16) = 1: Z +- 0 (specified by the first operand) is O. Resets the Z flag to The first operand specifies the 16-bit memory location o when the bit is 1. Only the lower 3 bits of the immediate data are used to identify a bit. and the second operand (CL) specifies the bit position. When the bit specified by CL is 0, the Z flag is set to 1. Bytes: 4 When that bit is 1, the Z flag is reset to O. Only the lower Clocks: 4 4 bits of CL are used to address a bit. Transfers: None Bytes: 3/4/5 Flag operation: Clocks: 16, pPD70108 16, pPD70116 odd addresses P CY 12, pPD70116 even addresses u o Transfers: 1 Example: TEST1 BH,1 Flag operation: P CY u o Example: TEST1 WORD PTR [BW],CL 12-83 pPD70108/70116 NEe TEST1 mem8,imm3 TEST1 reg16, imm4 Test bit imm3 of the a-bit memory Test bit imm4 of the 16-bit register 7 o 7 0 o 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 o o o 1 1 o o o 0 0 0 1 1 0 0 1 I I mod o o o mem 1 1 0 0 0 reg I (disJ-IOW) I imm4 I I (disp-high) When bit imm4 of reg16 = 0: Z-1 When bit imm4 of reg16 = 1: Z- 0 . I Imm3 The first operand specifies the 16-bit register and the second operand (imm4) specifies the bit position. When the bit specified by imm4 is 0, the Z flag is set to 1. When When bit imm3 of (mem8) = 0: Z- 1 When bit imm3 of (mem8) = 1: Z- 0 that bit is 1, the Z flag is reset to O. Only the lower 4 bits of the immediate data are used to address a bit. The first operand specifies the 8-bit memory location and the second operand (imm3) specifies the bit position. Bytes: 4 When the bit specified by imm3 is 0, the Z flag is set to Clocks: 4 1. When that bit is 1, the Z flag is reset to O. Only the lower 3 bits of the immediate data are used to address a bit. Transfers: None Flag operation: Bytes: 4/5/6 - . -- V S Z AC P CY Clocks: 13 Transfers: 1 I 0 I u I X I U U 0 I Flag operation: Example: TEST1 AW,15 p CY u o Example: TEST1 12-84 ttlEC Section 12 Instruction Set TEST1 mem16,imm4 Non reg8,CL Test bit imm4 of the 16-bit memory Not bit CL of the 8-bit register 7 0 7 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 0 0 1 0 0 0 1 0 1 1 0 I I I mod 0 0 0 mem 1 1 0 0 0 reg I I (disp-Iow) Bit CL of reg8 - bit CL of reg8 The CL register (second operand) specifies which bit of When bit imm4 of (mem16) = 0: Z- 1 the 8-bit register (specified by the first operand) is to be When bit imm4 of (mem16) = 1: Z- 0 inverted. Only the lower 3 bits ofthe CL register are used. The first operand specifies the 16-bit memory and the Bytes: 3 second operand (imm4) specifies the bit position. When the bit specified by imm4 is 0, the Z flag is set to 1. When Clocks: 4 that bit is 1, the Z flag is reset to O. The immediate data Transfers: None in the last byte of the instruction is valid only for the lower 4 bits. Flag operation: None Bytes: 4/5/6 Example: NOn BH,CL Clocks: 17, J.lPD701 08 17, J.lPD70116 odd addresses 13, J.lPD70116 even addresses Transfers: 1 Flag operation: P CY u o Example: TEST1 WORD PTR [BP],8 12-85 pPD70108/70116 NEe NOT1 mem8,CL NOT1 reg16, CL Not bit CL of the 8-bit memory Not bit CL of the 16-bit register 7 o 7 0 o 0 001 1 1 1 0 0 0 0 1 1 1 1 o o o 1 o 1 1 o 0 0 0 1 0 1 1 1 I I I mod o o o mem 1 1 0 0 0 reg I I Bit CL of reg16 - bit CL of reg16 (disp-Iow) The CL register (second operand) specifies which bit of . I I (disp-high) the 16-bit register (specified by the first operand) is to be inverted. Only the lower 4 bits of the CL register are used. Bit CL of (mem8) - bit CL of (mem8) The CL register (second operand) specifies which bit of Bytes: 3 the 8-bit memory location (specified by the first operand) Clocks: 4 is to be inverted. Only the lower 3 bits of the CL register are used. Transfers: None Bytes: 3/4/5 Flag operation: None Example: NOT1 AW,CL Clocks: 18 Transfers: 2 Flag operation: None Example: NOn BYTE_VAR,CL 12-86 NEe Section 12 Instruction Set NOT1 mem16,CL NOT1 reg8,imm3 Not bit CL of the 16-bit memory Not bit imm3 of the 8-bit register 7 0 7 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 0 0 0 1 1 1 1 0 I I I mod 0 0 0 mem 1 1 0 0 0 reg I I I (disp-Iow) imm3 I I Bit imm3 of reg8 - bit imm3 of reg8 (disp-high) Bit imm3 (second operand) specifies which bit of the 8-bit Bit CL of (mem16) - bit CL of (mem16) register (specified by the first operand) is to be inverted. Only the lower 3 bits of the immediate data at the fourth The CL register (second operand) specifies which bit of byte of the instruction are used. the 16-bit memory location (addressed by the first oper- and) is to be inverted. Only the lower 4 bits of the CL Bytes: 4 register are used. Clocks: 5 Bytes: 3/4/5 Transfers: None Clocks: Flag operation: None 26, pPD70108 26,pPD70116 odd addresses Example: NOT1 AH,3 18,pPD70116 even addresses Transfers: 2 Flag operation: None Example: NOT1 WORD_VAR,CL 12-87 pPD70108/70116 NEe NOT1 mem8,imm3 NOT1 reg16,imm4 Not bit imm3 of 8-bit memory Not bit imm4 of the 16-bit register 7 0 7 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 I I mod 0 0 0 mem 1 0 0 0 reg I I I (disp-Iow) imm4 I I (disp-high) Bit imm4 of reg16 - bit imm4 of reg16 Bit imm4 (second operand) specifies which bit of the I imm3 16-bit register (specified by the first operand) is to be inverted. Only the lower 4 bits of the immediate data are Bit imm3 of mem8 - bit imm3 of mem8 used in the fourth byte of the instruction. Bit imm3 (second operand) specifies which bit ofthe 8-bit Bytes: 4 memory location (addressed by the first operand) is to Clocks: 5 be inverted. Only the lower 3 bits of the immediate data are used in the last byte of the instruction. Transfers: None Bytes: 4/5/6 Flag operation: None Clocks: 19 Example: NOT1 BW.15 Transfers: 2 Flag operation: None Example: NOT1 BYTE PTR [BW][IX]34H,4 12-88 t\'EC Section 12 Instruction Set NOT1 mem16,imm4 NOT1 CY Not bit imm4 of the 16-bit memory Not carry flag 7 o 7 o I o 0 0 0 1 1 1 1 I1 1 1 1 o 1 o 1 o o o 1 1 1 1 1 CY-Cy Inverts the CY flag. I I I mod o o o mem Bytes: 1 I I Clocks: 2 (disp-Iow) Transfers: None Bit imm4 of (mem16) - bit imm4 of (mem16) Flag operation: The bit imm4 (second operand) specifies which bit of the 16-bit memory location (addressed by the first operand) V s z AC P CY is to be inverted. Only the lower 4 bits of the immediate I U I U I U I U u x data are used in the last byte of the instruction. Bytes: 4/5/6 Example: NOT1 CY Clocks: 27, J.lPD70108 27, J.lPD70116 odd addresses 19, J.lPD70116 even addresses Transfers: 2 Flag operation: None Example: NOn WORD_VAR,O 12-89 pPD7010S/70116 NEe CLR1 reg8,CL CLR1 mem8,CL Clear bit CL of the 8-bit register Clear bit CL of the 8-bit memory 7 0 7 o 0 0 0 0 1 1 1 1 o 0 0 0 1 1 1 1 0 0 0 1 0 0 1 0 o o o 1 o o 1 o I I 1 1 0 0 0 reg mod o o o mem Bit CL of reg8 +- 0 I I (disp-Iow) Clears the bit specified by CL of the 8-bit register (spec- I I ified by the first operand) to O. Only the lower three bits (disp-high) of CL are used. Bytes: 3 Bit CL of (mem8) +- 0 Clocks: 5 Clears the bit specified by CL of the 8-bit memory loca- tion (addressed by the first operand) to O. Only the lower Transfers: None three bits of CL are used. Flag operation: None Bytes: 3/4/5 Example: CLR1 AL,CL Clocks: 14 Transfers: 2 Flag operation: None Example: CLR1 BYTE_VAR,CL 12-90 NEe Section 12 Instruction Set CLR1 reg16,CL CLR1 mem16,CL Clear bit CL of the 16-bit register Clear bit CL of the 16-bit memory 7 0 7 o 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 i 0 0 0 1 0 0 1 1 0 0 0 1 0 o 1 1 i i i 1 1 0 0 0 reg mod 0 0 0 mem i i Bit CL of reg16 - 0 (disp-Iow) Clears the bit specified by CL of the 16-bit register (spec- i i ified by the first operand) to O. Only the lower four bits (disp-high) of CL are used. Bytes: 3 Bit CL of (mem16) - 0 Clocks: 5 Clears the bit specified by CL of the 16-bit memory loca- tion (addressed by the first operand) to O. Only the lower Transfers: None 4 bits of CL are used. Flag operation: None Bytes: 3/4/5 Example: CLR1 AW,CL Clocks: 22, pPD70108 22, pPD70116 odd addresses 14, pPD70116 even addresses Transfers: 2 Flag operation: None Example: CLR1 WORD_VAR,CL 12-91 pPD7010S/70116 t\'EC CLR1 reg8,imm3 CLR1 mem8,imm3 Clear bit imm3 of the 8-bit register Clear bit imm3 of the 8-bit memory 7 0 7 o 0 0 0 0 1 1 1 1 I 0 0 0 0 1 1 1 1 0 0 0 1 1 0 1 0 I 0 0 0 1 1 o 1 o I I 1 1 0 0 0 reg I mod 0 0 0 mem I I I imm3 I (disp-Iow) I I Bit imm3 of reg8 - 0 (disp-high) Clears the bit specified by the 3-bit immediate data I (second operand) of the 8-bit register (specified by the imm3 first operand) to O. Only the lower 3 bits of the immediate data are used in the fourth byte of the instruction. Bit imm3 of (mem8) - 0 Bytes: 4 Clears the bit specified by the 3-bit immediate data Clocks: 6 (second operand) of the 8-bit memory location (addressed by the first operand) to O. Only the lower 3 Transfers: None bits of immediate data are used in the last byte of the Flag operation: None instruction. Example: CLR1 BH,1 Bytes: 4/5/6 Clocks: 15 Transfers: 2 Flag operation: None Example: CLR1 BYTE_VAR[BW],6 12-92 NEe Section 12 Instruction Set CLR1 reg16,imm4 CLR1 mem16,imm4 Clear bit imm4 of the 16-bit register Clear bit imm4 of the 16-bit memory 7 0 7 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1 I I I 1 1 0 0 0 reg mod 0 0 0 mem I I imm4 imm4 I I Bit imm4 of reg16 - 0 (disp-high) Clears the bit specified by the 4-bit immediate data I (second operand) of the 16-bit register (specified by the imm4 first operand) to O. Only the lower 4 bits of the immediate data are used in the fourth byte of the instruction. Bit imm4 of (mem16) - 0 Bytes: 4 Clears the bit specified by the 4-bit immediate data Clocks: 6 (second operand) of the 16-bit memory location (addressed by the first operand) to O. Only the lower 4 Transfers: None bits of immediate data are used in the last byte of the Flag operation: None instruction. Example: CLR1 CW,5 Bytes; 4/5/6 , Clocks: 23, J.lPD70108 23, J.lPD70116 odd addresses 15, J.lPD70116 even addresses Transfers: 2 Flag operation: None Example: CLR1 WORD PTR [BP],O 12-93 pPD70108/70116 NEe CLR1 CY CLR1DIR Clear carry flag Clear direction flag 7 0 7 0 I I I1 1 1 1 1 0 0 0 I 1 1 1 1 1 0 0 CY-O DIR-O Clears the CY flag. Clears the DIR flag. Sets index registers IX and IY to Bytes: 1 autoincrement when MOVBK, CMPBK, CMPM, LDM STM, INM, and OUTM are executed. Clocks: 2 Bytes: 1 Transfers: None Clocks: 2 Flag operation: Transfers: None V S z AC P CY Flag operation: I DbR I U U U U U 0 I I I I pIe: CLR1 DIR Exam Example: CLR1 CY 12-94 t-{EC Section 12 Instruction Set SET1 reg8,CL SET1 mem8,CL Set bit CL of the 8-bit register 7 0 7 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 I I mod 0 0 0 mem 1 1 0 0 0 reg Bit CL of (mem8) - 1 Bit CL of reg8 - 1 Sets the bit specified by CL of the 8-bit memory location (addressed by the first operand) to 1. Only the lower three Sets the bit specified by CL of the a-bit register (specified bits of CL are used. by the first operand) to 1. Only the lower three bits of CL are used. Bytes: 3/4/5 Bytes: 3 Clocks: 13 Clocks: 4 Transfers: 2 Transfers: None Flag operation: None Flag operation: None Example: SET1 BYTE PTR [BW],CL Example: SET1 BL,CL Set bit CL of the a-bit memory 12-95 pPD70108/70116 NEe SET1 reg16,CL SET1 mem16,CL Set bit CL of the 16-bit register Set bit CL of the 16-bit memory 7 0 7 o 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 0 1 0 1 0 0 0 1 0 1 o 1 I I 1 1 0 0 0 reg mod 0 0 0 mem I I I Bit CL of reg16 - 1 (disp-Iow) Sets the bit specified by CL of the 16-bit register (spec- I I ified by the first operand) to 1. Only the lower four bits (disp-high) of CL are used. Bytes: 3 Bit CL of (mem16) - 1 Clocks: 4 Sets the bit specified by CL of the 16-bit memory location (addressed by the first operand) to 1. Only the lower 4 Transfers: None bits of CL are used. Flag operation: None Bytes: 3/4/5 Example: SET1 BW,CL Clocks: 21, pPD701 08 21, pPD70116 odd addresses 13, pPD70116 even addresses Transfers: 2 Flag operation: None Example: SET1 WORD_VAR,CL 12-96 Section 12 t\'EC Instruction Set SET1 reg8,imm3 SET1 mem8,imm3 Set bit imm3 of the 8-bit register Set bit imm3 of the 8-bit memory 7 0 7 o 0 0 0 0 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 1 0 0 0 0 0 1 1 1 o o I I 1 1 0 0 0 reg mod 0 0 0 mem I I I imm3 (disp-Iow) I I Bit imm3 of reg8 - 1 (disp-high) Sets the bit specified by the 8-bit immediate data (second I operand) of the 8-bit register (specified by the first oper- imm3 and) to 1. Only the lower 3 bits of the immediate data are used in the fourth byte of the instruction. Bit imm3 of (mem8) - 1 Bytes: 4 Sets the bit specified by the 3-bit immediate data (second Clocks: 5 operand) of the 8-bit memory location (addressed by the first operand) to 1. Only the lower 3 bits of the immediate Transfers: None data are used in the last byte of the instruction. Flag operation: None Bytes: 4/5/6 Example: SEn AL,4 Clocks: 14 Transfers: 2 Flag operation: None Example: SET1 BYTE_VAR,5 12-97 pPD7010S/70116 NEe SEn reg16,imm4 SEn mem16,imm4 Set bit imm4 of the 16-bit register Set bit imm4 of the 16-bit memory 7 0 7 o I. 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 1 0 1 0 0 0 1 1 1 o 1 I I 1 1 0 0 0 reg mod 0 0 0 mem I I I imm4 (disp-Iow) I I Bit imm4 of reg16 -1 (disp-high) Sets the bit specified by the 4-bit immediate data (second I operand) of the 16-bit register (specified by the first oper- imm4 and) to 1. Only the lower 4 bits of the immediate data are used in the 4th byte of the instruciton. Bit imm4 of (mem16) - 1 Bytes: 4 Sets the bit specified by the 4-bit immediate data (second Clocks: 5 operand) of the 16-bit memory location (addressed by the first operand) to 1. Only the lower 4 bits of immediate data Transfers: None are used in the last byte of the instruction. Flag operation: None Bytes: 4/5/6 Example: SET1 CW,O Clocks: 22, pPD70108 22, pPD70116 odd addresses 14, pPD70116 even addresses Transfers: 2 Flag operation: None Example: SET1 Word_Var,15 12-98 ttlEC Section 12 Instruction Set SET1 CY SET1DIR Set carry flag Set direction flag 7 a 7 a i i I1 1 1 1 1 a a 1 I1 1 1 1 1 1 a 1 CY-1 Dir-1 Sets the CY flag. Sets the DIR flag. Sets index registers IX and IY to auto- decrement when MOVBK, CMPBK, CMPM, LDM STM, Bytes: 1 INM, and OUTM are executed. Clocks: 2 Bytes: 1 Transfers: None Clocks: 2 Flag operation: Transfers: None V S z AC P CY Flag operation: I D~R I I U I u I U I U U 1 Example: SET1 DIR 1 Exam Example: SET1 CY 12-99 pPD70108/70116 NEe SHIFT Bytes: 2 SHL reg,1 Clocks: 2 Shift left register, single bit Transfers: None 7 0 Flag operation: 1 1 0 1 0 0 0 W AC P CY 1 1 1 0 0 reg u x x CY -- MSB of reg, reg -- reg X2 Example: When MSB of reg #CY: V -- 1 SHL BH,1 When MSB of reg =CY: V -- 0 SHL AW,1 Performs a shift left (1 bit) of the 8- or 16-bit register specified by the first operand. Zero is loaded to the LSB of the specified register and the MSB is shifted to the CY flag. If the sign bit is the same after the shift, the V flag is cleared. r='-rlI--=-r-~uf---~r-0 CY 1517 14/6 Reg8/16 0 DI+---l. 49000026A 12-100 NEe Section 12 Instruction Set SHL mem,1 Bytes: 2/3/4 Shift left memory, single bit Clocks: When W=O: 16 7 0 When W=1: 24, J,lPD70108 1 0 1 0 0 0 W 24, J,lPD70116 odd addresses 16, J,lPD70116 even addresses I I mod 1 0 0 mem Transfers: 2 I I Flag operation: (disp-Iow) I I AC P CY (disp-high) u x x CY +- MSB of (mem), (mem) +- (mem) X2 Example: When MSB of (mem) =1= CY: V+-1 SHL BYTE PTR [IX1,1 When MSB of (mem) = CY: V+-O SHL WORD_VAR,1 Performs a shift left (1 bit) of the 8- or 16-bit memory location addressed by the first operand. Zero is loaded to the addressed memory LSB and the MSB is shifted to the CY flag. If the sign bit (bit 7 or 15) remains the same after the shift, the V flag is cleared. (MemS/16) CY Df4-------1· ~15~/7~1~4~~________~~.~~________-.~o~ ~; ro 49-QOO408A 12-101 pPD7010S/70116 t\'EC SHl reg, Cl Bytes: 2 Shift left register, variable bit Clocks: 7 o + 7 n, where n = number of shifts Transfers: None 1 1 o 1 o o 1 W Flag operation: 1 1 1 o o reg P CY temp - Cl, while temp ::f 0 x x repeat this operation, CY - MSB of reg, reg - reg X 2, temp - temp - 1 Example: Performs a shift left of the 8- or 16-bit register specified SHL CL,CL by the first operand by the number in the CL register. Zero SHL BW,CL is loaded to the specified register's LSB. MSB is shifted to the CY flag. CY 15/7 Reg8116 0 DI----------l' ==-~~;~:-----L...--....~O 12-102 NEe Section 12 I nstruction Set SHL mem, CL Bytes: 2/3/4 Shift left memory, variable bit Clocks: When W=O: 19 + n 7 0 When W=1: 27 + n, pPD70108 1 1 0 1 0 0 1 W 27 + n, pPD70116 odd addresses + 19 n, pPD70116 even addresses I I where n = number of shifts. mod 1 0 0 mem Transfers: 2 I I (disp-Iow) Flag operation: I I (disp-high) P CY x x temp - CL, while temp =F 0, repeat operation, CY - MSB of (mem), Example: (mem) - (mem) X 2, temp - temp - 1 SHL BYTE PTR [1y],CL Performs a shift left of the 8- or 16-bit memory location SHL WORD PTR [1y],CL addressed by the first operand by the number in the CL register. Zero is loaded to the addressed memory LSB and the MSB is shifted to the CY flag. ~~.__~~1~~7,-______(M_em~~.~:'____~~O~~O 49-000409A 12-103 pPD70108/70116 NEe SHL reg,imm8 Bytes: 3 Shift left register, multibit Clocks: 7 + n, where n = number of shifts 7 0 Transfers: None 1 1 0 0 0 0 0 W Flag operation: 1 1 1 0 0 reg V S Z AC P CY I imm8 I U I X I X U X X Temp - imm8, while temp #- 0, Example: repeat operation, CY - MSB of reg, SHL AH,3 reg - reg X 2, temp - temp - 1 SHL DW,15 Performs a shift left of the 8- or 16-bit register (specified by the first operand) by the 8-bit immediate data (second operand). Zero is loaded to the specified register's LSB. MSB is shifted to the CY flag. CY 1517 RegBl16 o 01-----------10 ~~:: I ~o 12-104 NEe Section 12 Instruction Set SHL mem,imm8 Bytes: 3/4/5 Shift left memory, multi bit Clocks: When W=O: 19 + n 7 0 When W=1: 27 + n, pPD70108 1 1 0 0 0 0 0 W 27 + n, pPD70116 odd addresses + 19 n, pPD70116 even addresses I I mod 1 0 0 mem where n = number of shifts I I Transfers: 2 (disp-Iow) Flag operation: . I. I (dlsp-hlgh) P CY . I Imm8 x x Example: temp - imm8, while temp =/; 0, SHL BYTE PTR [IX] [2],7 repeat operation, CY - MSB of (mem) SHL WORD_VAR,5 (mem) - (mem) X 2, temp - temp - 1 Performs a shift left of the 8- or 16-bit memory location addressed by the first operand by the bits specified by the 8-bit immediate data (second operand). Zero is loaded to the specified memory locations's LSB. The MSB is shifted to the CY flag. CY ,..-::151:;.:..7....--_ _ _(Mem ----s8l16) 0 01------1' _,I----:---r--=---,~o 49-000409A 12-105 pPD7010S/70116 t\'EC SHR reg,1 Bytes: 2 Shift right register, single bit Clocks: 2 7 0 Transfers: None 1 1 0 1 0 0 0 W Flag operation: 1 1 1 0 1 reg V S Z AC P CY X X X U X X CY - MSB of reg, reg - reg -7- 2 When MSB of reg # bit following MSB of reg: V- 1 When MSB of reg = bit following MSB of reg: V- 0 Example: Performs a logical shift right (1 bit) of the 8- or 16-bit SHR BH,1 register specified by the first operand. Zero is loaded to SHR AW,1 the MSB of the specified register and the LSB is shifted to the CY flag. If the sign bit (7 or 15) is the same after the shift, the V flag is cleared. 1517 14/6 o 0-1 I h 49.000019A 12-106 NEe Section 12 Instruction Set SHR mem,1 Bytes: 2/3/4 Shift right memory, single bit Clocks: When W=O: 16 7 0 When W=1: 24, pPD701 08 1 1 0 1 0 0 0 W 24, pPD70116 odd addresses 16, pPD70116 even addresses I I mod 1 0 1 mem Transfers: . 2 I I Flag operation: (disp-Iow) I I AC P CY (disp-high) u x x CY - MSB of (mem), (mem) - (mem) -:- 2 When MSB of (mem) =F bit following MSB of (mem): Example: V-1 SHR BYTE_VAR [BW1,1 When MSB of (mem) = bit following MSB of (mem): SHR WORD_VAR [IX1,1 V-O Performs a logical shift right (1 bit) of the 8- or 16-bit memory location addressed by the first operand. Zero is loaded to the memory location's MSB and the LSB is shifted to the CY flag. If the sign bit (bit 7 or 15) remains the same after the shift, the V flag is cleared. cD '--1~~-----{:;r---~b CY 15/7 14/6 (MernB/16) 0 49-000410A 12-107 pPD70108/70116 ttlEC SHR reg,CL Bytes: 2 Shift right register, variable bit Clocks: 7 + n, where n = number of shifts 7 o 1 1 o 1 o o 1 W Transfers: None Flag operation: 1 1 1 o 1 reg p CY temp - Cl, while temp :F 0, x x repeat operation, CY - MSB of reg, reg - reg -;- 2, temp - temp - 1 Example: Performs a logical shift right of the 8- or 16-bit register SHR Al,Cl (specified by the first operand) by the number in the Cl SHR BW,Cl register. Zero is loaded to the specified register's MSB. The lSB is shifted to the CY flag. 1517 1416 o 0-1 I b 49000019A 12-108 fttIEC Section 12 Instruction Set SHR mem,CL Bytes: 2/3/4 Shift right memory, variable bit Clocks: When W=O: 19 + n 7 0 When W=1: 27 + n, pPD70108 1 1 0 1 0 0 1 W 27 + n, pPD70116 odd addresses 19 + n,pPD70116 even addresses I I where n = number of shifts mod 1 0 1 mem Transfers: 2 I I (disp-Iow) Flag operation: I I (disp-high) AC P CY u x x temp - CL, while temp :F 0, repeat operation, CY - MSB of (mem), Example: (mem) - (mem) + 2, temp - temp - 1 SHR BYTE_VAR,CL Performs a logical shift right of the 8- or 16-bit memory SHR WORD PTR [1y],CL location (addressed by the first operand) by the number in the CL register. Zero is loaded to the addressed memory MSB and the LSB is shifted to the CY flag. cQ --1,......:.;;.;--~;;t------r--=--,h CY 1517 (MemBll6) 0 49.00002OA 12-109 pPD70108/70116 NEe SHR reg,imm8 Bytes: 3 Shift right register, multibit Clocks: 7 + n, where n = number of shifts 7 0 0 W Transfers: None 1 1 0 0 0 0 Flag operation: 1 1 1 0 1 reg V S Z AC P CY . I X X Imm8 I U I X I X U temp - imm8, while temp =F 0, Example: repeat operation, CY - MSB of reg, SHR Bl,S reg - reg + 2, temp - temp - 1 SHR IX,2 Performs a shift right ofthe 8- or 1S-bit register (specified . by the first operand) by the 8-bit immediate data (second operand). Zero is loaded to the specified register's MSB. The lSB is shifted to the CY flag. 1517 Reg8fl6 0 0-1L....-....L.-----(;~,--- - ---.---::--.~h 490000411A 12-110 NEe Section 12 Instruction Set SHR mem,imm8 Bytes: 3/4/5 Shift right memory, multi bit Clocks: When W=O: 19 + n 7 0 When W=1: + 27 n, pPD70108 1 1 0 0 0 0 0 W 27 + n, pPD70116 odd addresses 19 + n, pPD70116 even addresses I I I mod 1 0 1 mem where n = number of shifts I I Transfers: 2 (disp-Iow) Flag operation: I I (disp-high) AC P CY I u x x imm8 Example: temp - imm8, while temp :F 0, SHR BYTE PTR [BW],2 repeat operation, CY - MSB of (mem), SHR WORD_VAR,13 (mem) - (mem) -;- 2, temp - temp - 1 Performs a shift right of the 8- or 16-bit memory location (addressed by the first operand) by the bits specified by the 8-bit immediate data (second operand). Zero is loaded to the specified memory location's MSB. The LSB is shifted to the CY flag. cD --1'-----'-~I:t---~b CY 15/7 (Mem8l16) 0 49.000020A 12-111 pPD70108/70116 NEe SHRA reg,1 Bytes: 2 Shift right arithmetic Clocks: 2 7 0 Transfers: None 1 1 0 1 0 0 0 W Flag operation: 1 1 1 1 1 reg AC p CY u x x CY -- LSB of reg, reg -- reg -:- 2, V -- 0 Example: MSB of operand does not change SHRA CL,1 Performs an arithmetic shift right (1 bit) of the 8- or 16-bit SHRA AW,1 register specified by the first operand. A bit with the same value as the original bit is shifted to the specified reg- ister's MSB. The LSB is shifted to the CY flag. The sign remains unchanged after the shift. 49.000021A 12-112 NEe Section 12 Instruction Set SHRA mem,1 Bytes: 2/3/4 Shift right arithmetic, memory, single bit Clocks When W=O: 16 7 0 When W=1: 24, pPD70108 1 1 0 1 0 0 o W 24, pPD70116 odd addresses 16, pPD70116 even addresses I I mod 1 1 mem Transfers: 2 I I Flag operation: (disp-Iow) I I P CY (disp-high) x x CY - LSB of (mem), Example: (mem) - (mem) -;- 2, V - 0 SHRA BYTE_VAR,1 MSB of operand does not change SHRA WORD_VAR,1 Performs an arithmetic shift right (1 bit) of the 8- or 16-bit memory location addressed by the first operand. A bit with the same value as the original bit is shifted to the memory location's MSB. The LSB is shifted to the CY flag. The sign remains unchanged after the shift. CY 1517 (Mem8l16) 0 cD d~"r------.--=---.h 49-000412A 12-113 pPD70108/70116 NEe SHRA reg,CL Bytes: 2 Shift right arithmetic, register, variable bit Clocks: 1 + n, where n = number of shifts 7 o Transfers: None 1 1 o 1 o o 1 W Flag operation: 1 1 1 1 1 reg AC p CY temp - CL, while temp :1= 0, u x x repeat operation, CY - LSB of reg, reg - reg -:- 2, temp - temp - 1 Example: Performs an arithmetic shift right of the 8- or 16-bit reg- SHRA BL,CL ister (specified by the first operand) by the number of bits SHRA DW,CL specified by the CL register. A bit with the same value as the original bit is shifted to the register's MSB. The LSB is shifted to the CY flag. The sign remains unchanged after the shift. 49-000413A 12-114 NEe Section 12 Instruction Set SHRA mem,CL Bytes: 2/3/4 Shift right arithmetic, memory, variable bit Clocks: When W=O: 19 + n 7 o When W=1: 27 + n, IlPD70108 1 1 o 1 o o 1 W 27 + n, IlPD70116 odd addresses 19 + n, IlPD70116 even addresses I I where n = number of shifts mod 1 1 1 mem Transfers: 2 I I (disp-Iow) Flag Operation: I I (disp-high) AC P CY u x x temp +- CL, while temp #- 0, repeat operation, CY +- LSB of (mem), Example: (mem) +- (mem) -:- 2, temp +- temp - 1, SHRA BYTE_VAR,CL MSB of operand does not change SHRA WORD_VAR,CL Performs an arithmetic shift right of the 8- or 16-bit memory location (addressed by the first operand) by the number of bits specified in the CL register. A bit with the same value as the original bit is shifted to the memory location's MSB. The LSB is shifted to the CY flag. The sign remains unchanged after the shift. cD d-----,---------,r--:--'--:--'h CV 15/7 (Mem8l16) 0 49-000412A 12-115 pPD70108/70116 NEe SHRA reg,imm8 Bytes: 3 Shift right arithmetic, register, multi bit Clocks: 7 o + 7 n, where n = number of shifts Transfers: None 1 1 o o o o o W Flag operation: 1 1 1 1 1 reg p CY i immS x x temp - immS, while temp ¥- 0, Example: repeat operation, CY - LSB of reg, SHRA CL,3 reg - reg +- 2, temp - temp -1; SHRA BW,7 MSB of operand does not change Performs an arithmetic shift right of the S- or 16-bit reg- ister (specified by the first operand) by the S-bit imme- diate data in the second operand. A bit with the same value as the original bit is shifted to the register's MSB. The LSB is shifted to the CY flag. The sign remains unchanged after the shift. 49-000413A 12-116 NEe Section 12 Instruction Set SHRA mem,immS Bytes: 3/4/5 Shift right arithmetic, memory, multi bit Clocks: When W=O: 19 + n 7 o When W=1: 27 + n, pPD7010S 1 1 o o o o o W 27 + n, pPD70116 odd addresses 19 + n, pPD70116 even addresses I I I where n = number of shifts mod 1 1 1 mem Transfers: 2 I I (disp-Iow) Flag operation: I I (disp-high) P CY I x x immS Example: temp - immS, while temp =1= 0, SHRA BYTE_VAR,5 repeat this operation, CY - LSB of (mem), SHRA WORD_VAR,7 (mem) - (mem) -:- 2, temp - temp - 1, MSB of operand does not change Performs an arithmetic shift right of the S- or 16-bit memory location (addressed by the first operand) by the number specified by the S-bit immediate data in the second operand. A bit with the same value as the original bit is shifted to the register's MSB. The LSB is shifted to the CY flag. The sign remains unchanged after the shift. cQ CY (Mem8116) 0 dr--L-1517-------i,I----:~ _ --'--::--'-L...-h 49-000412A 12-117 pPD7010S/70116 t-iEC ROTATE Bytes: 2 ROL reg,l Clocks: 2 Rotate left, register, single bit Transfers: None 7 0 Flag operation: 1 1 0 1 0 0 0 W AC p CY 1 1 0 0 0 reg x CY +- MSB of reg, reg +- reg X 2 + CY Example: MSB of reg #= CY: V+-1 ROL AH,1 MSB of reg = CY: V+-O ROL DW,1 Rotates the 8- or 16-bit register specified by the first operand left by one bit. If the MSB changes, the V flag is set. If the MSB stays the same, the V flag is cleared. ---L....-b CY 15/7 14/6 Reg8116 0 D· I """---"'-1~~:f----: 49000022A 12-118 ttlEC Section 12 Instruction Set ROL mem,1 Bytes: 2/3/4 Rotate left, memory, single bit Clocks: When W=O: 16 7 o When W=1: 24, pPD70108 1 1 o 1 o o o W 24, pPD70116 odd addresses 16, pPD70116 even addresses I I mod o o o mem Transfers: 2 I I Flag operation: (disp-Iow) I I AC P CY (disp-high) x CY +- MSB of (mem), Example: (mem) +- (mem) X 2 + CY ROL BYTE_VAR,1 MSB of (mem) ¥- CY: V+-1 ROL WORD PTR [IXU7],1 MSB of (mem) = CY: V+-O Rotates the 8- or 16-bit memory location (addressed by the first operand) left by one bit. If the MSB changes, the V flag is set; if it stays the same, the V flag is cleared. CV 15/7 14/6 (Mem8/16) 0 D· II -=-'--~-:i----:----=---L---.Jb r=-'--r- 49-000414A 12-119 pPD70108/70116 NEe ROL reg,CL Bytes: 2 Rotate left, register, variable bit Clocks: 7 + n, where n = number of shifts 7 o Transfers: None 1 1 o 1 o o w Flag operation: 1 1 o o o reg P CY temp .-- Cl, while temp # 0, x repeat operation, CY .-- MSB of reg, reg .-- reg X 2 + CY, Example: temp .-- temp - 1 ROl Dl,Cl Rotates the 8- or 16-bit register specified by the first ROl BP,Cl operand left by the number of bits specified by the Cl register. CY r~15~/7.-______R_~_M~6r______,-~o, 0"1 1 :; h 49000023A 12-120 NEe Section 12 Instruction Set ROLmem,CL Bytes: 2/3/4 Rotate left, memory, variable bit Clocks: 7 0 When W=O: 19 + n When W=1: 27 + n, pPD70108 1 1 0 1 0 0 1 W 27 + n, pPD70116 odd addresses 19 + n, pPD70116 even addresses I I mod 0 0 0 mem where n = number of shifts Transfers: 2 I I (disp-Iow) Flag operation: . I. I (dlsp-hlgh) P CY x temp - Cl, while temp =1= 0, repeat operation, CY - MSB of (mem), (mem) +- (mem) X 2 + CY, Example: temp - temp - 1 ROl BYTE PTR [IX],Cl ROl WORD_VAR,Cl Rotates the 8- or 16-bit memory location addressed by the first operand left by the number of bits specified in the Cl register. CY 1517 (Mem8J16) 0 D· I ------i:t-----j-----'----'h ......----r"1 49-000415A 12-121 pPD7010S/70116 NEe ROL reg,imm8 Bytes: 3 Rotate left, register, multibit Clocks: 7 0 + 7 n, where n = number of shifts Transfers: None 1 1 0 0 0 0 0 W Flag operation: 1 1 0 0 0 reg AC p CY I imm8 x temp - imm8, while temp ¥= 0, Example: repeat operation, CY - MSB of reg, ROL DH,3 reg - reg X 2 + CY, ROL IY,7 temp - temp - 1 Rotates the 8- or 16-bit register (specified by the first operand) left by the number of bits specified by the 8-bit immediate data in the second operand. The register's MSB is shifted to the CY flag and to the LSB. ~1~~~1~~~_______~~~~_6________~O~ h CY 0,\1 I ; 49000022A 12-122 NEe Section 12 Instruction Set ROL mem,imm8 Bytes: 3/4/5 Rotate left, memory, multi bit Clocks: When W=O: 19 + n 7 0 When W=1: 27 + n,pPD7010S 1 0 0 0 0 0 W 27 + n, pPD70116 odd addresses + 19 n, pPD70116 even addresses I I where n = number of shifts mod 0 0 0 mem Transfers: 2 I I (disp-Iow) Flag operation: I I (disp-high) AC P CY I x immS Example: temp - immS, while temp "# 0, ROL BYTE_VAR,7 repeat operation, CY - MSB of (mem), ROL WORD_VAR,2 (mem) - (mem) X 2 + CY, temp - temp - 1 Rotates the S- or 16-bit memory location (addressed by the first operand) left by the number of bits specified by the S-bit immediate data in the second operand. The memory location's MSB is shifted to the CY flag and to the LSB. CY 1517 (Mem8116) o D I ~:+----;~b ' - - L . . . . I 49-000415A 12-123 pPD7010S/70116 NEe ROR reg,1 Bytes: 2 Rotate right, register, single bit Clocks: 2 7 0 Transfers: None 1 1 0 1 0 0 0 W Flag operation: 1 1 0 0 1 reg AC p CY x CY -- LSB of reg, reg -- reg ...;- 2, MSB of reg -- CY Example: MSB of reg ¥- bit following MSB of reg: V -- 1 ROR AL,1 MSB of reg = bit following MSB of reg: V -- 0 ROR CW,1 Rotates the 8- or 16-bit register (specified by the first operand) right by 1 bit. If the MSB of the specified register changes, the overflow flag is set. If the MSB stays the same, the overflow flag is cleared. 49.000014A 12-124 1ttIEC Section 12 Instruction Set ROR mem,1 Bytes: 2/3/4 Rotate right, memory, single bit Clocks: When W=O: 16 7 0 When W=1: 24, pPD70108 1 1 0 1 0 0 0 W 24, pPD70116 odd addresses 16, pPD70116 even addresses I I I mod 0 0 1 mem Transfers: 2 I I Flag operation: (disp-Iow) I I P CY (disp-high) x CY - LSB of (mem), (mem) - (mem) -:- 2 Example: MSB of (mem) - CY ROR BYTE_VAR,1 MSB of (mem) oF bit following MSB of (mem): V- 1 ROR WORD PTR [BW],1 MSB of (mem) = bit following MSB of (mem): V- 0 Rotates the 8- or 16-bit memory location addressed by the first operand right by 1 bit.lfthe MSB of the addressed memory changes, the overflow flag is set. If the MSB stays the same, the overflow flag is cleared. cO Q--L- 1517 14---l..---16_(M-iT"1---- - - , - - ' b 49-000416A 12-125 pPD70108/70116 NEe ROR reg,CL Bytes: 2 Rotate right, register, variable bit Clocks: 7 0 7 + n, where n = number of shifts t, Transfers: None 1 1 0 1 0 0 1 W Flag operation: 1 1 0 0 1 reg p CY temp - CL, while CL =F 0, x repeat operation, CY - LSB of reg, reg - reg + 2, Example: MSB of reg - CY, ROR AH,CL temp - temp - 1 ROR AW,CL Rotates the 8- or 16-bit register (specified by the first operand) right by the number of bits specified by the CL register. CY 1517 Reg8l16f--_ _-.--.:..O....., cD d~;f--f---,--b 49.000015A 12-126 Section 12 t-IEC Instruction Set ROR mem,CL Bytes: 2/3/4 Rotate right, memory, variable bit Clocks: When W=O: 19 + n 7 0 When W=1: 27 + n, pPD70108 1 1 0 1 0 0 1 W 27 + n, pPD70116 odd addresses 19 + n, pPD70116 even addresses I I I where n = number of shifts mod 0 0 1 mem Transfers: 2 I I (disp-Iow) Flag operation: I I (disp-high) AC P CY x temp - CL, while temp ,c 0, repeat operation, CY - LSB of (mem), (mem) - (mem) -;- 2, Example: ROR BYTE_VAR,CL MSB of (mem) - CY, ROR WORD PTR [IX]2,CL Temp - temp - 1 Rotates the 8- or 16-bit memory location (specified by the first operand) right by the number of bits specified by the CL register. 49-000417A 12-127 pPD70108/70116 ttlEC ROR reg,imm8 Bytes: 3 Rotate right, register, multi bit Clocks: 7 0 7 + n, where n = number of shifts Transfers: None 1 1 0 0 0 0 0 W Flag operation: 1 1 0 0 1 reg AC p CY I x imm8 temp - imm8, while temp # 0, Example: repeat operation, ROR AL,2 CY - LSB of reg, reg - reg + 2, ROR IX,3 MSB of reg - CY, temp - temp - 1 Rotates the 8- or 16-bit register (specified by the first operand) right by the number of bits specified by the 8-bit immediate data in the second operand. The register's LSB is shifted to the MSB and the CY flag. 49.000015A 12-128 ttlEC Section 12 Instruction Set ROR mem,imm8 Bytes: 3/4/5 Rotate right, memory, multi bit Clocks: When W=O: 19 + n 7 0 When W=1: 27 + n, IlPD70108 1 0 0 0 0 0 W 27 + n, IlPD70116 odd addresses 19 + n, IlPD70116 even addresses I I mod 0 0 1 mem where n = number of shifts I I Transfers: 2 (disp-Iow) Flag operation: I I (disp-high) AC P CY I x imm8 Example: temp +- imm8, while temp #- 0, ROR BYTE_VAR,6 repeat operation, ROR WORD_VAR [IX],7 CY +- LSB of (mem), (mem) +- (mem) -:- 2, temp +- temp - 1 Rotates the 8- or 16-bit memory location addressed by the first operand right by the number of bits specified by the 8-bit immediate data in the second operand. The memory location's LSB is shifted to the MSB as well as to the CY flag. CY 1517 (Mem8116) 0 cD d'-----'--------::~b 49-000417A 12-129 pPD70108/70116 NEe ROLe reg,1 Bytes: 2 Rotate left with carry, register, single bit Clocks: 2 7 0 Transfers: None 1 1 0 1 0 0 0 W Flag operation: 1 1 0 1 0 reg AC p CY x tmpcy - CY, CY - MSB of reg, Reg - reg X 2 + tmpcy, Example: MSB of reg = CY: V - 0 ROLC BL,1 MSB of reg ¥- CY: V - 1 ROLC IY,1 Rotates the 8- or 16-bit register specified by the first operand left, including the CY flag, by one bit. If the register's MSB changes, the V flag is set. If it stays the same, the V flag is cleared. cQl------I' '11416~T o h 1517 L--...I.- 49.000016A 12-130 ttlEC Section 12 Instruction Set ROLe mem,1 Bytes: 2/3/4 Rotate left with carry, memory, single bit Clocks: When W=O: 16 7 0 When W=1: 24, pPD70108 1 1 0 1 0 0 0 W 24, pPD70116 odd addresses 16, pPD70116 even addresses i i i mod 0 1 0 mem Transfers: 2 i i Flag operation: (disp-Iow) i i P CV (disp-high) x tmpcy - CV, CV - MSB of (mem), (mem) - (mem) X 2 + tmpcy, Example: ROLC BVTE_VAR,1 MSB of (mem) = CV: V - 0 MSB of (mem) oF CV: V - 1 ROLC WORD PTR [IV],1 Rotates the 8- or 16-bit memory location (addressed by the first operand) left by one bit. The rotation includes the CV flag. If the MSB of the memory location changes, the V flag is set. If it stays the same, the V flag is cleared. o b 49-000418A 12-131 pPD70108/70116 ttlEC ROLC reg,CL Bytes: 2 Rotate left with carry, register, variable bit Clocks: 7 = n, where n = number of shifts 7 o Transfers: None 1 1 o 1 o o 1 W Flag operation: 1 1 o 1 o reg p CY temp - CL, while temp =F 0, x repeat operation, tmpcy - CY, CY - MSB of reg, reg - reg X 2 + tmpcy, Example: temp - temp - 1 ROLC AL,CL Rotates the 8- or 16-bit register (specified by the first ROLC BW,CL operand) left by the number in the CL register. Rotation includes the CY flag. cO· 49.000017A 12-132 ttlEC Section 12 Instruction Set ROLC mem,CL Bytes: 2/3/4 Rotate left with carry, memory, variable bit Clocks: When W=O: 19 + n 7 o When W=1: 27 + n, pPD70108 1 1 0 0 0 1 W 27 + n, pPD70116 odd addresses 19 + n, pPD70116 even addresses I mod 0 1 0 I mem I where n = number of shifts Transfers: 2 I I (disp-Iow) Flag operation: I I (disp-high) AC P CY x temp - CL, while temp =1= 0, repeat operation, tmpcy - Cy, Example: CY - MSB of (mem), ROLC BYTE PTR [IY],CL (mem) - (mem) X 2 + tmpcy, ROLC WORD_VAR,CL temp - temp - 1 Rotates the 8- or 16-bit memory location (addressed by the first operand) left by the number in the CL register. Rotation includes the CY flag. cQ. 15/7 49-000419A 12-133 pPD70108/70116 NEe ROLe reg,imm8 Bytes: 3 Rotate left with carry, register, multi bit Clocks: 7 0 + 7 n, where n = number of shifts Transfers: None 1 1 0 0 0 0 0 W Flag operation: 1 1 0 1 0 reg AC p CY • I Imm8 x temp - imm8, while temp ¥- 0, Example: repeat operation, tmpcy - CY, ROLC BL,3 CY - MSB of reg, reg - reg X 2 + tmpcy, ROLC AW,14 temp - temp - 1 Rotates the 8- or 16-bit register (specified by the first operand) left by the number of bits specified by the 8-bit immediate data of the second operand. Rotation includes the CY flag. cy Reg8J16 15/7 0 jD' ;; I b 49000017A 12-134 Section 12 t-IEC Instruction Set ROLe mem,imm8 Bytes: 3/4/5 Rotate left with carry, memory, multi bit Clocks: When W=O: 19 + n 7 0 When W=1: 27 + n, J.lPD70108 1 1 0 0 0 0 o W 27 + n, J.lPD70116 odd addresses 19 + n, J.lPD70116 even addresses I I where n = number of shifts mod 0 1 0 mem Transfers: 2 I I (disp-Iow) Flag operation: I I (disp-high) AC P CY I x imm8 Example: temp +- imm8, while temp =1= 0, ROLC BYTE_VAR,3 repeat operation, tmpcy +- CY, ROLC WORD_VAR,5 CY +- MSB of (mem), (mem) +- (mem) X 2 + tmpcy, temp +- temp - 1 Rotates the 8- or 16-bit memory location (addressed by the first operand) left by the number of bits specified by the 8-bit immediate data of the second operand. Rotation includes the CY flag. 49-{)(J()419A 12-135 pPD7010S/70116 NEe RORe reg,1 Bytes: 2 Rotate right with carry, register, single bit Clocks: 2 7 a Transfers: None 1 1 a 1 a a a w Flag operation: 1 1 a 1 1 reg V S z AC P CY X X I I : tmpcy - CY, CY - LSB of reg, reg - reg -;- 2, MSB of reg - tmpcy, Example: MSB of reg #- bit following MSB of reg: V-1, RORC BH,1 MSB of reg = bit following MSB of reg: v-a RORC BP,1 Rotates the 8- or 16-bit register, specified by the first operand, right (including the CY flag) by one bit. If the MSB changes, the V flag is set. If it remains unchanged, the V flag is cleared. Cy 15/7 14/6 Reg8l16 0 cD ·IL.--.-L- --<------1111---L--...Jh 49.000018A 12-136 t-IEC Section 12 Instruction Set RORCmem,1 Bytes: 2/3/4 Rotate right with carry, memory, single bit Clocks: WhenW=O: 16 7 o When W=1: 24, pPD70108 1 1 o 1 o o o W 24, pPD70116 odd addresses 16, pPD70116 even addresses i i mod o 1 1 mem Transfers: 2 i i Flag operation: (disp-Iow) I i P CY (disp-high) x tmpcy - CY, CY - LSB of (mem), Example: (mem) - (mem) -:- 2, MSB of (mem) - tmpcy, RORC BYTE PTR [BW].1 MSB of (mem) ¥- bit following MSB of (mem): V - 1 RORC WORD_VAR [BW] [IX],1 MSB of (mem) = bit following MSB of (mem): V - 0 Rotates the 8- or 16-bit memory location (addressed by the first operand) right (including the CY flag) by one bit. If the MSB changes, the V flag is set. If it remains unchanged, the V flag is cleared. o h 49-000420A 12-137 pPD70108/70116 NEe RORC reg,CL Bytes: 2 Rotate right with carry, register, variable bit Clocks: 7 o 7 + n, where n = number of shifts Transfers: None 1 1 o o o 1 W Flag operation: 1 1 o 1 reg AC p CY temp ~ CL, while temp "# 2, x repeat operation, tmpcy ~ CY, CY ~ LSB of reg, reg ~ reg -;- 2 Example: MSB of reg ~ tmpcy, temp ~ temp - 1, RORC AL,CL Rotates the 8- or 16-bit register specified by the first RORC CW,CL operand right (including the CY flag) by the number in the CL register. 49000028A 12-138 ttlEC Section 12 Instruction Set RORC mem,CL Bytes: 2/3/4 Rotate right with carry, memory, variable bit Clocks: When w=o: 19 + n 7 0 When W=1: + 27 n, pPD70108 1 1 0 1 0 0 1 W 27 + n, pPD70116 odd addresses + 19 n, pPD70116 even addresses I I where n = number of shifts mod 0 1 1 mem Transfers: 2 I I (disp-Iow) Flag operation: I I (disp-high) temp - Cl, while temp =1= 0, repeat operation, tmpcy - CY, Example: CY +- lSB of (mem), reg - reg -:- 2, RORC BYTE_VAR,Cl MSB of (mem) - tmpcy, temp - temp - 1 WORD_VAR [BP],Cl RORC Rotates the 8- or 16-bit memory location specified by the first operand right (including the CY flag) by the number in the Cl register. 49-000421 A 12-139 pPD70108/70116 t\'EC RORe reg,imm8 Bytes: 3 Rotate right with carry, register, multibit Clocks: 7 + n, where n = number of shifts 7 o Transfers: None 1 1 o o o o o W Flag operation: 1 1 o 1 1 reg V S z AC P CY I X I X imm8 I I temp - imm8, while temp "# 0, Example: repeat operation, tmpcy - CY, RORC CH,S CY - LSB of reg, reg - reg -+ 2, RORC BW,10 MSB of reg - tmpcy, t~mp - temp - 1 Rotates the 8- or 16-bit register specified by the first operand right (including the CY flag) by the number of bits specified by the 8-bit immediate data of the second operand. 49.000028A 12-140 NEe Section 12 Instruction Set RORC mem,imm8 Bytes: 3/4/5 Rotate right with carry, memory multi bit Clocks: When W=O: 19 + n 7 o When W=1: 27 + n, pPD70108 1 1 o o o o o w 27 + n, pPD70116 odd addresses 19 + n, pPD70116 even addresses I I mod o 1 1 mem where n = number of shifts I I Transfers: 2 (disp-Iow) Flag operation: I I (disp-high) AC P CY . I x Imm8 temp - imm8, while temp # 0, Example: RORC BYTE_VAR,3 repeat operation, tmpcy - CY, RORC WORD PTR [BWl,10 CY - LSB of (mem), (mem) - (mem)+ 2, MSB of (mem) - tmpcy, temp - temp - 1 Rotates the 8- or 16-bit memory location addressed by the first operand right (including the CY flag) by the number of bits specified by the 8-bit immediate data of the second operand. 49-000421A 12-141 pPD70108/70116 NEe SUBROUTINE CONTROL CALL regptr16 CALL near-proc Call, register, same segment Call, relative, same segment 7 0 7 o 1 1 1 1 1 1 1 1 1 1 1 o 1 o o o 1 1 0 1 0 reg I I (disp-Iow) (SP - 1, SP - 2) - PC, I I SP-SP-2, (disp-high) PC - regptr16 Saves the PCto the stack and loads the value of the 16-bit (SP - 1, SP - 2) - PC, register specified by the operand to the PC. Enables calls SP-SP-2, to any address within the current segment. PC - PC +disp Bytes: 2 Saves the PC to the stack and loads the 16-bit displace- ment to the PC. Enables calls to any address within the Clocks: current segment. 18, pPD70108 18, pPD70116 odd addresses Bytes: 3 14, pPD70116 even addresses Clocks: Transfers: 1 20, pPD70108 20, pPD70116 odd addresses Flag operation: None 16, pPD70116 even addresses Example: CALL BX Transfers: 1 Flag operation: None Example: CALL NEAR_PROC 12-142 NEe Section 12 I nstruction Set CALL memptr16 CALL far-proc Call, memory, same segment Call, direct, external segment 7 0 7 o 1 1 1 1 1 1 1 1 1 o o 1 1 o 1 o i i i i mod 0 1 0 mem (offset-low) i i i i i (disp-Iow) (offset-high) i i i (disp-high) (seg-Iow) i i (SP - 1, SP - 2) - PC, (seg-high) SP - SP - 2, PC - (memptr16) Saves the PC to the stack and loads the contents of the (SP - 1, SP - 2) - PS, 16-bit memory location addressed by the operand to the (SP - 3, SP - 4) - PC, PC. Enables calls to any address within the current SP -SP-4, segment. PS -seg, PC - offset Bytes: 2/3/4 Saves the PS and PC to the stack. Loads the fourth and Clocks: fifth bytes of the instruction to the PS and the second and 31, JlPD70108 third bytes to the PC. Enables calls to any address in any 31, JlPD70116 odd addresses segment. 23, JlPD70116 even addresses Bytes: 5 Transfers: 2 Clocks: Flag operation: None 29, JlPD70108 Example: CALL TABLE_ENTRY [IX] 29, JlPD70116 odd addresses 21, JlPD70116 even addresses Transfers: 2 Flag operation: None Example: CALL FAR_PROC 12-143 pPD70108/70116 NEe CALL memptr32 RET (no operand) Call, memory, external segment Return from procedure, same segment 7 0 7 o 1 1 1 1 1 1 1 1 I 1 I 1 o o o o 1 1 I I mod 0 1 1 mem PC - (SP + 1, SP), SP-SP+2 I I (disp-Iow) Used for returning from intrasegment calls. Restores the PC from the stack. The assembler automatically distin- I I guishes this instruction from the other RET instruction (disp-high) with no operand. (SP - 1, SP - 2) - PS, Bytes: 1 (SP - 3, SP - 4) - PC, Clocks: SP-SP-4, 19, pPD70108 PS - (memptr32 + 3, memptr32 + 2), 19, pPD70116 odd addresses PC - (memptr32 + 1, memptr32) 15, pPD70116 even addresses Saves the PS and PC to the stack. Loads the higher two Transfers: 1 bytes of the 32-bit memory addressed by the operand to the PS. Loads the lower two bytes to the PC. Enables Flag operation: None calls to any address in any segment. Example: RET Bytes: 2/3/4 Clocks: 47, pPD70108 47, pPD70116 odd addresses 31, pPD70116 even addresses Transfers: 4 Flag operation: None Example: CALL FAR_TABLE [IV] 12-144 NEe Section 12 Instruction Set RET pop-value RET (no operand) Return from procedure, SP jump, same segment Return from procedure, external segment 7 o 7 o 1 1 o o o o 1 o I 1 I 1 o o 1 o 1 1 I I I pop-value-low PC - (SP + 1, SP), PS - (SP + 3, SP + 2), I I I SP-SP+4 pop-value-high Restores the PC and PS from the stack. Used for return- ing from intersegment calls. The assembler automatically PC - (SP + 1, SP), SP-SP+2, distinguishes this instruction from the RET instruction SP - SP + pop-value without an operand. Restores the PC from the stack and adds the 16-bit pop- Bytes: 1 value specified by the operand. Effective for jumping a Clocks: desired number of parameters when the parameters 29, pPD70108 saved in the stack become unnecessary to the program. 29, pPD70116 odd addresses Used for returning from intrasegment calls. The 21, pPD70116 even addresses assembler automatically distinguishes this instruction from the other RET pop-value instruction. Transfers: 2 Bytes: 3 Flag operation: None Clocks: Example: RET 24, pPD70108 24, pPD70116 odd addresses 20, pPD70116 even addresses Transfers: 1 Flag operation: None Example: RET 8 12-145 pPD70108/70116 NEe RET pop-value STACK OPERATION Return from procedure, SP jump, intersegment PUSH mem16 7 o Push, 16-bit memory 1 1 o o 1 o 1 o 7 0 I I I 1 1 1 1 1 1 1 1 pop-value-low I I I I I mod 1 1 0 mem pop-value-high I I (disp-Iow) PC - (SP + 1, SP), PS - (SP + 3, SP + 2), I I SP-SP+4, (disp-high) SP - SP + pop-value Restores the PC and PS from the stack and adds the (SP - 1, SP - 2) - (mem16), 16-bit pop-value specified by the operand to the SP. This SP-SP-2 command is effective for jumping the SP value when the Saves the contents of the 16-bit memory location parameters saved in the stack subsequently become addressed by the operand to the stack. unnecessary to the program. Used for returning from intersegment calls. The assembler automatically distin- Bytes: 2/3/4 guishes this instruction from the other RET pop-value Clocks: instruction. 26, pPD70108 26, pPD70116 odd addresses Bytes: 3 18, pPD70116 even addresses Clocks: 32, pPD70108 Transfers: 2 32, pPD70116 odd addresses Flag operation: None 24, pPD70116 even addresses Example: PUSH DATA [IX] Transfers: 2 Flag operation: None Example: RET 4 12-146 ttlEC Section 12 I nstruction Set PUSH reg16 PUSH sreg Push, 16-bit register Push, segment register 7 o 7 o I0 I 1 o 1 o reg I 0 I 0 I 0 I sreg I 1 1 o (SP -1, SP - 2) - reg16, (SP -1, SP - 2) - sreg, SP-SP-2 SP-SP-2 Saves the 16-bit register specified by the operand to Saves the segment register specified by the operand to the stack. the stack. Bytes: 1 Bytes: 1 Clocks: Clocks: 12, pPD70108 12, pPD70108 12, pPD70116 odd addresses 12, pPD70116 odd addresses 8, pPD70116 even addresses 8, pPD70116 even addresses Transfers: 1 Transfers: 1 Flag operation: None Flag operation: None Example: PUSH IY Example: PUSH PS 12-147 pPD70108/70116 NEe PUSH PSW PUSHR Push, program status word Push, register set 7 o 7 o 1 o o Io I 1 I 1 o o o o o (SP - 1, SP - 2) - PSW, temp -SP, SP-SP-2 (SP - 1, SP - 2) - AW, (SP - 3, SP - 4) - CW, Saves the PSW to the stack. (SP - 5, SP - 6) - OW, Bytes: 1 (SP - 7, SP - 8) - BW, (SP - 9, SP - 10) - temp, Clocks: (SP -11, SP -12) - BP, 12, pP0701 08 (SP -13, SP -14) -IX, 12, pP070116 odd addresses (SP -15, SP -16) -IY, 8, pP070116 even addresses SP -SP-16 Transfers: 1 Saves eight 16-bit registers (AW, BW, CW, Ow, SP, BP, IX, Flag operation: None and IY) to the stack. Example: PUSH PSW Bytes: 1 Clocks: 67, pP070108 67, pP070116 odd addresses 35, pP070116 even addresses Transfers: 8 Flag operation: None Example: PUSH R 12-148 NEe Section 12 Instruction Set PUSH imm8 PUSH imm16 Push, 8-bit immediate data, sign expansion Push, 16-bit immediate data 7 o 7 o o 1 1 o 1 o 1 o o 1 1 o 1 o o o . I I I Imm8 imm16-low I I (SP - 1, SP - 2) - Sign expansion of imm8, imm16-high SP-SP-2 Expands the sign of the 8-bit immediate data specified (SP - 1, SP - 2) - imm16, by the operand. Saves the data as 16-bit data to the stack SP -SP-2 addressed by the SP. Saves the 16-bit immediate data described by the oper- Bytes: 2 and to the stack addressed by the SP. Clocks: Bytes: 3 11, pPD70108 Clocks: 11, pPD70116 odd addresses 12, pPD70108 7, pPD70116 even addresses 12, pPD70116 odd addresses Transfers: 1 8, pPD70116 even addresses Flag operation: None Transfers: 1 Example: Flag operation: None PUSH 5 Example: PUSH 1234H PUSH -1 12-149 pPD70108/70116 NEe POP mem16 POP reg16 Pop, 16-bit memory Pop, 16-bit register 7 o 7 o 1 o o o 1 1 1 I 0 I 1 o 1 1 reg I I mod o o o mem reg16 - (SP + 1, SP), SP - SP + 2 Transfers the contents of the stack to the 16-bit register I I (disp-Iow) specified by the operand. Bytes: 1 I I (disp-high) Clocks: 12, pPD70108 (mem16) - (SP + 1, SP), 12, pPD70116 odd addresses SP-SP+2 8, pPD70116 even addresses Transfers the contents of the stack to the 16-bit memory Transfers: 1 location addressed by the operand. Flag operation: None Bytes: 2/3/4 Example: POP BP Clocks: 25, pPD70108 25, pPD70116 odd addresses 17, pPD70116 even addresses Transfers: 2 Flag operation: None Example: POP DATA 12-150 NEe Section 12 Instruction Set POP sreg POP PSW Pop, segment register Pop, program status word 7 a 7 a Ia I a a I sreg 1 1 I 1 I a a 1 1 1 a 1 sreg - (SP + 1, SP), SP - SP +2 PSW +- (SP + 1, SP), SP +- SP + 2 Transfers the contents of the stack to the segment reg- Transfers the contents of the stack to the PSw. ister (except PS) specified by the operand. External inter- Bytes: 1 rupts NMI and INT, and single-step breaks will not be acknowledged between this instruction and the next. Clocks: 12, pPD70108 Bytes: 1 12, pPD70116 odd addresses Clocks: 8, pPD70116 even addresses 12, pPD70108 Transfers: 1 12, pPD70116 odd addresses 8, pPD70116 even addresses Flag operation: Transfers: 1 IM~*I IB:K V DIR IE S Z Flag operation: None R R R R R Example: POP DS1 AC P CY I I R R R *The Mode flag (MD) can only be modified by POP PSW during Native mode calls from 8080 Emulation mode; i.e. between the execution of BRKEM and RETEM instruc- tions.ln Native mode outside of Emulation mode, the MD flag will remain set to 1 regardless of the contents of the stack. Do not alter the MD flag during Native mode calls from Emulation mode, or during Native mode interrupt service routines which may be executed by interrupting Emulation mode execution. Example: POP PSW 12-151 pPD7010S/70116 NEe POP R PREPARE imm16,imm8 Pop, register set Prepare new stack frame 7 o 7 o I0 I 1 o o o o 1 1 1 0 0 1 0 0 o I I IY - (SP + 1, SP), imm16-low IX +- (SP + 3, SP + 2), BP +- (SP + 5, SP + 4), I I BW +- (SP + 9, SP + a), imm16-high ow +- (SP + 11, SP + 10), I CW - (SP + 13, SP + 12), imma AW +- (SP + 15, SP + 14), SP -SP+ 16 (SP - 1, SP - 2) +- BP, Restores the contents of the stack to the following 16-bit SP +- SP - 2, registers: AW, BW, CW, OW, BP SP, IX, and IY. temp +- SP, When imma > 0, repeat these operations "imma - 1" Bytes: 1 times: Clocks: (SP - 1, SP - 2 +- (BP - 1, BP - 2) 75, pP07010a SP +- SP - 2 (*1, see notes) 75, pP070116 odd addresses BP +- BP - 2 43, pP070116 even addresses and perform these operations: (SP - 1, SP - 2) +- temp Transfers: 7 SP +- SP - 2 (*2, see notes) Flag operation: None Then perform these operations: Example: POP R BP +- temp SP +- SP - imm16 Notes: When imm8=1, *1 is not performed, When imm8=O, *1 and *2 are not performed. Used to generate "stack frames" required by the block structures of high-level languages such as Pascal and Ada. The stack frame includes a local variable area as well as pointers. These frame pointers point to other frames containing variables that can be referenced from the current procedure. The first operand (16-bit immediate data) specifies (in bytes) the size of the local variable area. The second operand (a-bit immediate data) specifies the depth (or lexical level) of the procedure block. The frame base address generated by this instruction is set in the BP base pointer. First the old BP value is saved to the stack so that BP of the calling procedure can be restored when the called procedure terminates. The frame pointer (BP value saved to the stack) that indicates the range of variables that can be referenced by the called procedure is placed on the stack. This range is always a value one less than the lexical level of the procedure. If the lexical level of a proced u re is greater than one, the poi nters of that proce- dure will also be saved on the stack. This enables the frame pointer of the calling procedure to be copied when frame pointer copy is performed within the called procedure. 12-152 NEe Section 12 Instruction Set Next, the new frame pointer value is set in the BP and DISPOSE (no operand) the area for local variables used by the procedure is Dispose a stack frame reserved in the stack. In other words, SP is decremented only for the amount of stack memory required by the local 7 o variables. I 1 I 1 o o 1 o o 1 Bytes: 4 Clocks: SP - BP, When imm B = 0: 16, J.lPD7010B BP - (SP + 1, SP), 16, J.lPD70116 odd addresses SP -SP +2 12, J.lPD70116 even addresses Releases the last stack frame generated by the PREPARE When B> 1: 23 + 16 (immB - 1), J.lPD7010B instruction. A value that points to the preceding frame is 23 + 16 (immB - 1), J.lPD70116 loaded in the BP and the bottom of the frame value is odd addresses loaded in SP. 19 + B (immB -1), J.lPD70116 even addresses Bytes: 1 Transfers: Clocks: When immB = 0: none 10, J.lPD7010B When immB> 1: 1 + 2(immB-1) 10, J.lPD70116 odd addresses 6 J.lPD70116 even addresses Flag operation: None Transfers: 1 Example: PREPARE 10, 3 Flag operation: None Example: DISPOSE 12-153 pPD7010S/70116 NEe BRANCH BR short-label BR-near-Iabel Branch short relative, same segment Branch Relative, Same Segment BR near-label 7 o 7 o 1 1 o 1 o 1 1 1 1 o 1 o o 1 I disp8 I I (disp-Iow) PC - PC + ext-disp8 I I Loads the current PC value plus an 8-bit (actually, sign- (disp-high) extended 16-bit) displacement value to the PC. When the branch address is in the current segment and within PC - PC +disp ±127 bytes of the instruction, the assembler automati- Loads the current PC value plus a 16-bit displacement cally generates this instruction. value to the PC. If the branch address is in the current Bytes: 2 segment, the assembler automatically generates this instruction. Clocks: 12 Bytes: 3 Transfers: None Clocks: 12 Flag operation: None Transfers: None Example: BR SHORT_LABEL Flag operation: None Example: BR LABEL1 12-154 NEe Section 12 Instruction Set BR regptr16 BR memptr16 Branch register, same segment Branch memory, same segment 7 0 7 o 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 I I I 1 1 1 0 0 reg mod 1 0 0 mem I I PC - regptr16 (disp-Iow) Loads the contents of the 16-bit register specified by the I I operand to the PC. This instruction can branch to any (disp-high) address in the current segment. Bytes: 2 PC - (memptr16) Clocks: 11 Loads the contents of the 16-bit memory location ad- dressed by the operand to the PC. This instruction can Transfers: None branch to any address in the current segment. Flag operation: None Bytes: 2/3/4 Example: BR BX Clocks: 24,IlPD70108 24,IlPD70116 odd addresses 20,IlPD70116 even addresses Transfers: 1 Flag operation: None Example: BR TABLE [IX] 12-155 pPD7010S/70116 NEe BR far-label BR memptr32 Branch direct, external segment Branch memory, external segment 7 o 7 0 1 1 1 0 1 0 1 o 1 1 1 1 1 1 1 1 I I I I offset-low mod 1 0 1 mem I I I I offset-high (disp-Iow) I I I seg-Iow (disp-high) I seg-high PS - (memptr32 + 3, memptr32 + 2) PC - (memptr32 + 1, memptr32) PC - offset, Loads the upper two bytes and lower two bytes of the PS -seg 32-bit memory addressed by the operand to the PS and PC, respectively. This instruction can branch to any Loads the 16-bit offset data (second and third bytes of address in any segment. the instruction) to the PC and the 16-bit segment data (fourth and fifth bytes) to the PS. This instruction can Bytes: 2/3/4 branch to any address in any segment. Clocks: Bytes: 5 35, pPD70108 35, pPD70116 odd addresses Clocks: 15 27, pPD70116 even addresses Transfers: None Transfers: 2 Flag operation: None Flag operation: None Example: BR FAR_LABEL Example: BR FAR_SEGMENT [IV] 12-156 t\'EC Section 12 Instruction Set CONDITIONAL BRANCH BNV short-label BV short-label Branch if not overflow Branch if overflow 7 o 7 o o 1 1 1 0 o o 1 o 1 1 1 o o o o I disp8 I disp8 When V = 0, PC +- PC + ext-disp8 When V = 1, PC +- PC + ext-disp8 When the V flag is 0, load the current PC value plus the 8-bit (actually, sign-extended 16-bit) displacement value When the V flag is 1, load the current PC value plus the to the PC. This instruction can branch to any address 8-bit (actually, sign-extended 16-bit) displacement value within ±127 bytes of the instruction in the current to the PC. This instruction can branch to any address segment. within ±127 bytes of the instruction in the current segment. Bytes: 2 Bytes: 2 Clocks: When V = 0: 14 Clocks: When V = 1: 4 When V = 1: 14 When V = 0: 4 Transfers: None Transfers: None Flag operation: None Flag operation: None Example: BNV NO_ERROR Example: BV OVERFLOW_ERROR 12-157 pPD7010S/70116 NEe BC short-label BNC short-label BL short-label BNL short-label Branch if carry /Iower Branch if not carry/not lower 7 o 7 o o 1 1 1 o o 1 o o 1 1 1 o o 1 1 I I disp8 disp8 When CY = 1, PC - PC + ext-disp8 When CY = 0, PC - PC + ext-disp8 When the CY flag is 1, load the current PC value plus When the CY flag is 0, load the current PC value plus the 8-bit (actually, sign-extended 16-bit) displacement the 8-bit (actually, sign-extended 16-bit) displacement value to the PC. This instruction can branch to any value to the PC. This instruction can branch to any address within ±127 bytes of the instruction in the cur- address within ±127 bytes of the instruction in the cur- rent segment. rent segment. Bytes: 2 Bytes: 2 Clocks: Clocks: When CY = 1: 14 When CY = 0: 14 When CY=O: 4 When CY = 1: 4 Transfers: None Transfers: None Flag operation: None Flag operation: None Example: Example: BC CARRY_SET BNC CARRY_CLEAR BL LESS_THAN BNL GREATER_OR_EQUAL 12-158 NEe Section 12 Instruction Set BE short-label BNE short-label BZ short-label BNZ short-label Branch if equal/zero Branch if not equal/not zero 7 o 7 o o 1 1 1 o 1 o o o 1 1 1 o 1 o 1 I I disp8 disp8 When Z = 1, PC - PC + ext-disp8 When Z = 0, PC - PC + ext-disp8 When the Z flag is 1, load the current PC value plus the When the Z flag is 0, load the current PC value plus the 8-bit (actually, sign-extended 16-bit) displacement value 8-bit (actually, sign-extended 16-bit) displacement value to the PC. This instruction can branch to any address to the PC. This instruction can branch to any address within ±127 bytes of the instruction in the current within ±127 bytes of the instruction in the current segment. segment. Bytes: 2 Bytes: 2 Clocks: Clocks: When Z = 1: 14 When Z = 0: 14 When Z=O, 4 When Z = 1: 4 Transfers: None Transfers: None Flag operation: None Flag operation: None Example: Example: BE EQUALITY BNE NOT_EQUAL BZ ZERO BNZ NOT_ZERO 12-159 pPD70108/70116 NEe BNH short-label BH short-label Branch if not higher Branch if higher 7 o 7 o o 1 1 1 o 1 1 o o 1 1 o 1 1 1 I I disp8 disp8 When CY OR Z = 1, PC - PC + ext-disp8 . When CY OR Z = 0, PC - PC + ext-disp8 When the logical sum of the CY and Z flags is 1, load When the logical sum of the CY and Z flags is 0, load the current PC value plus the 8-bit (actually, sign- the current PC value plus the 8-bit (actually, sign- extended 16-bit) displacement value to the PC. This extended 16-bit) displacement value to the PC. This instruction can branch to any address within ±127 bytes instruction can branch to any address within ±127 bytes of the instruction in the current segment. of the instruction in the current segment. Bytes: 2 Bytes: 2 Clocks: Clocks: When CY OR Z = 1: 14 When CY ORZ = 0: 14 When CY OR Z = 0: 4 When CYORZ= 1: 4 Transfers: None Transfers: None Flag operation: None Flag operation: None Example: BNH NOT_HIGHER Example: BH HIGHER 12-160 NEe Section 12 Instruction Set BN short-label BP short-label Branch if negative Branch if positive 7 o 7 o o 1 1 1 1 o o o o 1 1 1 o o 1 I I disp8 disp8 When S = 1, PC .... PC + ext-disp8 When S = 0, PC .... PC + ext-disp8 When the S flag is 1, load the current PC value plus the When the S flag is 0, load the current PC value plus the 8-bit (actually, sign-extended 16-bit) displacement value 8-bit (actually, sign-extended 16-bit) displacement value to the PC. This instruction can branch to any address to the PC. This instruction can branch to any address within ±127 bytes of the instruction in the current within ±127 bytes of the instruction in the current segment. segment. Bytes: 2 Bytes: 2 Clocks: Clocks: When S = 1: 14 When S = 0: 14 When S=O: 4 When S = 1: 4 Transfers: None Transfers: None Flag operation: None Flag operation: None Example: BN NEGATIVE Example: BP POSITIVE 12-161 pPD70108/701i6 NEe aPE short-label BPO short-label Branch if parity even Branch if parity odd 7 o 7 o o 1 1 1 1 o 1 o o 1 1 1 1 o 1 1 I I disp8 disp8 When P = 1, PC - PC + ext-disp8 When P = 0, PC - PC + ext-disp8 When the P flag is 1, load the current PC value plus the When the P flag is 0, load the current PC value plus the 8-bit (actually, sign-extended 16-bit) dispacement value 8-bit (actually, sign-extended 16-bit) displacement value to the PC. This instruction can branch to any address to the PC. This instruction can branch to any address within ±127 bytes of the instruction in the current within ±127 bytes of the instruction in the current segment. segment. Bytes: 2 Bytes: 2 Clocks: Clocks: When P = 1: 14 When P = 0: 14 When P=O: 4 When P = 1: 4 Transfers: None Transfers: None Flag operation: None Flag operation: None Example: BPE PARITY_EVEN Example: BPO PARITY_ODD 12-162 Section 12 ttlEC Instruction Set BlT short-label BGE short-label Branch if less than Branch if greater than or equal 7 o 7 o o 1 1 1 1 1 o o o 1 1 1 1 1 o 1 I I disp8 disp8 When S XORV = 1, PC - PC + ext-disp8 When S XOR V = 0, PC - PC + ext-disp8 When the exclusive OR of the S and V flags is 1, load When the Exclusive OR of the S and V flags is 0, load the current PC value plus the 8-bit (actually, sign- the current PC value plus the 8-bit (actually, sign- extended 16-bit) displacement value to the PC. This extended 16-bit) displacement value to the PC. This instruction can branch to any address within ±127 bytes instruction can branch to any address within ±127 bytes of the instruction in the current segment. When the con- of the instruction in the current segment. When the con- ditions are unsatisfied, proceeds to the next instruction. ditions are unsatisfied, proceeds to the next instruction. Bytes: 2 Bytes: 2 Clocks: Clocks: WhenSXORV=1: 14 When S XOR V = 0: 14 When S XOR V = 0: 4 When S XOR V = 1: 4 Transfers: None Transfers: None Flag operation: None Flag operation: None Example: BLT LESS_THAN Example: BGE GREATER_OR_EQUAL 12-163 JlPD70108/70116 ttlEC BLE short-label BGT short-label Branch if less than or equal Branch if greater than 7 o 7 o o 1 1 1 o o 1 1 1 1 1 I I disp8 disp8 When (S XOR V) OR Z = 1, PC +- PC + ext-disp8 When (S XOR V) OR Z = 0, PC +- PC + ext-disp8 When the Exclusive OR of the S and V flags and the When the exclusive OR of the S and V flags and the logical sum of that result and the Z flag is 1, loads the logical sum of that result and the Z flag is 0, load the current PC value plus the 8-bit (actually, sign-extended current PC value plus the 8-bit (actually, sign-extended 16-bit) displacement val ue to the PC. Th is instruction can 16-bit) displacement value to the PC. This instruction can branch to any address within ±127 bytes of the instruc- branch to any address within ±127 bytes of the instruc- tion in the current segment. When the conditions are tion in the current segment. When the conditions are unsatisfied, proceeds to the next instruction. unsatisfied, proceeds to the next instruction. Bytes: 2 Bytes: 2 Clocks: Clocks: When (S XOR V) OR Z = 1: 14 When (S XOR V) OR Z 0: = 14 When (S XOR V) OR Z = 0: 4 When (S XOR V) OR Z = 1: 4 Transfers: None Transfers: None Flag operation: None: Flag operation: None Example: BLE LESS_OR_EQUAL Example: BGTGREATER 12-164 t\'EC Section 12 Instruction Set DBNZNE short-label DBNZE short-label Decrement and branch if not zero and not equal Decrement and branch if not zero and equal 7 o 7 o 1 1 1 o o o o o 1 1 1 o o o o 1 I disp8 CW-CW-1 CW-CW-1 When CW =I' 0 and Z = 0, PC - PC + ext-disp8 When CW =F 0 and Z = 1, PC - PC + ext-disp8 When the 16-bit register CW is decremented (-1), the When the 16-bit register CW is decremented (-1), the resultant CW value is not 0, arid the Z flag is cleared, load CW is not zero, and the Z flag is set, load the current PC the current PC value plus the 8-bit (actually, sign- value plus the 8-bit (actually, sign-extended 16-bit) dis- extended 16-bit) displacement value to the PC. This placement value to the PC. This instruction can branch instruction can branch to any address within ±127 bytes to any address within ±127 bytes ofthe instruction in the of the instruction in the current segment. current segment. Bytes: 2 Bytes: 2 Clocks: Clocks: When CW =F 0 and Z = 0: 14 When CW =F 0 and Z = 1: 14 When others: 5 When others: 5 Transfers: None Transfers: None Flag operation: None: Flag operation: None Example: PBNZNE LOOP_AGAIN Example: DBNZE LOOP_AGAIN 12-165 pPD70108/70116 NEe DBNZ short-label BCWZ short-label Decrement and branch if not zero Branch if CW equals zero 7 o 7 o 1 1 1 o o o 1 o 1 o o o 1 1 I I disp8 disp8 CW+-CW-1 If CW = 0, PC +- PC + ext-disp8 When CW # 0, PC +- PC + ext-disp8 When the 16-bit register CW is 0, load the current PC When the 16-bit register CW is decremented (-1) and value plus the 8-bit (actually sign-extended 16-bit) dis- the CW value is not zero, load the current PC value plus placement value to the PC. This instruction can branch the 8-bit (actually, sign-extended 16-bit) displacement to any address within ±127 bytes of the instruction in the value to the PC. This instruction can branch to any current segment. address within ±127 bytes of the instruction in the cur- Bytes: 2 rent segment. Clocks: Bytes: 2 When CW = 0: 13 Clocks: When CW#O: 5 When CW # 0: 13 Transfers: None When CW=O: 5 Flag operation: None Transfers: None Example: BCWZ CW_ZERO Flag operation: None Example: DBNZ LOOP_AGAIN 12-166 NEe Section 12 Instruction Set BREAK BRK imm8 (=F3) BRK3 Break, immediate data Break, vector 3 7 o 7 o 1 1 o o 1 1 o 1 I 1 I 1 I 0 o 1 1 o o I imm8 (SP -1, SP - 2) - PSW (SP - 3, SP - 4) - PS (SP - 1, SP - 2) - PSW (SP - 5, SP - 6) - PC (SP - 3, SP - 4) - PS SP-SP-6 (SP - 5, SP - 6) - PC IE-O SP -SP-6 BRK-O IE-O PC - (13,12) BRK-O PS - (15,14) + PC - (immB X4 1, imm8 X4) PS - (immB X4 + 3, imm8 X4 + 2) Saves the PSW, PS, and PC to the stack and resets the IE and BRK flags to O. Then loads the lower two bytes Saves the PSw, PS, and PC to the stack and resets the and higher two bytes of vector 3 of the interrupt vector IE and BRK flags to O. Then loads the lower two bytes table to the PC and PS, respectively. and upper two bytes of the interrupt vector table (4 bytes) specified by the 8-bit immediate data to the PC and PS, Bytes: 1 respectively. Clocks: Bytes: 1 50, pPD70108 50, pPD70116 odd addresses Clocks: 38, pPD70116 even addresses 50, pPD70108 50, pPD70116 odd addresses Transfers: 5 38, pPD70116 even addresses Flag operation: Transfers: 5 Flag operation: Example: BRK 3 Example: BRK 10H ;PC = (40H,41 H), ;PS = (42H,43H) 12-167 pPD7010S/70116 ttlEC BRKV (no operand) RETI (no operand) Break if overflow Return from interrupt 7 o 7 o I 1 I 1 o o 1 o I 1 I 1 o o 1 1 When V = 1, PC - (SP + 1, SP) (SP - 1, SP - 2) - PSW PS - (SP + 3, SP + 2) (SP - 3, SP - 4) - PS PSW - (SP + 5, SP + 4) (SP - 5, SP - 6) - PC SP-SP+6 SP -SP-6 Restores the contents of the stack to the PC, PS, and IE-O PSW Used for return from interrupt processing. BRK-O PC - (011 H, 010H) Bytes: 1 PS - (013H, 012H) Clocks: When the V flag is set, saves the PSW, PS, and PC to 39, pPD70108 the stack and resets the IE and BRK flags to O. Then loads 39, pPD70116 odd addresses the lower two bytes and upper two bytes of vector 4 of 27, pPD70116 even addresses the interrupt vector table to the PC and PS, respectively. Transfers: 3 When the V flag is reset, proceeds to the next instruction. Flag operation: Bytes: 1 IM~*I Clocks: When V = 1: 52,pPD70108 52, pPD70116 odd addresses V R DIR R IE R Ia:K I S R Z R When V = 0: 40, pPD70116 even addresses AC P CY Transfers: 5 i Flag operation: I R R R* *The Mode flag (MD) can only be modified by RETI during Native mode calis from 8080 Emulation mode; i.e. between the execution of BRKEM and RETEM instruc- tions.ln Native mode outside of Emulation mode, the MD Example: BRKV flag will remain set to 1 regardless of the contents of the stack. Do not alter the MD flag during Native mode calis from Emulation mode, or during interrupt service rou- tines which may be executed by interrupting Emulation mode execution. The RETI instruction should be used to exit Native mode service routines and to return to Emu- lation mode. The RETI instruction should be the last instruction executed in the Native mode service routine. Example: RETI 12-168 t-{EC Section 12 Instruction Set BRKEM immS Bytes: 3 Break for emulation Clocks: 50, pPD70108 7 o 50, pPD70116 odd addresses 0 0 0 0 1 1 1 1 38, pPD70116 even addresses Transfers: 5 1 1 1 1 1 1 1 Flag operation: I imm8 (SP - 1, SP - 2) +- PSW (SP - 3, SP - 4) +- PS (SP - 5, SP - 6) +- PC Example: BRKEM 80H SP +- SP - 6 MD +- 0, write enable MD PS +- (imm 8 X 4 + 3, imm 8 X 4 + 2) PC +- imm 8 X 4 + 1, imm 8 X 4) Starts the emulation mode. Saves the PSW, PS, and PC and resets the MD bit to 0 and jumps to the emulation location addressed by the interrupt vector specified by the 8-bit immediate data specified by the operand. After fetching the instruction code ofthe jumped interruptserv- ice routine (for emulation), the CPU interprets and exe- cutes the code as an instruction of the pPD808AF. Use either the RETEM or CALLN instruction to return from the emulation mode to the native mode (pPD70108170116). CALtN temporarily returns the program from Emulation to Native Mode and RETEM completes Emulation mode. 12-169 pPD70108/70116 NEe CHKIND reg16,mem32 Bytes: 2/3/4 Check index Clocks: When interrupt condition is fulfilled: 7 0 73-76, pP070108 0 1 1 0 0 0 1 0 73-76, pP070116 odd addresses 53-56, pP070116 even addresses I I I mod reg mem When interrupt condition is not fulfilled: 26, pP070108 I I 26, pP070116 odd addresses (disp-Iow) 18, pP070116 even addresses I I Transfers: (disp-high) When interrupt condition is fulfilled: 7 When interrupt condition is not fulfilled: 2 When (mem32) > reg16 or (mem32 + 2) < reg16 (SP - 1, SP - 2) - PSW Flag operation: (SP - 3, SP - 4) - PS When interrupt condition is fulfilled: (SP - 5, SP - 6) - PC SP-SP-6 IE-O BRK-O PS - (23, 22) PC - (21, 20) Example: Used to check whether the index value in reg16 is within When interrupt condition is not fulfilled: None: the defined array bounds. Initiates a BRK 5 when the Example: index does not satisfy the condition. The definition region MOV IX,23 should be set beforehand in the two words (first word CHKINO IX,BOUNOS1 ;OK for the lower limit and second word for the upper limit) MOV BW,87 of memory. CHklNO BW,BOUNOS2 ;causes ;BRK5 BOUNOS1 OW 5,37 BOUNOS2 OW 2,80 Memory o (Upper Limit) (Lc!wer Limit) 49000029A 12-170 ttlEC Section 12 Instruction Set CPU CONTROL POLL (no operand) HALT (no operand) Poll and wait Halt 7 o 7 o I1 I 0 o 1 1 o 1 1 I1 1 1 1 o 1 o o Keeps the CPU in the idle state until the POLL pin becomes an active low level. Sets the halt state. The halt state is released by the RESET, NMI, or INT input. Bytes: 1 Bytes: 1 Clocks: 2 + Sn, where n = number of times POLL pin is sampled Clocks: 2 Transfers: None Transfers: None Flag operation: None Flag operation: None: Example: POLL Example: HALT 12-171 pPD70108/70116 NEe 01 (no operand) EI (no operand) Disable interrupt Enable interrupt 7 a 7 a I I I 1 1 1 1 1 a 1 a I 1 1 1 1 a 1 1 IE-O EI-1 Resets the IE flag and disables the external maskable Sets the EI flag and enables the external maskable inter- interrupt input (INT). Does not disable the external non- rupt input (INT). The system does not enter the interrupt- maskable interrupt input (NMI) or software interrupt enable state until executing the instruction immediately instructions. after EI. Bytes: 1 Bytes: 1 Clocks: 2 Clocks: 2 Transfers: Flag operation: None Transfers: Flag operation: None rn Example: EI Example: 01 12-172 NEe Section 12 Instruction Set BUSLOCK (no operand) FP01 fp-op Bus lock prefix Floating point operation 1, register 7 o 7 o I1 i 1 1 1 o o o o 1 1 o 1 1 x x x In the large-scale mode (S/LG = 0) 1 1 y y y z z z Outputs the buslock signal (BUSLOCK) while the instruc- tion immediately after the BUSLOCK instruction is being Used when the floating point arithmetic chip is con- executed. When BUSLOCK is used for a block operation nected externally. Causes the CPU to leave arithmetic instruction with a repeat prefix, the BUSLOCK signal is processing to the floating point chip. When the floating kept at an active low level until the end of the block point chip monitors this instruction, it treats the instruc- operation instruction. tion as its own and executes it. Hold request is inhibited when BUSLOCK is active. The Bytes: 2 BUSLOCK instruction is effective when you do not want Clocks: 2 to acknowledge a hold request during block operations. Transfers: None In small-scale mode (S/LG = 1) Flag operation: None The BUSLOCK signal is not an output. However, the BUSLOCK instruction can be used to delay a hold Example: acknowledge response to a hold request until execution FP01 FABSO of the locked instruction is completed. FP01 FCMPR2 Bytes: 1 Clocks: 2 Transfers: None Flag operation: None Example: BUSLOCK REP MOVBKB 12-173 pPD70108/70116 NEe FP01 fp-op,mem FP02 fp-op Floating point operation 1, memory Floating pOint operation 2, register 7 o 7 0 1 1 o 1 x x x 0 1 1 0 0 1 1 X i i mod y y y mem 1 1 Y Y Y Z Z Z i i Used with an externally connected floating point arith- (disp-Iow) metic chip. Causes the CPU to leave processing to the i i floating point chip. When the floating point chip monitors (disp-high) this instruction, it interprets the instruction as its own and executes it. Data bus - (mem) Bytes: 2 Used when the floating point arithmetic chip is externally connected. Causes the CPU to leave arithmetic process- Clocks: 2 ing to the floating point chip and instead, carries out Transfers: None auxiliary processing such as calculation of effective address, generation of physical addresses, and start of Flag operation: None memory read cycles when necessary. Example: FP02 FSINRO When the floating point chip monitors this instruction, it treats the instruction as its own and executes it. In this case, depending on the type of instruction, the floating point chip selects either the address information of the memory read cycle started by the CPU or both the address and read data. The CPU does not use the read data on the data bus in the memory read cycle which the CPU has initiated. Bytes: 2/3/4 Clocks: 15, pPD70108 15, pPD70116 odd addresses 11, pPD70116 even addresses Transfers: 1 Flag operation: None Example: FP01 FCMP,DWORD_VAR FP01 FMUL,QWORD PTR [BW] 12-174 NEe Section 12 Instruction Set FP02 fp-op, mem NOP (no operand) Floating point operation 2, memory No operation 7 0 7 o 0 1 1 0 0 1 X I1 I 0 o 1 o o o o I I mod y y y mem Causes the processor to do nothing for three clocks. Bytes: 1 I I (disp-Iow) Clocks: 3 I I Transfers: None (disp-high) Flag operation: None Data bus -- (mem) Example: NOP Used with an externally connected floating point arith- metic chip. Causes the CPU to leave arithmetic process- ing to the floating point chip and instead carries out auxiliary processing such as calculation of effective addresses, generation of physical addresses, and start of memory read cycles when necessary. When the floating point chip monitors this instruction, it treats the instruction as its own and executes it. In this case, depending on the type of instruction, the operating chip selects either the address information of the memory read cycle started by the CPU or both the address and read data. Bytes: 2/3/4 Clocks: 15, pPD70108 15, pPD70116 odd addresses 11,pPD70116 even addresses Transfers: 1 Flag operation: None Example: FP02 FCOS,DWORD PTR [IX][BW] 12-175 pPD70108/70116 ~EC SEGMENT OVERRIDE PREFIXES EMULATION MODE OSO: CALLN imm8 OS1: Call native PS: SS: 7 0 7 o 1 1 1 0 1 1 0 1 I I0 o 1 sreg 1 1 o 1 1 0 1 1 0 1 When appended to the operand, specifies the segment I register to be used for access of a memory operand imm8 expecting segment override. You can define the segment override by assembler direc- (SP - 1, SP - 2) -- PSW tive ''ASSUME'' without describing the segment override (SP - 3, SP - 4) -- PS prefix directly (see Assembler Operating Manual). (SP - 5, SP - 6) -- PC SP-- PS-6 Bytes: 1 MO--1 Clocks: 2 PS -- (imm8 X4 + 3, imm8 X4 + 2) PC -- (imm8 X4 + 1, imm8 X4) Transfers: None When executed in the emulation mode, the CPU inter- Flag operation: None prets the instruction as a pP08080AF command. The Example: CPU saves the PS, PC, and PSW to the stack (MO =0 MOV IX,OS1 :[IY] is also saved). Then the MO flag is set to 1. The interrupt REP MOVBKB OEST_BLK,SS:SRC-BLK vector specified by the 8-bit immediate data of the oper- and is loaded into PS and PC. This command allows you to call a native mode interrupt routine from the emula- tion mode. The RETI command is used to return to emulation mode from the interrupt routine. Bytes: 3 Clocks: 58, pP070108 58, pP070116 odd addresses 38, pP070116 even addresses Transfers: 5 Flag operation: Example: CALLN 40H 12-176 NEe Section 12 Instruction Set RETEM Bytes: 2 Return from emulation Clocks: 39, pPD70108 7 0 39, pPD70116 odd addresses 1 1 1 0 1 1 0 1 27, pPD70116 even addresses Transfers: 3 1 1 1 1 1 1 0 1 Flag operation: PC - (SP + 1, SP) PS - (SP + 3, SP + 2) MD v DIR z AC PSW - (SP + 5, SP + 4) R R R R R SP-SP+6 Write disable MD P CY When executed in the emulation mode, the CPU inter- R R prets this instruction as a pPD8080AF command. The CPU restores the PS, PC, and PSW saved by the BRKEM command in the same manner as when returning from Example: RETEM interrupt processing. When the BRKEM instruction is executed, the MD flag is write disabled, so the MD flag is not restored by executing the RETI or POP PSW instructions. 12-177 pPD7010S/70116 t-IEC 12-178 Appendix 1& NEe Instruction Index ~ Instruction Page Instruction Page ADD reg,reg .............................. 12-29 CALL near-proc .......................... 12-142 mem,reg ............................. 12-30 regptr16 ............................ 12-142 reg,mem ............................. 12-30 memptr16 .......................... 12-143 reg,imm ............................. 12-31 far-proc ............................ 12-143 mem,imm ............................ 12-31 memptr32 .......................... 12-144 acc,imm ............................. 12-32 CALLN imm8 ............................... 12-176 ADDC reg,reg .............................. 12-32 CHKIND reg16,mem32 ...................... 12-170 mem,reg ............................. 12-33 CLR1 reg8,CL .............................. 12-90 reg,mem ............................. 12-33 mem8,CL ............................ 12-90 reg,imm ............................. 12-34 reg16,CL ............................ 12-91 mem,imm ............................ 12-34 mem16,CL .......................... 12-91 acc,imm ............................. 12-35 reg8,imm3 ........................... 12-92 ADD4S ........................................ 12-42 mem8,imm3 ......................... 12-92 ADJBA ........................................ 12-61 reg16,imm4 ......................... 12-93 ADJBS ........................................ 12-62 mem16,imm4 ....................... 12-93 ADJ4A ........................................ 12-61 CY ................................... 12-94 ADJ4S ........................................ 12-62 DIR .................................. 12-94 AND reg, reg .............................. 12-72 CMP reg,reg .............................. 12-65 mem,reg ............................. 12-72 mem,reg ............................. 12-65 reg,mem ............................. 12-73 reg,mem ............................. 12-66 reg,imm .............................. 12-74 reg,imm ............................. 12-66 mem,imm ............................ 12-74 mem,imm ............................ 12-67 acc,imm ............................. 12-75 acc,imm ............................. 12-67 BC short-label ......................... 12-158 CMPBK ............................. 12-17 BCWZ .................................... 12-166 CMPBKB ........................................ 12-17 BE II •••••••••••••••••••••••••••••••••••• 12-159 CMPBKW ........................................ 12-17 BGE I' .................................... 12-163 CMP4S ........................................ 12-44 BGT .................................... 12-164 CMPM ........................................ 12-18 BH .................................... 12-160 CMPMB ........................................ 12-18 BL ., .................................... 12-158 CMPMW ........................................ 12-18 BLE .................................... 12-164 CVTBD ........................................ 12-63 BLT ., .................................... 12-163 CVTBW ........................................ 12-64 BN ., .................................... 12-161 CVTDB ........................................ 12-63 BNC short-label ......................... 12-158 CVTWL ........................................ 12-64 BNE ., .................................... 12-159 DBNZ short-label ......................... 12-166 BNH ., .................................... 12-160 DBNZE ., .................................... 12-165 BNL ., .................................... 12-158 DBNZNE ., .................................... 12-165 BNV ., .................................... 12-157 DEC reg8 ................................. 12-48 BNZ ., .................................... 12-159 mem ................................. 12-49 BP ., .................................... 12-161 reg16 ................................ 12-49 BPE ., .................................... 12-162 01 ...................................... 12-172 BPO ., .................................... 12-162 DISPOSE ...................................... 12-153 BR near-label ......................... 12-154 DIV reg8 ................................. 12-58 short-label ......................... 12-154 mem8 ............................... 12-58 regptr16 ............................ 12-155 reg16 ................................ 12-59 memptr16 .......................... 12-155 mem16 .............................. 12-60 far-label ............................ 12-156 DIVU reg8 ................................. 12-56 memptr32 .......................... 12-156 mem8 ............................... 12-56 BRK 3 .................................... 12-167 reg16 ................................ 12-57 imm8 ............................... 12-167 mem16 .............................. 12-57 BRKEM imm8 ............................... 12-169 DSO: ...................................... 12-176 BRKV ... ; .................................. 12-168 DS1: ...................................... 12-176 BUSLOCK ...................................... 12-173 EI ...................................... 12-172 BV short-label ......................... 12-157 EXT reg18,reg28 ......................... 12-23 BZ ., .................................... 12-159 reg8,imm4 ........................... 12-24 A-1 JlPD7010S/70116 NEe Instruction Page Instruction Page FP01 fp-op ............................... 12-173 NOT1 reg8,CL .............................. 12-85 fp-op,mem ......................... 12-174 mem8,CL ............................ 12-86 FP02 fp-op ............................... 12-174 reg16,CL ............................ 12-86 fp-op,mem ......................... 12-175 mem16,CL .......................... 12-87 HALT ...................................... 12-171 reg8,imm3 ........................... 12-87 IN acc,imm8 ........ '" ................. 12-25 mem8,imm3 ......................... 12-88 acc,DW .............................. 12-25 reg16,imm4 ......................... 12-88 INC reg8 ................................. 12-47 mem16,imm4 ....................... 12-89 mem ...... ;-. ......................... 12-47 CY ................................... 12-89 reg16 ................................ 12-48 OR reg,reg .............................. 12-75 INM dst-block,DW ....................... 12-28 mem,reg ............................. 12-76 INS reg18,reg28 ......................... 12-21 reg,mem ............................. 12-76 reg8,imm4 ........................... 12-22 reg,imm ............................. 12-77 LDEA reg16,mem16 ....................... 12-11 mem,imm ............................ 12-77 LDM src-block ............................ 12-19 acc,imm ............................. 12-78 LDMB ........................................ 12-19 OUT imm8,acc ............................ 12-26 LDMW ........................................ 12-19 DW,acc .............................. 12-26 MOV reg, reg ................................ 12-4 OUTM DW,src-block ....................... 12-29 mem,reg .............................. 12-4 POLL ."..................................... 12-171 reg,mem .............................. 12-5 POP mem16 ............................. 12-150 mem,imm ............................. 12-5 reg16 ............................... 12-150 reg,imm ............................... 12-5 sreg ................................ 12-151 acc,dmem ............................ 12-6 PSW ............................... 12-151 dmem,acc ............................ 12-7 R ................................... 12-152 sreg,reg16 ............................ 12-6 PREPARE imm16,imm8 ....................... 12-152 sreg,mem16 .......................... 12-8 PS: ...................................... 12-176 reg16,sreg ............................ 12-8 PUSH imm8 ............................... 12-149 mem16,sreg .......................... 12-9 imm16 .............................. 12-146 DSO,reg16,mem32 ................... 12-9 mem16 ............................. 12-146 DS1,reg16,mem32 .................. 12-10 reg16 ............................... 12-147 AH,PSW ............................. 12-10 sreg ................................ 12-147 PSW,AH ............................. 12-11 PSW ............................... 12-148 MOVBK dist-block,src-block ................ 12-16 R ................................... 12-148 MOVBKB ........................................ 12-16 REP ........................................ 12-15 MOVBKW ........................................ 12-16 REPC ........................................ 12-14 MUL reg8 ................................. 12-52 REPE ........................................ 12-15 mem8 ............................... 12-52 REPNC ........................................ 12-14 reg16 ................................ 12-53 REPNE ........................................ 12-15 mem16 .............................. 12-53 REPNZ ........................................ 12-15 reg16,reg16,imm8 .................. 12-54 REPZ ........................................ 12-15 reg16,mem16,imm8 ................. 12-54 RET ...................................... 12-144 reg16,reg16,imm16 ................. 12-55 pop-value ......................... 12-145 reg16,mem16,imm16 ............... 12-55 RETEM ...................................... 12-177 MULU reg8 ................................. 12-50 RET1 ...................................... 12-168 mem8 ............................... 12-50 ROL reg,1 ................................ 12-118 reg16 ................................ 12-51 mem,1 .............................. 12-119 mem16 .............................. 12-51 reg,CL .............................. 12-120 NEG reg ............... .................... 12-69 mem,CL ............................ 12-121 mem ................................. 12-69 reg,imm8 ........................... 12-122 NOP ...................................... 12-175 mem,imm8 ......................... 12-123 NOT reg .............. ..................... 12-68 mem ................................. 12-68 A-2 NEe Appendix A Instruction Set Instruction Page Instruction Page ROLC reg,1 ............................... 12-130 SS: ...................................... 12-176 mem,1 .............................. 12-131 STM dst-block ............................ 12-20 reg,CL .............................. 12-132 STMB ........................................ 12-19 mem,CL ............................ 12-133 STMW ........................................ 12-19 reg,imm8 ........................... 12-134 SUB reg,reg .............................. 12-35 mem,imm8 ......................... 12-135 mem,reg ............................. 12-36 ROL4 mem8 ............................... 12-45 reg,mem ............................. 12-36 reg8 ................................. 12-45 reg,imm ............................. 12-37 ROR reg,1 ............................... 12-124 mem,imm ............................ 12-37 mem,1 .............................. 12-125 acc,imm ............................. 12-38 reg,CL .............................. 12-126 SUBC reg, reg .............................. 12-38 mem,CL ............................ 12-127 mem,reg ............................. 12-39 reg,imm8 ........................... 12-128 reg,mem ............................. 12-39 mem,imm8 ......................... 12-129 reg,imm ............................. 12-40 RORC reg,1 ............................... 12-136 mem,imm ............................ 12-40 mem,1 .............................. 12-137 acc,imm ............................. 12-41 reg,CL .............................. 12-138 SUB4S ........................................ 12-43 mem,CL ............................ 12-139 TEST reg,reg .............................. 12-70 reg,imm8 ........................... 12-140 mem,reg ............................. 12-70 mem,imm8 ......................... 12-141 reg,imm ............................. 12-71 ROR4 reg8 ................................. 12-46 mem,imm ............................ 12-71 mem8 ............................... 12-95 acc,imm ............................. 12-72 SET1 reg8,CL .............................. 12-95 TEST1 reg8,CL .............................. 12-81 mem8,CL ............................ 12-95 mem8,CL ............................ 12-82 reg16,CL ............................ 12-96 reg16,CL ............................ 12-82 mem16,CL .......................... 12-96 mem16,CL .......................... 12-83 reg8,imm3 ........................... 12-97 reg8,imm3 ........................... 12-83 mem8,imm3 ......................... 12-97 mem8,imm3 ......................... 12-84 reg16,imm4 ......................... 12-98 reg16,imm4 ......................... 12-84 mem16,imm4 ....................... 12-98 mem16,imm4 ....................... 12-85 CY ................................... 12-99 TRANS src-table ............................ 12-12 DIR .................................. 12-99 TRANSB . .. . . . .. . . .. . . . .. . ... . . . . . . .. . . . . . . . . . .. 12-12 SHL reg,1 ............................... 12-100 XCH reg,reg .............................. 12-12 mem,1 .............................. 12-101 mem,reg ............................. 12-13 reg,CL .............................. 12-102 AW,reg16 ............................ 12-13 mem,CL ............................ 12-103 XOR reg,reg .............................. 12-78 reg,imm8 ........................... 12-104 mem,reg ............................. 12-79 mem,imm8 ......................... 12-105 reg,mem ............................. 12-79 SHR reg,1 ............................... 12-106 reg,imm ............................. 12-80 mem,1 .............................. 12-107 mem,imm ............................ 12-80 reg,CL .............................. 12-108 acc,imm ............................. 12-81 mem,CL ............................ 12-109 reg,imm8 ........................... 12-110 mem,imm8 ......................... 12-111 SHRA reg,1 ................................ 12-112 mem,1 .............................. 12-113 reg,CL .............................. 12-114 mem,CL ............................ 12-115 reg,imm8 ........................... 12-116 mem,imm8 ......................... 12-117 A-3 pPD7010S/70116 NEe A-4 pPD70108/70116 ftt{EC For Literature Call Toll Free: 1-800-632-3531 1-800-632-3532 (In California) NEe Electronics Inc. CORPORATE HEADQUARTERS No part of this document may be copied or reproduced in any form or by any means without the prior written consent of NEC Electronics Inc. The information in this document is subject to change without notice. Devices sold by NEC Electronics Inc. 401 Ellis Street are covered by the warranty and patent indemnification provisions appearing in NEC Electronics Inc. Terms and Conditions P.O. Box 7241 of Sale only. NEC Electronics Inc. makes no warranty, express, statutory, implied , or by description , regarding the information set forth herein or regarding the freedom of the described devices from patent infringement. NEC Electronics Mountain View, CA 94039 Inc. makes no warranty of merchantability or fitness for any purpose. NEC Electronics Inc. assumes no responsibility for any TEl 415-960-6000 errors that may appear in this document. NEC Electronics Inc. makes no commitment to update or to keep current the TWX 910-379-6985 information contained in this document. NECEL-000254-1086 " 1986 NEC Electronics Inc./Printed in U.S.A. STOCK NO. 500350