MITSUBISHI SEMICONDUCTORS c ({) m :n ({) $: )> z c )> 'MELPS 7700 • MITSUBISHI . . . . ELECTRIC Foreword Foreword This manual has been prepared to enable the users of the Series MELPS 7700 CMOS 16-bit microcomputers to better understand the instruction set and the features so that they can utilize the capabilities of the microcomputers to the fullest. This manual presents detailed descriptions of the instructions and ad- dressing modes available for the Series MELPS 7700 micro- computers. For the hardware descriptions of the Series MELPS 7700 micro- computers and descriptions of various development support tools (e.g., assembler, debugger), please refer to the user's manuals and operating guidebooks for the respective hardware and software products. Contents Contents Page 1. Introduction of Series MELPS 7700 Software 1 2. Register Configuration in CPU = = = = = = = = = = = 2 2.1 Accumulator 2.2 Index Register X 2.3 Index Register Y 2.4 Stack Pointer 2.5 Program Counter 2.6 Program Bank Register 2.7 Data Bank Register 2.8 Direct Page Register 2.9 Processor Status Register 3. Addressing Modes 3.1 Addressing Mode 3.2 Explanation of Addressing Modes 4. Instructions ================~52 4.1 Instruction Set 4.2 Description of Instructions 5. Notes for Programming ~===========~165 6. Instruction Execution Sequence ~=========~167 6.1 Bus Interface Unit 6.2 Change of the CPU Basic Clock cPu 6.3 Instruction Execution Sequence Appendixes ~================~188 A. CPU Instruction Execution Sequence for each Addressing Mode 188 B. Series MELPS 7700 Machine Instructions 252 C. Series MELPS 7700 Instruction Code Table 266 Introduction of Series MELPS 7700 Software 1. Introduction of Series MELPS 7700 Software The software for the Series MELPS 7700 16cbit CMOS microcomputers was developed by making is numerous enhancements on the software for the Series MELPS 740 8-bit microcom- puter which are based on Mitsubishi Electric Corporation's proprietary designs. The enhance- ments include support of word (16-bit) operations and linear accessing of up to 16M bytes of memory space. The new software's compact and easy to use instruction set and the support of powerful address- ing modes will significantly increase :The Series MELPS 7700 microcomputers offer the following features • Upward compatibility for the Series MELPS 740. • Powerful addressing modes and fast and compact instruction set. • Direct page mapping function and memory oriented software system by direct paging. • Byte and word operations can be selected at will by the m flag. • The usual 64K bytes program memory boundary can be ignored for the practical purposes,and programs can be written to utilize the full 16M bytes of memory space. For data memory, linear as well as bank memory accessing are supported. • Bit manipulation instructions and bit test and branch instructions can be used for memory and 1/0 accessing of the entire 16M bytes space. • Block transfer instruction capable of handling blocks of up to 64K bytes each. • Improved stack accessing capability. • Decimal arithmetic instruction execution requiring no software compensation. The performance of the systems based on the Series MELPS 7700 microcomputers, whether used as advanced 8-bit microcomputer or next-generation 16-bit one. Register Configuration 2. Register Configuration The central processing unit (CPU) of each Series MELPS 7700 microcomputer has 1O internal registers (See Fig.2.1). Each of these registers is described below 2.1 Accumulator (Ace) (1) Accumulator A (A) The accumulator A is the main register of the microcomputer, and data processing such as arith- metic calculations, data transfer and input/output operations are executed via this accumulator. It consists of 16-bit register, but it can be used as an 8-bit register by setting the data length se- lection flag m in the processor status register PS. The flag m is described in detail in a later sec- tion. The flag m value of "O" specifies 16-bit data length, and "1" specifies 8-bit data length. When operating under 8-bit data length setting, only the lower 8 bits of the accumulator A are used and the upper 8 bits do not change. (2) Accumulator B (B) The accumulator B is a 16-bit register whose function is equivalent to that of the accumulator A. The Series MELPS 7700 instructions can use the accumulator B instead of the accumulator A. Note, however, that use of the accumulator B requires more instruction bytes and execution cycles than when using the accumulator A. 2.2 Index Register X (X) The index register X is a 16-bit register, but it can be used as an 8-bit register by setting the index register length selection flag x in the processor status register PS. The flag x is described in detail in a later section. The flag x value of "O" specifies 16-bit index register length, and "1" specifies 8-bit index register length. When operating under 8-bit index register length setting, only the lower 8 bits of the index register X are used and the upper 8 bits do not change. In an addressing mode in which the index register X is used as the index register, the address obtained by adding the contents of this register is accessed. For the block transfer instructions, MVP and MVN, the contents of the index register X become the lower 16 bits of the transfer-from address and the byte-3 of the instruction becomes the upper 8 bits. 2.3 Index Register Y (Y) The index register Y is a 16-bit register whose function is equivalent to that of the index register X. As in the case of the index register X, the index register length selection flag x can be used to use only the lower 8 bits of the index register Y. For the block transfer instructions, MVP and MVN, the contents of the index register Y become the lower 16 bits of the transfer-to address and the byte-2 of the instruction become the upper 8 bits. 2 Register Configuration b15 b8 b7 bO I b15 AH I b8 b7 AL I bO Accumulator A (A) I b15 BH I b8 b7 BL I bO Accumulator B (B) I b15 XH I b8 b7 XL I bO Index Register X (X) I b15 YH I b8 b7 YL I bO Index Register Y (Y) b7 I bO SH I SL I Stack Pointer (S) I OT I b15 b8 b7 bO Data Bank Register (DT) b7 I PG bO PCH I PCL I Program Counter (PC) I Program Bank Register (PG) b15 b8 b7 bO I b15 DPRH I DPRL b8 b7 bO I Direct Page Register (DPR) l. ____ I _j PSH I PSL I Processor Status Register (PS) L - - - - - - - - - -b;;l b15 b10 b8 b7 0 I 0 I0 0 0 IPL N v m x D z c L Carry Flag Zero Flag Interrupt Disable Flag Decimal Operation mode Flag Index Register Length Selection Flag Data Length Selection Flag - - Overflow Flag L_ Negative Flag - - Processor Interrupt Priority Level Fig. 2.1 CPU Register Model 3 Register Configuration 2.4 Stack Pointer (S) The stack pointer (S) is a 16-bit register, and it is used when calling a subroutine, at the time of interrupt processing and when using one of the stack addressing modes. The contents of the stack pointer specifies the address (stack area) where the memory (RAM) registers that must be saved are to be stored. When an interrupt is received, the contents of the program bank register are saved at the address specified by the stack pointer's value, and the stack pointer's value is decremented by 1. Similarly, the contents of the program counter and the processor status register are saved in the order of lower bytes first (PCH, PCL, PSH, PSL). Thus, the value of the stack pointer after an interrupt has been accepted will be 5 less than the value before the interrupt acceptance. When the interrupt processing is completed and the control is returned to the original routine, the registers that had been saved to the stack area are restored in the reverse order of the saving operation, and the stack pointer's value is restored to that before the interrupt was accepted. Similar operations are executed when a subroutine is called, except that the processor status register (and the program bank register for some addressing modes) is not saved. The registers other than those indicated above are not saved when an interrupt is invoked or when a subroutine is called, so that provisions must be made in the application programs to save the registers if necessary. Also note that the stack pointer must be initialized after the microcom- puter is reset, because its content is indeterminable after reset operation. Normally, the highest address of the internal RAM is set in the stack pointer. The contents of the stack area will change by nesting of subroutines and acceptance of multiple interrupts, so that the subroutine nesting levels must be chosen carefully so as not to destroy the integrity of RAM data. 2.5 Program Counter (PC) The program counter (PC) is a 16-bit register that contains the lower 16-bit values of the 24-bit program memory address of the instruction to be executed next. 2.6 Program Bank Register (PG) The program bank register (PG) is an 8-bit register that contains the upper 8-bit (bank) value of the 24-bit program memory address of the instruction to be executed next. When a carry is gen- erated by incrementing of the program counter's content or when a carry or borrow is generated by addition or subtraction of an offset value to the program counter's content by execution of a branching instruction, for example, the program bank register's content is automatically incre- mented or decremented by 1 so that the bank boundary needs not be considered for application programming. b23 b15 b7 bO PG PCH PCL b7 bO b15 b8 b7 bO 4 Register Configuration 2.7 Data Bank Register (DT) The data bank register (DT) is an 8-bit register. Its contents are interpreted as the upper 8 bits (bank) of a 24-bit memory address under certain addressing modes. 2.8 Direct Page Register (DPR) The direct page register (DPR) is a 16-bit register, which allows specification of a 256 byte space called a direct page in bank-0. This area can be accessed by 2 bytes in the direct page addressing mode. The contents of the direct page register specify the least-significant (base) address of the direct page area. A value in the range of 016-FFFF16 may be set in the direct page register. When a value of or higher than FF011s is set in the direct page register, the direct page area will cross over the bank-0 and bank-1 boundary. Normally, the lower 8-bit value of the direct page register is set to 0016 since that reduces the number of cycles required for address genera- tion. 00000016 00000016 OOOOFF16 J Wheo DPR=OOOO,o Bank-0 00012316 00022216 J Wheo DPR=0123rn (Note 1) Direct page area OOFFFF16 01000016 OOFFD61s 01 OFD516 J Wheo tlPR=FF06,. (Nole 2) Bank-1 I (Note 1) Cycles-count is incremented by 1 when the lower 8-bit of DPR is not 001s. (Note 2) Direct page is specified across bank-0 and bank-1 when DPR value is FF0116 or higher. Fig. 2.2 Setting Direct Page by Direct Page Register 5 Register Configuration 2.9 Processor Status Register (PS) The processor status register (PS) is an 11-bit register, and it consists of flags that specify the status immediately after operation and bits that set the processor interrupt priority level. The C, Z, V and N flags enable execution of branching instructions depending on the flag values. Each bit of the processor status register is explained below. bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 I0 I0 I0 I0 I0 I IPL IN Iv Iml xIDi I IzIcl Processor Status Register (PS) (Note) Bits 11-15 are fixed at 0. [Bit-0] Carry Flag (C) This bit is the carry flag which holds the carry or borrow from the arithmetic logic unit (ALU) after arithmetic operation. It is also affected by the shift and rotate instructions. This flag can be directly set by the SECand SEP, and cleared by CLC and CLP instructions. [Bit-1] Zero Flag (Z) This bit is set 1 when the arithmetic operation or data transfer result is 0, and it is set 0 when such result is not "O". This flag is invalid for addition (ADC) instruction in the decimal-operation ~. This flag can be directly set by SEP and cleared by CLP instructions. [Bit-2] Interrupt Disable Flag (I) This is the flag that is used to disable all interrupts (except the interrupts by the watchdog timer, BAK instruction and division by zero). When this flag is "1 ", interrupts are disabled. This flag is set to "1" automatically when an interrupt is accepted, inhibiting multiple interrupt acceptance. This flag can be set using the SEI and SEP, and cleared using the CLI and CLP instructions. [Bit-3] Decimal Operation Mode Flag (D) This flag is used to determine whether to execute addition and subtraction in the binary-mode or in the decimal-mode. "O" specifies the ordinary binary mode. When this flag is set to "1 ", ad- dition/subtraction is executed with 1 word as a 2- or 4-digit decimal value (2- or 4-digit selection is made by the data length selection flag m). Decimal alignment is performed automatically. Note that decimal-mode can be used only by the ADC and SBC instructions. This flag can be set by the SEP and cleared by the CLP instructions. Because this flag directly affects arithmetic operation it must be initialized whenever the micro- computer is reset. [Bit-4] Index Register Length Selection Flag (x) This flag specifies whether to use the index register X or Y in the 16-bit index register length or in the 8-bit index register length. "O" specifies the 16-bit length mode, and "1" specifies the 8- bit length mode. This flag can be set by the SEP, and cleared by the CLP instructions. 6 Register Configuration [Bit-5) Data Length Selection Flag (m) This flag specifies whether to use the 16-bit data length or the 8-bit data length. "O" specifies 16-bit, and "1" specifies 8-bit data length. This flag can be set by the SEM and SEP, and cleared by the CLM and CLP instructions. [Bit-6) Overflow Flag (V) The overflow flag has a meaning when adding or subtracting 1 word as a signed binary number. This flag is set 1 when the flag m is set to "O" and the result of addition or subtraction is outside the range -32768-+32767, and it is set 0 otherwise. When the flag m is set to "1", this flag is set 1 if the result of addition or subtraction is outside the range -128-+127 and set Ootherwise. This flag can be directly set by the SEP, and cleared by the CLV and CLP instructions. This flaQ is meaninQless in the decimal operation mode. [Bit-7) Negative flag (N) The negative flag (N) is set 1 when the result of data transfer is negative (bit-15 of data is "1" when the flag mis "O", or bit-7 of data is "1" when the flag mis "1"), and it is set O otherwise. This flag can be directly set by the SEP, and cleared by the CLP instructions. This flaQ is meaninQless in the decimal operation mode. [Bit-8-Bit-1 OJ Processor interrupt priority level (IPL0-IPL2) The processor interrupt priority level (IPL) consists of 3 bits, and these 3 bits enable determination of 8 processor interrupt priority levels (level-0 - level-7). An interrupt is allowed only when its interrupt priority level is higher than the IPL value. When an interrupt is generated, IPL is saved to the stack area, and the priority level of the allowed interrupt is set in IPL. There is no instruction that can directly set or clear IPL0-IPL2. Therefore, in order to alter the IPL contents, the desired value must be first stored in the stack and then the processor status register contents altered using the PUL or PLP instruction. 7 Addressing Modes 3. Addressing Modes 3.1 Addressing Mode When executing an instruction, the address of the memory location from which the data required for arithmetic operation is to be retrieved or to which the result of arithmetic operation is to be stored must be specified in advance. Address specification is also necessary when the control is to jump to a certain memory address during program execution. Addressing refers to the method of specifying the memory address. The Series MELPS 7700 microcomputers support 28 different addressing modes, offering ex- tremely versatile and powerful memory accessing capability. 3.2 Explanation of Addressing Modes Each of the 28 addressing modes is explained on the pages indicated below: Implied addressing mode 9 Immediate addressing mode 10 Accumulator addressing mode 11 Direct addressing mode 12 Direct bit addressing mode 13 Direct indexed X addressing mode 14 Direct index~d V addressing mode 16 Direct indirect addressing mode 17 Direct indexed X indirect addressing mode 18 Direct indirect indexed V addressing mode 21 Direct indirect long addressing mode 24 Direct indirect long indexed V addressing mode 25 Absolute addressing mode 28 Absolute bit addressing mode 30 Absolute indexed X addressing mode 31 Absolute indexed V addressing mode 33 Absolute long addressing mode 35 Absolute long indexed X addressing mode 36 Absolute indirect addressing mode 37 Absolute indirect long addressing mode 38 Absolute indexed X indirect addressing mode 39 Stack addressing mode 40 Relative addressing mode 42 Direct bit relative addressing mode 43 Absolute bit relative addressing mode 45 Stack pointer relative addressing mode 47 Stack pointer relative indirect indexed V addressing mode 48 Block transfer addressing mode 50 8 Implied Mode Implied addressing mode Function The single-instruction inherently address an internal register. Instruction : BRK, CLC, CLI, CLM, CLV, DEX, DEY, INX, INY, NOP, RTI, RTL, ATS, SEC, SEI, SEM, STP, TAD, TAS, TAX, TAY, TBD, TBS, TBX, TBY, TOA, TDB, TSA, TSB, TSX, TXA, TXB, TXS, TXY, TYA, TYB, TYX, WIT, XAB ex. : Mnemonic Machine Code CLC 1815 c PSI I I I I I I I I I I I I I I I l PSI I I I I I I I I I I I I I I I 0 I ex. : Mnemonic Machine Code ex. : Mnemonic Machine Code TXA BA 16 TXA 8A16 (m=1,x=O) (m = 0, x = 1) x x The upper-byte is not transferred A Al 0 0 0 0 0 0 0 0 (Note) When the data length differ between the transfer-from and trans- fer-to locations, data is transferred at the data length for the transfer-to location. If, however, the index register is specified as the transfer-to location and the x flag is set to 1, 0016 is sent as the upper byte value. 9 Immediate Mode Immediate addressing mode Function A portion of the instruction is the actual data. Such instruction code may cross over the bank boundary. Instruction : ADC, AND, CLP, CMP, CPX, CPY, DIV, EOR, LDA, LDT, LDX, LDY, MPV, ORA, RLA, SBC, SEP ex. : Mnemonic Machine Code ex. : Mnemonic Machine Code ADC A,#OASH 6916 A515 ADC A, # OA587H 6916 87 16 A5 16 (m= 1) (m=O) Memory Memory ,,... !--------- - ~ 0000,. ~ 0000,. Program Program bank-PG bank-PG 8-bit width Op Code (69 16 ) Operand (87 16 ) A-A+C+ lAs,.1 ~ Op Code (6916 ) Operand (AS 16 ) Program Bank Register A-A+ c +I 16-bit width As,. i 81,.1- { Program ,___O_p_e-ra_n_d_(A-5-,.-)--1 Bank Register t---- - -- -- ~ FFFF16 ~ FFFF16 ....... - ex. : Mnemonic Machine Code ex. : Mnemonic Machine Code LOX #OASH A21 6 A5 16 LOX #OA587H A215 8716 A515 . (x =1) (x = 0) Memory Memory - - ......, ("'" - - t----- - -----1 ~ 0000,. 1------ -- ~ 0000,. Program bank-PG Program Op Code (A2 16 ) bank-PG 16-bit width 8-bit width x.._ I As, 0 I~ Op Code (A2 16 ) Operand (AS 16 ) Program Bank Register x-IAs, ! 0 87,. 1-{ Operand (87 16 ) Operand (A5 16 ) Program Bank Register ~ FFFF 16 1-------i t--=._--- ---1 ~ FFFF16 - 1 (} Accumulator Mode Accumulator addressing mode Function The contents of accumulator are the actual data. Instruction : ASL, DEC, INC, LSR, AOL, ROA ex. : Mnemonic Machine Code AOL A 2A1e (m = 1) Lffi" I I ~~ Carry flag Accumulator A ex. : Mnemonic Machine Code AOL A 2A1 6 (m=O) Carry flag Accumulator A 11 Direct Mode Direct addressing mode Function The contents of the bank-0 memory location specified by the result of adding the sec- ond byte of the instruction to the contents of the direct page register become the ac- tual data. If, however, addition of the instruction's second byte to the direct page register's contents result in a value that exceeds the bank-0 range, the specified lo- cation will be in bank-1. Instruction : ADC, AND, ASL, CMP, CPX, CPY, DEC, DIV, EOR, INC, LOA, LDM, LOX, LOY, LSR, MPV, ORA, ROL, ROR, SBC, STA, STX, STY ex. : Mnemonic Machine Code ex. : Mnemonic Machine Code ADC A,02H SS15 0215 ADC A,02H ss,. 02,. (m = 1) (m=O) Memory Memory 0000,. 0000,. Bank-0 A-A+C+ Bank-0 DAT Ac 123S,.-Et----, I DATA I- 1----D_A_TA _ _---I 123s, • ...r---~ I DATAH: DATAc I.,_{ DATAH t-- - - - - - FFFF 16 Direct Page FFFF16 Register t---------1 Op Code (65 16 ) Operand (02 16 ) + ~=123S,. ...- - - _,,, Direct Page Op Code (S5 16 ) Register 1---0_p_e_ra_n_d_(o_2_ 10_)---1 + ~ = 123S16 ex. : Mnemonic Machine Code ex. : Mnemonic Machine Code LOX 02H AS 16 02 16 LOX 02H AS 16 02 16 (x = 1) (x = 0) Memory Memory 0000,. 0000,. Bank-0 Bank-0 DATA 123S,. - - - - - - ; x-1 DATAH: DATAc 1~{ DAT Ac DAT Ac 123S,.<8-----~ FFFF 16 !--------; FFFF16 1---------1 [' Direct Page Direct Page Register Op Code (AS 16 ) Register Op Code (AS 16 ) Operand (02,.) + ~=123S,. Operand (02 16 ) + ~=1236,. _,,. .... 12 Direct Bit Mode Direct bit addressing mode Function Specifies the bank-0 memory location by the value obtained by adding the instruc- tion's second byte to the direct page register's contents, and specifies the positions of multiple bits in the memory location by the bit pattern in the third and fourth bytes of the instruction (third byte only when the m flag is set to 1). If, however, addition of the instruction's second byte to the direct page register's contents result in a value that exceeds the bank-0 range, the specified location will be in bank-1. Instruction CLB, SEB ex. : Mnemonic Machine Code ex. : Mnemonic Machine Code CLB #SAH, 04H 1416 0416 SA 16 CLB #SAA5H, 04H 1416 0416 AS 16 SA 16 (m= 1) (m=O) Memory Memory ?J "Jt'l?l"J'l" 001238,. Bank-0 001238,. Bank-0 !-------- ------- Direct Page Op Code (14 16 ) Register Direct Page Operand (04 16 ) + ~=1238,. Op Code (14,.) Register Operand (5A 16 ) Operand (04 16 ) + ~= 123816 Operand ( A5 16 ) ...... - ...... Operand ( 5A 16 ) J 13 Direct Indexed X Mode Direct indexed X addressing mode Function The contents of the bank-0 memory location specified by the result of adding the second byte of the instruction, the contents of the direct page register and the con- tents of the index register X become the actual data. If, however, addition of the instruction's second byte, the direct page register's contents and the index register X's contents results in a value that exceeds the bank-0 or bank-1 range, the specified location will be in bank-1 or bank-2. Instruction : ADC, AND, ASL, CMP, DEC, DIV, EOR, INC, LDA, LDM, LDY, LSR, MPV, ORA, ROL, ROR, SBC, STA, STY ex. : Mnemonic Machine Code ex. : Mnemonic Machine Code ADC A,1EH,X 7515 1E15 ADC A,1EH,X 7516 1 E1s (m = 1, x = 1) (m = o, x = 1) Memory Memory 0000,. 0000,. Bank-0 Bank-0 A-A+C+ 1338,.'fJ BE00 16 ..;---- v - v - DATA" - 33 Absolute Indexed Y ex. : Mnemonic Machine Code ex. : Mnemonic Machine Code LOX OBC12H, Y BE16 1216 BC16 LOX OBC12H, Y BE 16 12 16 BC,6 (x=1) (x=O) - Memory _...., ,.... Memory - 1---------j 1-------- Index Index Op Code ( BE 16 ) Register Y Op Code (BE 16 ) Register Y Operand (12 16 ) +I ! EE,. \ =BDOO,, Operand ( 12 16 ) Operand (BC 16 ) +~=CD00 16 Operand (BC 16 ) 1-------- t------- 1---------j 1--------~ Data Bank Data Bank Register _ Register ~BD0010 I~ { DATA @!._]cooo,. 1---------j X -I DATAH : DATAc DAT Ac DAT AH ...... ..... ,,.... 34 Absolute Long Mode Absolute long addressing mode Function The contents of the memory locations specified by the instruction's second, third and fourth bytes become the actual data. Note that, in the cases of the JMP and JSR instructions, the instructions' second and third byte contents are transferred to the program counter and the fourth byte contents are transferred to the program bank register. Instruction : ADC, AND, CMP, DIV, EOR, JMP, JSR, LDA, MPV, ORA, SBC, STA ex. : Mnemonic Machine Code ex. : Mnemonic Machine Code ADC A, 123456H 6F 16 56, 6 341s 121s ADC A, 123456H 6F1a 561s 341s 121s (m=1) (m=O) ,... t----- -- -- Memory Op Code (6F 16 ) r- Memory t----------j Op Code (6F 16 ) }- Operand (56 16 ) Operand (56 16 ) Operand (3416 ) Operand ( 3416 ) Operand ( 1216 ) \ Operand (12 16 ) t-------- t------ ;:: t---------j 1------- -- DATA 12345616 DATA, 123456,. A-A+c+I DATA": DATA,,.,__ { DAT AH ....... .... ex. : Mnemonic Machine Code JMP 123456H 5C1 6 5616 341s 121 6 Memory ,.... - 1--------j Op Code (SC, 6 ) Operand (56 16 ) Operand (34 16 ) Operand (12 16 ) r- _ _ _ _ _ _, t-------1 Program Bank Register Address to be @;]345&,. executed next. - .... Program bank register contents are replaced by the third operand. 35 Absolute Long Indexed X Mode Absolute long indexed X addressing mode Function The contents of the memory location specified by adding the numeric value ex- pressed by the instruction's second, third and fourth bytes with the contents of the index register X are the actual data. Instruction : ADC, AND, CMP, DIV, EOR, LDA, MPV, ORA, SBC, STA ex. : Mnemonic Machine Code ex. : Mnemonic Machine Code ADC A, 123456H, X 7F16 56 16 34 16 1216 ADC A, 123456H, X 7F16 5616 3416 1216 (m=1, x=1) (m=O, x=1) Memory Memory ,.....- 1--- - - ---1 Op Code (7F 16 ) Operand (56,.) t---O-'-p_e_ra_nd_(3_4cc:10_l--l Operand ( 12 16 ) l Index Register X + [~=123537 16 Op Code (7F 16 ) Operand ( 56,.) ,___o_:_p_er_a_nd_(3_4,-'-o_)__. 1---0-'-p_er_a_nd_(1_2:1::.o_l--l ) + j Index Register X [ E1,. j =12353716 t---------1 1--------i 1-- - - - ----" A~A+C+ DATA 123537,. I DATA" : DATA, l+- {1----~A-A~-:-"~---I 123537,. - _..) ex. : Mnemonic Machine Code ex. : Mnemonic Machine Code ADC A, 123456H,X 7F16 5616 34 16 1216 ADC A, 123456H, X 7F16 5616 3416 1216 (m=O, x=1) !--------- Memory ....., (m=O, x=O) !--------__; _ Memory __..,. l l Op Code (7F 16 ) Index Op Code (7F 16 ) Index Register X Operand (56 16 ) Register X Operand (56 16 ) Operand (34 16 ) +I EEE1,. I =132337,. Operand (34 16 ) +I EEE1,. I=132337,. Operand (12 16 ) Operand (12 16 ) 1------- 1-------- 1------- 1--------- DATA 132337,, I DATA" i DATA, I - { DATA, 132337,. -E'--___J - _..,.... A~A+c+ i.-- DATA" - __.) 36 Absolute Indirect Mode Absolute indirect addressing mode Function The instruction's second and third bytes specify 2 adjacent bytes in memory, and the contents of these bytes specify the address within the same program bank to which a jump is to be made. Instruction: JMP ex. : Mnemonic Machine Code JMP(1400H) 6C 16 0016 14, 6 Memory ,....- _....., t--------j Op Code (6C 16 ) Operand (00 16 ) Operand (14 16 ) Program bank-PG DATA I (FF 16 ) ~ 1400,. } DATA II (1E 16 ) Address to be Program Bank Register ~I executed next ~ 1EFF16 t----------j i--- - 37 Absolute Indirect Long Mode Absolute indirect long addressing mode Function The instruction's second and third bytes specify 3 adjacent bytes in memory, and the contents of these bytes specify the address to which a jump is to be made. Instruction: JMP ex. : Mnemonic Machine Code JMPL(1234H) DC, 6 34, 6 12 16 - Memory - r-------1 Op Code (DC 16 ) -{ Operand (34 16 ) Operand (12 16 ) Program Bank Register c___,.. DATA I (12 16 ) 1~123416 DATA II (84 16 ) DATA ill (A1 16 ) j 1------- ~ !------- Program Bank Register - _ Address to be ~8412,. executed next. .... - ........ DATA ill is loaded in the program bank register. 38 Absolute Indexed X Indirect Mode Absolute indexed X indirect addressing mode Function The value obtained by adding the instruction's second and third bytes and the con- tents of the index register X specifies 2 adjacent bytes in memory, and the contents of these bytes specify the address to which a jump is to be made. Instruction: JMP, JSR ex. : Mnemonic Machine Code JMP(1234H, X) 7C 16 34 16 1216 (x=1) Index - - Memory 1--------1 ....., Register X Op Code (7C 16 ) 246,.= I : 12,.1 + { Operand (34 16 ) Operand ( 12 16 ) DATA I (12 16 ) DATA Il (BC 16 ) 1246,. } Program bank-PG Program Bank Register Address to be §Jec1210 executed next 1---------1 - 39 Stack Mode Stack addressing mode Function Register contents are saved to or restored from the memory location specified by the stack pointer. The stack pointer is set in bank-0. Instruction : PEA, PEI, PER, PHA, PHB, PHO, PHG, PHP, PHT, PHX, PHY, PLA, PLB, PLO, PLP, PLT, PLX, PLY, PSH, PUL ex. : Mnemonic Machine Code ex. : Mnemonic Machine Code PHA 4816 PHA 4815 (m=1) (m=O) Memory Memory Stack Pointer Stack Pointer S-1 0015~ S-2 oo .. [ill:J s AL S-1 AL s AH Bank-0 Bank-0 !------- _.,,.. t------ _.,,.. ex. : Mnemonic Machine Code ex. : Mnemonic Machine Code PHO 0815 PEA j:j: 1234H F4 16 34 16 1216 Memory Memory Stack Pointer S-2 0015~ Stack Pointer S-1 DPRL S-2 oo,.~ s DPRH 3416 Bank-0 Bank-0 12,. 1-------j - _,.,,; Op Code (F4 16 ) Operand (34 16 ) Operand (12 16 ) 40 Stack ex. : Mnemonic Machine Code ex. : Mnemonic Machine Code PEI # 12H 04,. 12,. PER# 1234H 62,. 34,. 12,. Memory Memory Stack Pointer S-2 oo,.~ DATA I 341216 -----+-~ S-1 AC 16 ~ DATA II s 68,. Bank-0 Stack Pointer Bank-0 ~ S-2 001 6 ~ Program S-1 DATA I Bank Register s DATA II Op Code (62 16 ) ~ 5676 16 Program Operand (34 16 ) } bank-PG >---------< 1------- Operand ( 1216 ) + I 56 i 78,. I = ( ...._6s1_,, r\ Ac1/16 Program Counter - ~ !-------- Direct Page Op Code (04 16 ) Register Operand (12 16 ) +~=3412,. I- - - - - --' 41 Relative Mode Relative addressing mode Function Branching occurs to the address specified by the value resulting from addition of the contents of the program counter and the instruction's second byte. In the case of a long branch by the BRA instruction, a 15-bit signed numeric value formed by the con- tents of the instruction's second and third bytes is added to the. program counter con- tents. If the addition generates a carry or borrow, 1 is added to or subtracted from the program bank register. Instruction : BCC, BCS. BEQ, BMI, BNE, BPL, BRA, BVC, BVS ex. : Mnemonic Machine Code BCC *-12 9015 F41s Branches to the address *-12 if the carry flag (C) Advances to the address * if the carry flag (C) has been cleared. has been set Memory Memory - Address to be executed next. Op Code (90 16 ) Op Code (9016 ) Jump Operand ( F4 16 ) Operarid (F4 16 ) Address to be * executed next. * ........ - ex. : Mnemonic Machine Code BRA 1234H 8216 3416 121s - 1-------- -- Memory Op Code (82 16 ) Program Operand (34 16 ) bank-PG Program Operand (12 16 ) Bank Register ~ FF1216 t-------- "'"""'' executed next ( ~1146,. Program bank-PG+1 t----- - - - 42 Direct Bit Relative Mode Direct bit relative addressing mode Function Specifies the bank-0 memory location by the value obtained by adding the instruc- tion's second byte to the direct page register's contents, and specifies the positions of multiple bits in the memory location by the bit pattern in the third and fourth bytes (the third byte only if the m flag is set to 1). Then, if the specified bits all satisfy the branching conditions, the instruction's fifth byte (or the fourth byte if the m flag is set to 1) is added to the program counter as a signed value, generating the branching destination address. If, however, addition of the instruction's second byte to the direct page register's contents result in a value that exceeds the bank-0 range, the specified location will be in bank-1. Instruction : BBC, BBS ex. : Mnemonic Machine Code BBS # 5AH, 04H, OF6H 2416 04 16 5A16 F6 16 (m=1) Memory Memory 001238,, Bank-0 ol ol1[1l1J 0J 1J 1 001238,. Bank-0 ----- 1---------1 Program Bank Register Address to be executed next '11 16 FFFD, 6 ----- 1-------- Direct Page Direct Page Jump Op Code (24 16 ) Register Op Code (24 16 ) Register Operand ( 04 16 ) + 11234,.1=1238,. Operand (04 16 ) + 11234,.1=1238,. Operand (SA 16 ) Program Operand (SA, 6 ) Program Operand (F6 16 ) Bank Register Operand (F6 16 ) Bank Register Address to be ~ 0001,. ~0001,. executed next (Branch) - I Not branch) 43 Direct Bit Relative ex. : Mnemonic Machine Code BBS :It SAASH, 04H, OFSH 24,. 04,. As,. SA,. Fs,. (m=O) Memory Memory 00123810 0J1l1l oTol 111] 1 001238,. Bank-0 OJ:1Tol1T1lo11]1 ----- I----~-- Program Bank Register Address to be executed next. ~ FFFE 16 ----- 1--------1 Direct Page Direct Page Op Code (24 16 ) Register Op Code (24 16 ) Register Jump Operand (04 16 ) + j 123416 j= 123816 Operand ( 04 16 ) + 11234,.1=1238,. Operand (AS 16 ) Operand (AS 16 ) Operand (SA 16 ) Operand (SA, 6 ) Program Program Operand (F6 16 ) Bank Register Operand (FS, 6 ) Bank Register Address to be ~ 0008 16 executed next. ~0008 16 (Branch) ...... (Not branch) 44 Absolute Bit Relative Mode Absolute bit relative addressing mode Function The instruction's second and third bytes and the contents of the data bank register specify the memory location, and data for the memory location's multiple bits is specified by a bit pattern in the instruction's fourth and fifth bytes (the fourth byte only if the m flag is set to 1). Then, if the specified bits all satisfy the branching conditions, the instruction's sixth byte (or the fifth byte if the m flag is set to 1) is added to the program counter as a signed value, generating the branching destination address. Instruction : BBC, BBS ex. : Mnemonic Machine Code BBS # 5AH, 1234H, OF6H 2C 16 34 16 121 s 5A16 F615 (m=1) Memo~ Memo~ ...... 1------- Pro-gram Bank Register Address to be 1----------l ~ FFFD, 6 executed next r--------1 Op Code (2C 16 ) Op Code (2C 16 ) Jump Operand (34 16 ) Operand (34 16 ) Operand (12 16 ) Operand (12 16 ) Operand I SA 16 ) Program Operand (SA 16 ) Program Operand ( F6 16 ) Bank Register Operand (f6 16 ) Bank Register Address to be ~0007,. ~0007,. executed next. t----------1 ----- r------- ----- Data Bank Data Bank Register Register 010111111101110 @!]1234,. @!.J 1234,. ...... (Branch) (Not branch) 45 Absolute Bit Relative ex. : Mnemonic Machine Code BBS lt5AA5H, 1234H, OF6H 2C1s 3415 1215 A51s 5A15 F6 16 (m=O) Memory Memory ----- I------- - Program Bank Register Address to be executed next. ~FFFD 16 1------- ----- Op Code (2C16 ) Op Code (2C 16 ) Operand (34 16 ) Jump Operand (34 16 ) Operand (12 16 ) Operand (12 16 ) Operand (AS16 ) Operand (AS 16 ) Operand (SA 16 ) Program Operand (SA16 ) Program Operand (F6 16 ) Bank Register Operand (F6 16 ) Bank Register Address to be I- ~0001,. §;_]0001,. executed next. ----- 1------- 1-------- Data Bank Data Bank Register Register ~ 1234,. oJ oEFI Of iJ oJ 1 ~1234,. 1J1JoJ1_EI1J1Jo (Branch) - (Not branch) 46 Stack Pointer Relative Mode Stack pointer relative addressing mode Function The contents of a bank-0 memory location specified by the value resulting from ad- dition of the instruction's second byte and the contents of the stack pointer become the actual data. If, however, the value obtained by adding the contents of the instruc- tion's second byte and the stack pointer's contents exceeds the bank-0 range, the specified location will be in bank-1. Instruction : ADC, AND, CMP, DIV, EOR, LOA, MPV, ORA, SBC, STA ex. : Mnemonic Machine Code ex. : Mnemonic Machine Code ADC A, 02H, S 6316 02,. - ADC A, 02H, S 63,. 02,. (m=1) (m=O) Memory Memory Bank-0 Bank-0 A-A+C+ DATA 1236,. I DATAH i DATAL I . ,_ { DATA, DATA" 1236,. 1-------- 1-------- } ~ ~ 1------- 1------- Op Code (63 18 ) Stack Pointer Op Code (63 18 ) Stack Pointer Operand (02 18 ) +I 1234i:J=1236,. Operand (02 18 ) +~=1236,. f------- f------- - ... - 47 Stack Pointer Relative Indirect Indexed Y Mode Stack pointer relative indirect indexed Y addressing mode Function The value obtained by adding the instruction's second byte and the contents of the stack pointer specifies 2 adjacent bytes in memory. The value obtained by adding the contents of these bytes and the contents of the index register Y specifies address of the actual data in memory bank-DT (DT is contents of data bank register). If addition of the 2 bytes in memory with the contents of the index register Y generate a carry, the bank number will be 1 larger than the contents of the data bank register. instruction: ADC, AND, CMP, DIV, EOR, LDA, MPV, ORA, SBC, STA ex. : Mnemonic Machine Code ex. : Mnemonic Machine Code ADC A,(1EH, S), Y 7315 1E16 ADC A,(1EH, S), Y 7315 1E16 (m=1, x=1) (m=O, x=1) 1252,. 1253,. Memory DATA I (01 16 ) t--------,.---1 t---D_A_T_A_Il_(1_2-'-' t-------1 16_)--1 }f:::k.-:,egister Y +I · : E&,. J = 12E7,. 1252,. 1253,. Memory DATA I (01 16 ) DATA ]] (12 16 ) t-------1 } + Bank-0 Index Register Y +~=12E7 16 1-------1 t------- Stack Pointer Stack Pointer Op Code (73 16 ) Op Code (73 16 ) 11234,. I+ Operand ( 1 E16 ) I 1234,. J + Operand (1E 16 ) I-------, t---------1 Data Bank t------- A-A+c+ Register I DATAH I DATAL I-{ DATAL [Q!J 12E716 DATAH 48 Stack Pointer Relative Indirect Indexed Y ex. : Mnemonic Machine Code ADC A, (1EH, S), Y 73 1s 1 E1s (m=1,x=O) 1252,. 1253,. Memory DATA l (01 16 ) DATA II (12 16 ) } \fBank-0 ndex Register Y +~=102E7 16 t-------1 ~ t------1 Stack Pointer Op Code (73 16 ) 11234,. I + Operand (1E 16 ) t-------1 ex. : Mnemonic Machine Code ADC A, (1EH, S), Y 73 16 1 E16 (m=O, x=O) Memory ~ Bank-0 Index Register Y 125215 DATA l (01 16 ) } +I FOE6;J = 102E710 1253,. DATA II (12 16 ) ---------; t--------1 Stack Pointer Op Code (73 16 ) I 1234" I + Operand ( 1 E 16 ) t--------j 1-----~--1 Data Bank Register A-A+c+I DATA" i DATAL I~ { DATA, [QI]+ 1, 02E7 16 DATAH I-- ...... - - 49 Block Transfer Mode Block transfer addressing mode Function The instruction's second byte specifies the transfer-to data bank, and the contents of the index register Y specify the transfer-to address within the data bank. The instruc- tion's third byte specifies the transfer-from data bank, and the contents of the index register X specify the address in the data bank where the data to be transferred is stored. The contents of the accumulator A constitute the number of bytes to be trans- ferred. Upon termination of transfer, the contents of the data bank register will specify the transfer-to data bank. The MVN instruction is used for transfer to lower address location. In this case, the contents of the index registers X and Y are incre- mented each time data is transferred. The MVP instruction is used for transfer to higher address location. In this case, the contents of the index registers X and Y are decremented each time data is transferred. The block of data to be transferred may cross over the bank boundary. Instruction MVN, MVP ex. : Mnemonic Machine Code MVN OE2H, OESH 541s E21s E51s Before transfer After transfer Memory - Memory 1------- DATA l E25678 16 Bank-E2rn DATA Il DATA Ill 1------1 1--------1 A~ A@ff;-l Op Code(54 16 ) Operand (E2 16 ) x~ ~~e~~~;~~~~ XI 123715 I Operand ( E5 16 ) Operand ( E5 16 ) v I s61s,. 1 v I s61s,. I OTC] OT~ 1-------j ~ 1--------1 DATA l E51234 16 DATA l DATA Il DATA Il DATA Ill Bank-ES" DATA Ill 1 - - - ----1 - - 50 Block Transfer ex. : Mnemonic Machine Code MVP OESH, OE2H 44 16 E5 16 E216 Before transfer After transfer Memory Memory ,... 1-------- - DATA I DATA ] DATA II Bank-E2, 6 DATA II DATA Ill E2S67A 16 DATA Ill !-------- '! - - - - - - - - A I 0003,. I A/ FFFF 16 Op Code(44 16 ) x I S67A,. I Op Code(44 16 ) x1 5677,. Operand ( ES 16 ) y~ Operand ( ES 16 ) v/ 1233,, Operand ( E2 16 ) OT CJ Operand (E2 16 ) DT~ 1---- - - -- t------- DATA I DATA II Bank-E516 DATA Ill ES1236 16 1-------- ..... - 51 Instructions 4. Instructions 4.1 Instruction Set The Series MEL PS 7700 microcomputers support a set of 103 instructions which are de- scribed in this chapter. This section presents overviews of these instructions, and Sec. 4.2 presents the detailed description for each instruction. 4.1.1 Data Transfer Instructions The data transfer instructions move data between data and registers, between a register and the memory, between registers or between memory devices. The following table summarizes the various data transfer instructions supported by the Series MELPS 7700: Category Instruction Description Load LOA Loads the contents of memory into the accumulator. LDM Loads an immediate value into the memory. LDT Loads an immediate value into the data bank register. LOX Loads the contents of memory into the index register X. LOY Loads the contents of memory into the index register Y. Store STA Stores the contents of the accumulator in the memory. STX Stores the contents of the index register X in the memory. STY Stores the contents of the index register Y in the memory. Transfer TAX Transfers the contents of the accumulator A to the index register X. TXA Transfers the contents of the index register X to the accumulator A. TAY Transfers the contents of the accumulator A to the index register Y. TYA Transfers the contents of the index register Y to the accumulator A. TSX Transfers the contents of the stack pointer to the index register X. TXS Transfers the contents of the index register X to the stack pointer. TAD Transfers the contents of the accumulator A to the direct page register. TOA Transfers the contents of the direct page register to the accumula- tor A. TAS Transfers the contents of the accumulator A to the stack pointer. TSA Transfers the contents of the stack pointer to the accumulator A. TBD Transfers the contents of the accumulator B to the direct page reg- ister. TDB Transfers the contents of the direct page register to the accumulator 8. TBS Transfers the contents of the accumulator B to the stack pointer. 52 Instructions Category Instruction Description Transfer TSB Transfers the contents of the stack pointer to the accumulator B. TBX Transfers the contents of the accumulator B to the index register X. TXB Transfers the contents of the index register X to the accumulator B. TBY Transfers the contents of the accumulator B to the index register Y. TYB Transfers the contents of the index register Y to the accumulator B. TXY Transfers the contents of the index register X to the index register Y. TYX Transfers the contents of the index register Y to the index register x. MVN Transfers a block of data from the lower addresses. MVP Transfers a block of data from the higher addresses. Stack operation PSH Saves the contents of the specified register to the stack. PUL Restores the contents of stack to the specified register. PHA Saves the contents of the accumulator A to the stack. PLA Restores the contents of stack to the accumulator A. PHP Saves the contents of the program status register to the stack. PLP Restores the contents of stack to the program status register. PHB Saves the contents of the accumulator B to the stack. PLB Restores the contents of stack to the accumulator B. PHO Saves the contents of the direct page register to the stack. PLO Restores the contents of stack to the direct page register. PHT Saves the contents of the data bank register to the stack. PLT Restores the contents of stack to the data bank register. --- PHX Saves the contents of the index register X to the stack. PLX Restores the contents of stack to the index register X. PHY Saves the contents of the index register Y to the stack. --- PLY Restores the contents of stack to the index register Y. Stack PHG Saves the contents of the program bank register to the stack. PEA Saves a the numeric of 2 bytes to the stack. PEI Saves the contents of 2 consecutive b~tes in the direct page area to the stack. PER Saves the result of adding a 16-bit numeric value to the program counter contents to the stack. Exchange XAB Swaps the contents of the accumulator A with the contents of the accumulator B. 53 Instructions 4.1.2 Arithmetic Instructions The arithmetic instructions perform addition, subtraction, multiplication, division, logical operation, comparison, rotation and shifting of register and memory contents. The following table summarizes the arithmetic instructions supported: Category Instruction Description Addition ADC Adds the contents of the accumulator.the contents of memory and the contents of the carry flag. Subtraction SBC Subtracts the complements of the contents of memory and carry Multiplication flag from the contents of the accumulator. Division INC Increments the accumulator or memory contents by 1. DEC Decrements the accumulator or memory contents by 1. INX Increments the contents of the index. register X by 1. DEX Decrements the contents of the index register X by 1. ll')IY Increments the contents of the index register Y by 1. DEY Decrements the contents of the index register Y by 1. MPY Multiples the contents of the accumulator A and the contents of memory. DIV Divides the numeric value whose lower byte is the contents of the accumulator A and upper byte is the contents of the accumulator B by the contents of memory. Logical operation AND Performs logical AND between the contents of the accumu- later and the contents of memory. ORA Performs logical OR between the contents of the accumulator and the contents of memory. EOR Performs logical exclusive-OR between the contents of the accumu- later and the contents of memory. Comparison CMP Compares the contents of the accumulator with the contents of memory. -- CPX Compares the contents of the index register X and the contents of memory. CPY Compares the contents of the index register Y and the contents of memory. Shifting, Lotation ASL Shifts the contents of the accumulator or memory to the left by 1 bit. LSR Shifts the contents of the accumulator or memory to the right by 1 bit. ROL Links the contents of accumulator or memory with the carry flag, and rotates the result to the left by 1 bit. ROR Links the contents of accumulator or memory with the carry flag, and rotates the result to the right by 1 bit. RLA Rotates the contents of the accumulator A to the left by the speci- lied number of bits. 54 Instructions 4.1.3 Bit Manipulation Instructions The bit manipulation instructions set the specified bits of the processor status register or memory to "1 '' or "O". The following table summarizes the bit manipulation instructions supported: Category Instruction Description Bit manipulation CLB Clears the specified memory bit to "O". SEB Sets the specified memory bit to "1 ". CLP Clears the specified bit of the processor status register's lower byte (PSL) to "O". SEP Sets the specified bit of the processor status register's lower byte (PSL) to "1 ". 4.1.4 Flag Manipulation Instructions The flag manipulation instructions set to "1" or clear to "O" the C, I, m and V flags. The following table summarizes the flag manipulation instructions supported: Category Instruction Description Flag setting CLC Clears the contents of carry flag to "O". SEC Sets the contents of carry flag to "1 ". -~------~--- CLM Clears the contents of data length selection flag to "O". SEM Sets the contents of data length selection flag to "1 ". CLI Clears the contents of interrupt disable flag to "O". SEI Sets the contents of interrupt disable flag to "1 ". CLV Clears the contents of overflow flag to "O". 4.1.5 Branching and Return Instructions The branching and return instructions enable changing the program execution sequence. The following table summarizes the branching and return instructions: Category Instruction Description Jump JMP Sets a new address in the program counter and jumps to the new address. BRA Jumps to the address obtained by adding an offset value to the contents of the program counter. JSR Saves the contents of the program counter to the stack and then jumps to the new address. 55 Instructions Category Instruction Description Branch BBC Causes a branch if the specified memory bits are all "O". BBS Causes a branch if the specified memory bits are all "1 ". -----~ BCC Causes a branch if the carry flag is set to "O". ~- BCS Causes a branch if the carry flag is set to "1 ". BNE Causes a branch if the zero flag is set to "O". BEQ Causes a branch if the zero flag is set to "1 ". BPL Causes a branch if the negative flag is set to "O". BMI Causes a branch if the negative flag is set to "1 ". BVC Causes a branch if Hrn overflow flag is set to "O". -··------- BVS Causes a branch if the overflow flag is set to "1 ". Return RTI Returns from the interrupt routine to the original routine. RTS Returns from a subroutine to the original routine. The program bank register contents are not restored. RTL Returns from a subroutine to the original routine. The program bank register contents are restored. 4.1.6 Interrupt Instruction (Break Instruction) The interrupt ins,truction executes software interrupt. Category Instruction Description Break BRK Executes a software interrupt. 4.1.7 Special Instructions The special instructions listed below control the clock generator circuit. Category Instruction Description Special WIT Stops the internal clock. STP Stops the oscillator. 4.1.8 Other Instruction Category Instruction Description Other NOP Only advances the program counter. 56 Instructions 4.2 Description of Instructions This section describes the Series MELPS 7700 instructions individually. To the extent possible, each instruction is described using one page per instruction. Each instruction description page is headed by the instruction mnemonic, and the pages are arranged in alphabetical order of the mnemonics. For each instruction, operation and description of the instruction, status flag changes and a listing sorted by addressing modes of the assembler coding format (Note 1), machine code, bytes-count and cycles-count (Note 2) are presented. Note1. The assembler coding formats shown are general examples, and they may differ from the actual formats for the assembler used. Please be sure to refer to the mnemonic coding description in the manual for the assembler actually used for programming. Note2. The cycles-counts shown are the minimum possible, and they vary depending on the fol- lowing conditions: • Value of direct page register's lower byte The cycles-count shown are for when the direct page register's lower byte (DPRL) is 001s. When using an addressing mode that uses the direct page register with DPRL'1'"0016", the cycles-count will be 1 more than the value shown. • Number of bytes that have been loaded in the instruction queue buffer • Whether the first address of the memory read/write is even- or odd-numbered in accessing the 16-bit data length. • Accessing of an external memory are with BYTE=1 (using 8-bit external bus) 57 Instructions The table below lists the symbols that are used in this section: Symbol Description Symbol Description c Carry flag DPR Direct page register z Zero flag DPRH Direct page register's upper 8 bits I Interrupt disable flag DPRL Direct page register's lower 8 bits D Decimal operation mode flag PS Processor status register x Index register length selection flag PSH Processor status register's upper 8 bits m Data length selection flag PSL Processor status register's lower 8 bits v Overflow flag PSn Processor status register's n-th bit N Negative flag M Memory contents IPL Processor interrupt priority level M(n) Contents of memory location specified by + Addition operand Subtraction M(S) Contents of memory at address indicated by stack pointer x Multiplication I Division Mn n-th memory location /\ Logical AND AOG Value of 24-bit address' upper 8-bit (A2rA16) v Logical OR ADH Value of 24-bit address' middle 8-bit v Exclusive OR (A1s-As) Negation Value of 24-bit address' lower 8-bit (A7-Ao) ~ Movement to the arrow direction bn n-th bit of data ~ Movement to the arrow direction dd 8-bit offset value H Movement to the arrow direction i Number of transfer bytes or rotation Ace Accumulator ii, i2 Number of registers pushed or pulled ACCH Accumulator's upper 8 bits imm 8-bit immediate value ACCL Accumulator's lower 8 bits imm1, imm2 16-bit immediate value (imm1 specifies the A Accumulator A upper 8-bit,and imm2 specifies the lower 8- AH Accumulator A's upper 8 bits bit) AL Accumulator A's lower 8 bits II 8-bit address value B Accumulator B mmll 16-bit address value (mm specifies the BH Accumulator B's upper 8 bits upper 8-bit and II specifies the lower 8-bit) BL Accumulator B's lower 8 bits hhmmll 24-bit address value (hh specifies the up- per 8-bit, mm specifies the middle 8-bit and x Index register X II specifies the lower 8-bit) XH Index register X's upper 8 bits nn 8-bit data value XL Index register X's lower 8 bits n,, n2 8-bit data value (Used when coding two 8- y Index register Y bit data side by side) YH Index register Y's upper 8 bits rr Signed 8-bit data value YL Index register Y's lower 8 bits mrr2 Signed 16-bit data value (mis the upper 8- s Stack pointer bit value, and mis the lower 8-bit value) PC Program counter PCH Program counter's upper 8 bits PCL Program counter's lower 8 bits REL Relative address PG Program bank register DT Data bank register 58 ADC Add with Carry ADC Operation Ace, C ~ Ace + M + C Description Adds the contents of the accumulator, memory and carry flag, and places the result in the accumulator. Executed as binary addition if the decimal operation mode flag D is set to 0. Executed as decimal addition if the decimal operation mode flag D is set to 1. Status flags IPL: Not affected. N : Set to 1 when bit 15 (or bit 7 if the data length selection flag m is set to 1) of the operation result is 1. Otherwise, cleared to 0. Meaningless for decimal addition. V Set to 1 when binary addition of signed data result in a value outside the range of -32768 to +32767 (-128 to +127 if the data length selection flag mis set to 1). Otherwise, cleared to 0. Meaningless ;or decimal addition. m Not affected. x Not affected. D Not affected. I Not affected. Z Set to 1 when the result of operation is 0. Otherwise, cleared to 0. Meaningless for decimal addition. C When the data length selection flag m is set to 0, set to 1 if binary addition exceeds +65535 or if decimal addition exceeds +9999. Otherwise, cleared to 0. When the data length selection flag m is set to 1, set to 1 if binary addition exceeds +255 or if decimal addition exceeds +99. Otherwise, cleared to 0. Addressing mode Syntax Machine code Bytes Cycles Immediate ADC A, #imm 6916, imm 2 2 Direct ADC A, dd 6516, dd 2 4 Direct indexed X ADC A, dd, X 7516, dd 2 5 Direct indirect ADC A, (dd) 7216, dd 2 6 Direct indexed X indirect ADC A, (dd, X) 6116, dd 2 7 Direct indirect indexed Y ADC A, (dd), Y 7116, dd 2 8 Direct indirect long ADCL A, (dd) 6716, dd 2 10 Direct indirect long indexed Y ADCL A, (dd), Y 7716, dd 2 11 Absolute ADC A, mmll 6D16, II, mm 3 4 Absolute indexed X ADC A, mmll, X 7016, 11, mm 3 6 Absolute indexed Y ADC A, mmll, Y 7916, 11, mm 3 6 Absolute long ADC A, hhmmll 6F16, II, mm, hh 4 6 Absolute long indexed X ADC A, hhmmll, X 7F16, 11, mm, hh 4 7 Stack pointer relative ADC A, nn,S 6316, nn 2 5 Stack pointer relative ADC A, (nn, S), Y 7316, nn 2 8 indirect indexed Y (Note1) This table applies when using the accumulator A. If using the accumulator B, replace "A" with "B". In this case, "4216" is added at the beginning of the machine code, the bytes-count increases by 1 and the cycles-count increases by 2. (Note2) When operating on 16-bit data in the immediate addressing mode with the data length selection flag m set to 0, the bytes-count increases by 1. 59 AND Logical AND AND Operation Ace t- Ace /\ M Description Performs logical AND between the contents of the accumulator and the contents of memory, and places the result in the accumulator. Status flags IPL: Not affected. N Set to 1 when bit 15 (or bit 7 if the data length selection flag m is set to 1) of the operation result is 1. Otherwise, cleared to 0. v Not affected. m Not affected. x Not affected. D Not affected. I Not affected. z Set to 1 when the result of operation is 0. Otherwise, cleared to 0. c Not affected. Addressing mode Syntax Machine code Bytes Cycles Immediate AND A, #imm - 2916, imm 2 2 Direct AND A, dd 2516, dd 2 4 Direct indexed X AND A, dd, X 3516, dd 2 5 Direct indirect AND A, (dd) 3216, dd 2 6 Direct indexed X indirect AND A, (dd, X) 2116, dd 2 7 Direct indirect indexed Y AND A, (dd), Y 3116, dd 2 8 Direct indirect long ANDL A, (dd) 2716, dd 2 10 Direct indirect long indexed Y ANDL A, (dd), Y 3716, dd 2 11 Absolute AND A, mmll 2D16, II, mm .3 4 Absolute indexed X AND A, mmll, X 3D16, II, mm 3 6 Absolute indexed Y AND A, mmll, Y 3916, II, mm 3 6 Absolute long AND A, hhmmll. 2F16, II, mm, hh 4 6 Absolute long indexed X AND A, hhmmll, X 3F16, II, mm, hh 4 7 Stack pointer relative AND A, nn, S 231s, nn 2 5 Stack pointer relative AND A, (nn, S), Y 3316, nn 2 8 indirect indexed Y (Note1) This table applies when using the accumulator A. If using the accumulator B, replace "A" with "8". In this case, "4216" is added at the beginning of the machine code, the bytes-count increases by 1 and the cycles-count increases by 2. (Note2) When operating on 16-bit data in the immediate addressing mode with the data length selection flag m set to 0, the bytes-count increases by 1. 60 ASL Arithmetic Shift Left ASL Operation When m=O b15 bo When m=1 b1 bo Description Shifts all bits of the accumulator or memory one place to the left. Bit 0 is loaded with 0. The carry flag C is loaded from bit 15 (or bit 7 when the data length selection flag m is set to 1) of the data before the shift. Status flags IPL : Not affected. N Set to 1 when bit 15 (or bit 7 if the data length selection flag m is set to 1) of the operation result is 1. Otherwise, cleared to 0. V Not affected. m Not affected. x Not affected. D Not affected. I Not affected. Z Set to 1 when the result of operation is 0. Otherwise, cleared to 0. C Set to 1 when bit 15 (or bit 7 when the data length selection flag m is set to1) before the operation is 1. Otherwise, cleared to 0. Addressing mode I Syntax Machine code 1Bytes Cyclesi Accumulator I ASL A OA16 1 I 2 ' I I Direct ASL dd 0616, dd I 2 7 Direct indexed X i ASL dd, x 1616, dd i 7 I ! 2 Absolute ASL mmll '1 OE16, 11, mm 3 I 7 I Absolute indexed X I I I ASL mmll, X 1E16, 11, mm -'- 3 18 (Note1) The accumulator addressing mode's specification in this table applies when using the accumulator A. If using the accumulator 8, replace "A" with "8". In this case, "4216" is added at the beginning of the machine code, the bytes-count increases by 1 and the cycles-count increases by 2. 61 BBC Branch on Bit Clear BBC Operation When MA IMM=O PC ~ PC + n ± REL (REL is instruction's second byte) PG ~ PG + 1 (if carry on PC), PG ~ PG - 1 (if borrow on PC) When M /\ IMM,,oQ PC~ PC+ n PG ~ PG + 1 (if carry on PC) IMM is the bit pattern that specifies the bit positions to be tested. The value of n is determined as follows: If the data length selection flag m is set to 1, n=4 if direct bit relative addressing mode, and n=5 if absolute bit relative addressing mode. If the data length selection flag m is set to 0, n=5 if direct bit relative addressing mode, and n=6 if absolute bit relative addressing mode. Description The BBC instruction tests the specified bits (which may be specified simultane- ously) of memory. The instruction causes a branch to the specified address when the specified bits are all 0. The branch address is specified by a relative address. Status flags Not affected. Addressing mode II Syntax Machine code Bytes JCycles Direct bit relative l BBC #imm, dd, rr 3416, dd, imm, rr 4 I 7 Absolute bit relative BBC #imm, mmll, rr 3C16, II, mm, imm, rr 5 18 (Note1) The bytes-count increases by 1 when operating on 16-bit data with the data length selection flag m set to 0. (Note2) The cycles-count increases by 2 when a branch occurs. 62 BBS Branch on Bit Set BBS Operation When M /\ IMM=O PC ~ PC + n ± REL (REL is instruction's second byte) PG ~ PG + 1 (if carry on PC), PG ~ PG - 1 (if borrow on PC) When MA IMMi<'O PC~ PC+ n PG ~ PG + 1 (if carry on PC) IMM is the bit pattern that specifies the bit positions to be tested. The value of n is determined as follows: If the data length selection flag m is set to 1, n=4 if direct bit relative addressing mode, and n=5 if absolute bit relative addressing mode. If the data length selection flag m is set to 0, n=5 if direct bit relative addressing mode, and n=6 if absolute bit relative addressing mode. Description The BBS instruction tests the specified bits (which may be specified simultane- ously) of memory. The instruction causes a branch to the specified address when the specified bits are all 1. The branch address is specified by a relative address. Status flags Not affected. Addressing mode I Syntax Machine code I Bytes I Cycles I Direct bit relative I BBS #imm, dd, rr 2416, dd, imm, rr l4 7 Absolute bit relative I j BBS #imm, mmll, rr 2Crn, II, mm, imm, rr I I s l 8 (Note1) The bytes-count increases by 1 when operating on 16-bit data with the data length selection flag m set to 0. (Note2) The cycles-count increases by 2 when a branch occurs. 63 BCC Branch on Carry Clear BCC Operation When C=O, PC ~ PC + 2 ± REL (REL is instruction's second, byte) PG ~ PG + 1 (if carry on PC), PG ~ PG. - 1 (if borrow on PC) When C=1, PC~ PC+ 2 PG ~ PG + 1 (if carry on PC) Description When the carry flag C is clear (0), the BCC instruction causes a branch to the specified address. The branch address is specified by a relative address. When the carry flag C is set (1), the program advances .to next step without any action. Status flags Not affected. Addressing mode Syntax Machine code Bytes Cycles Relative BCC rr 9.01s, rr 2 4 (Note1) The cycles-count increases by 2 when a branch occurs. 64 BCS Branch on Carry Set BCS Operation When C=1, PC ~ PC + 2 ± REL (REL is instruction's second byte) PG ~ PG + 1 (if carry on PC), PG ~ PG - 1 (if borrow on PC) When C=O, PC~ PC+ 2 PG ~ PG + 1 (if carry on PC) Description When the carry flag C is set (1), the BCS instruction causes a branch to the specified address. The branch address is specified by a relative address. When the carry flag C is clear (0), the program advances to next step without any action. Status flags Not affected. Addressing mode Syntax Machine code Bytes Cycles Relative BCS rr B01e, rr 2 4 (Note1) The cycles-count increases by 2 when a branch occurs. 65 BEQ Branch on Equal BEQ Operation When Z=1, PC f- PC + 2 ± REL (REL is instruction's second byte) PG f - PG + 1 (if carry on PC), PG f- PG - 1 (if borrow on PC) When Z=O, PC f- PC + 2 PG f- PG + 1 (if carry on PC) Description When the zero flag Z is set (1), the BEQ instruction causes a branch to the specified address. The branch address is specified by a relative address. When the zero flag Z is clear (0), the program advances to next step without any action. Status flags Not affected. Addressing mode l Syntax Machine code Bytes Cycles Relative lsrn rr F01s, rr 2 4 (Note1) The cycles-count increases by 2 when a branch occurs. 66 BMI Branch on Result Minus BMI Operation When N=1, PC f- PC + 2 ± REL (REL is instruction's second byte) PG f- PG + 1 (if carry on PC), PG f- PG - 1 (if borrow on PC) When N=O, PC f - PC+ 2 PG f- PG + 1 (if carry on PC) Description When the negative flag N is set (1), the BMI instruction causes a branch to the specified address. The branch address is specified by a relative address. When the negative flag N is clear (0), the program advances to next step without any action. Status flags Not affected. Addressing mode Syntax I Machine code Bytes Cycles Relative BMI rr J 3016, rr 2 4 (Note1) The cycles-count increases by 2 when a branch occurs. 67 BNE Branch on Not Equal BNE Operation When Z=O, PC ~ PC + 2 ± REL (REL is instruction's second byte) PG ~ PG + 1 (if carry on PC), PG ~ PG - 1 (if borrow on PC) When Z=1, PC~ PC+ 2 PG ~ PG + 1 (if carry on PC) Description When the zero flag Z is clear (0), the BNE instruction causes a branch to the specified address. The branch address is specified by a relative address. When the zero flag Z is set (1), the program advances to next step without any action. Status flags Not affected. Addressing mode Syntax Machine code Bytes Cycles Relative BNE rr D01s, rr 2 4 (Note1) The cycles-count increases by 2 when a branch occurs. 68 BPL Branch on Result Plus BPL Operation When N=O, PC ~ PC + 2 ± REL (REL is instruction's second byte) PG ~ PG + 1 (if carry on PC), PG ~ PG - 1 (if borrow on PC) When N=1, PC~ PC+ 2 PG ~ PG + 1 (if carry on PC) Description When the negative flag N is clear (0), the BPL instruction causes a branch to the specified address. The branch address is specified by a relative address. When the negative flag N is set (1). the program advances to next step without any action. Status flags Not affected. Addressing mode Syntax Machine code Bytes Cycles Relative BPL rr 1016, rr 2 4 (Note1) The cycles-count increases by 2 when a branch occurs. 69 BRA Branch Always BRA Operation For short relative branch, PC ~ PC + 2 ± REL (REL is instruction's second byte) PG ~ PG + 1 (if carry on PC), PG ~ PG - 1 (if borrow on PC) For long relative branch, PC ~ PC + 3 ± REL (REL is a numeric value represented by the instruc- tion's second and third bytes) Description The BRA instruction causes a branch to the specified address. The branch address is specified by a relative address. Status flags Not affected. Addressing mode Syntax Machine code Bytes Cycles Relative BRA rr 8016, rr 2 4 BRAL rrHr2 8216, rr2, m 3 4 70 BRK Force Break BRK Operation PC~ PC+ 2 M(S) ~PG s ~ s -1 M(S) ~ PCH s ~ s -1 M(S) ~ PCL s ~ s -1 M(S) ~ PSH s ~ s -1 M(S) ~ PSL s ~ s -1 I~ 1 PCL ~ M(FFFA16) PCH ~ M(FFFB16) PG~ 0016 Description When the BRK instruction is executed, the CPU first saves the address where the next instruction is stored, and then saves the contents of the processor status register on the stack. Then, the CPU executes a branch to the address in bank- 0 the lower portion of which is specified by the contents of FFFA16 in bank-0 and the upper portion specified by the contents of FFFB16 in bank-0. Status flags IPL: Not affected. N Not affected. v Not affected. m Not affected. x Not affected. D Not affected. I Set to 1. z Not affected. c Not affected. Addressing mode Syntax Machine code ! Bytes Cycles Implied BRK #nn 0016,EA16 J2 15 (Note1) The instruction's second byte is ignored, so any value impossible. 71 BVC Branch on Overflow Clear BVC Operation When V=O, PC f--- PC + 2 ± REL (REL is instruction's second byte) PG f--- PG + 1 (if carry on PC), PG f--- PG - 1 (if borrow on PC) When V=1, PC f--- PC + 2 PG f--- PG + 1 (if carry on PC) Description When the overflow flag Vis clear (0), the BVC instruction causes a branch to the specified address. The branch address is specified by a relative address. When the overflow flag V is set (1 ), the program advances to next step without any action. Status flags Not affected. Addressing mode Syntax Machine code Bytes Cycles Relative BVC rr 5016, rr 2 4 (Note 1) The cycles-count increases by 2 when a branch occurs. 72 BVS Branch on Overflow Set BVS Operation When V=1, PC f- PC + 2 ± REL (REL is instruction's second byte) PG f- PG + 1 (if carry on PC), PG f- PG - 1 (if borrow on PC) When V=O, PC f- PC+ 2 PG f- PG + 1 (if carry on PC) Description When the overflow flag V is set (1 ), the BVS instruction causes a branch to the specified address. The branch address is specified by a relative address. When the overflow flag V is clear (0), the program advances to next step without any action. Status flags Not affected. Addressing mode 1 Syntax Machine code Bytes Cycles Relative i BVS rr 7016, rr 2 4 I (Note1 )The cycles-count increases by 2 when a branch occurs. 73 CLB Clear Bit CLB Operation M ~MA IMM IMM is the bit pattern that specifies the bit positions that are to be cleared to 0. The bit positions that are to be cleared are indicated by 1 in IMM, and the bit po- sitions that are not to be cleared are indicated by O in IMM. When the data length selection flag m is set to 1, IMM is placed in the third byte (direct bit addressing mode) or the fourth byte (absolute bit addressing mode) of th.e instruction. When the data length selection flag m is set to 0, IMM is placed in the third and fourth bytes (direct bit addressing mode) or the fourth and fifth bytes (absolute bit addressing mode) of the instruction. Description The CLB instruction clears the specified memory bits to 0. Multiple bits to be cleared can be specified at one time. Status flags Not affected. Addressing mode Syntax Machine code Bytes Cycles Direct bit CLB #imm, dd 1410, dd, imm 3 8 Absolute bit CLB #imm, mmll 1C1a, II, mm, imm 4 9 (Note1) The bytes-count increases by 1 when operating on 16-bit data with the data length selection flag m set to 0. 74 CLC Clear Carry Flag CLC Operation c~o Description Clears the contents of carry flag C to O. Status flags IPL: Not affected. N Not affected. v Not affected. m Not affected. x Not affected. D Not affected. I Not affected. z Not affected. c Cleared to 0. Addressing mode Syntax Machine code Bytes Cycles Implied CLC 1816 1 2 75 CLI Clear Interrupt Disable Status CLI Operation I (1/2 the oscillation frequency f(X1N)). The basic clock of the bus is an E derived from clock , so data exchange be- tween the CPU and the internal bus is done via the bus interface unit. The frequency of E is normally 1/2 that of clock , but it becomes 1/4 that of , when accessing external memory while the wait is enabled by the wait bit. 6.1 Bus Interface Unit The bus interface unit is a unit that helps data exchange between the CPU and the internal bus. The unit is structured by registers and buffers as shown in Figure 6.1.1. The functions of these registers and buffers are shown in Table 6.1.1. The CPU reads the instruction code from the instruction queue buffer, and the data from the data buffer of the bus interface unit. Then, data is written in the data buffer of the bus interface unit. The bus interface unit reads or writes data from the memory or 1/0 via the bus, instead of the CPU. b23 bO I PA I Program Address Register b7 bO I Qo II I I 01 I II Instruction Queue Buffer b23 I Q2 I _J bO b15 DA I Data Address Register bO DBH DBL Data Buffer Fig. 6.1.1 Bus Interface Unit Register Model Table 6.1.1 Functions of the Registers and Buffers Name Function Program address register This register indicates the address where the program is stored. Instruction queue buffer The 3-byte buffer for temporal storage of the instruction pre- fetched from the memory. Data address register The register that indicates the address for data read or data write. Data buffer The buffer where the bus interface unit temporarily stores data read from the memory or 1/0 or where the CPU temporarily stores data to be written into the memory or 1/0. 167 Instruction Execution Sequence 6.2 Change of the CPU Basic Clock c:Pu When the bus interface unit is not ready, the CPU extends the basic clock to synchronize with the bus, and waits till it is ready. As the CPU basic clock waits owing to some conditions, this clock will be called cpcPu to be distinguished from the clock . The following are the cases in which the cPu waits. Causes for the cPu to wait When the CPU requests operation codes and operands, but the operation codes and op- erands in the instruction queue buffer did not reach the necessary number. When the CPU tried to access data, but the bus interface unit was using the bus for fetching some data into the instruction queue buffer or writing data. When the bus interface unit was reading data from the internal/external memory or 1/0, according to the request of the CPU. In addition to the above, the following are also causes for the <)>cPu to be extended. • When 16-bit data is accessed from odd address. • When external memory 16-bit data is accessed while the BYTE terminal level is "H". • When external memory is accessed with wait commanded by the wait bit. The above conditions causes the execution time to differ each time, even with the same instruc- tion and same addressing mode. Two example instructions are given in the next section to see the variation of the number of cycles according to the above conditions. The " CPU execution sequence per addressing mode " of Appendix-A is the CPU instruction execution sequences based on the <)>cPu . The number of cycles shown in " 4.2 Instructions " and " Appendix-B List of machine language instructions " are the count for the shortest case, and cannot always be applied when calculating the actual cycles or the execution time of instructions. 168 Instruction Execution Sequence 6.3 Instruction Execution Sequence The instruction execution sequence of the CPU based on the cPu, and the variation of the actual instruction execution cycle when various conditions are applied are shown here. • Example 1. ASL instruction Direct addressing mode • Example 2. LDA instruction Direct indirect long addressing mode wltlit·@M@:wd Before observing the c)lcPu based CPU instruction execution sequence •ifWM!Mtl The following table describes the c)lcPu based CPU instruction execution sequence symbols. The signals indicated in this execution sequence are all CPU internal signals, that show data ex- change between the bus interface unit and the CPU. Accordingly, these signals cannot be observed from outside. cPu Based CPU Instruction Execution Sequence Symbols Symbol Description c)lcPU CPU basic clock AP( CPU) Higher order 8 bits of the address (24 bits) of the program that the CPU is actually execution AHAL IC PU) Lower order 16 bits of the address (24 bits) of the program that the CPU is actually execution DATA1cPU) Data information the CPU is processing R/W1cPU) Data read/write request to the data buffer in the bus interface PG,PC Contents of the program bank register (PG) and the program counter (PC) ADP Data indicating the address (higher order 8 bits) ADH,ADL Data indicating the address (middle order 8 bits, lower order 8 bits) DPRH Contents of the higher order 8 bits of the direct page register DPRL Contents of the lower order 8 bits of the direct page register (DPRL = 0 in the examples) DH Data to be fetched or written from the data buffer by the CPU (higher order 8 bits) DL Data to be fetched or written from the data buffer by the CPU (lower order 8 bits) dd Contents of the operand (DPRL = O in examples 1 and 2, so dd represents the lower order 8 bits of the address) 169 Instruction Execution Sequence lttttJt:tt:M::r::w::I Before observing the based instruction execution sequence I:tH::Htw:::i:rrm:n:n@ The based execution sequence symbols are shown in the following table. The signals in this execution sequence indicates data exchange of the bus interface unit with the memory and 1/0. The internal instruction execution sequence of the CPU can be guessed from these signals. However, the cPu and the number of data in the instruction queue buffer shown here cannot be observed from the outside.

Basic operation clock of the microcomputer f{XIN) f 2 E Basic operation clock of the bus <1>12 hh Higher order 8 bits of the address where the bus interface unit is to access to (bank) --------- - -------------· mm Middle order 8 bits of the address where the bus interface unit is to access to II Lower order 8 bits of the address where the bus interface unit is to access to DPR Contents of the direct page DPRH Contents of the higher order 8 bits of the direct page register DPRL Contents of the lower order 8 bits of the direct page register OP1 Data to be fetched into the instruction queue buffer by the bus interface OP2 (Operation code or operand) Qp3 The subscript represents the fetch sequence. : DL Data to be fetched into the data buffer or data to be written into the memory by the bus interface DH unit dd Data obtained as the operand (The lower order 8 bits of the address are given in examples 1 and 2, because DPRL = 0.) ADP Higher order 8 bits of data that indicates the address (contents of the data address register) ADH Middle order 8 bits of data that indicates the address (contents of the data address register) ADL Lower order 8 bits of data that indicates the address (contents of the data address register) The following are the cause of the "cPu to queue" in the based execution sequence. Cause 1 When the CPU required operation codes and operands, but the number of operation codes and operands did not reach the requested number. Cause 2 When the CPU tried to access data, but the bus interface was using the bus for fetching data into the instruction queue buffer or for writing data. Cause 3 When the bus interface unit is reading data from the internal/external memory or 1/0, etc., accord- ing to the request of the CPU. 170 Instruction Execution Sequence Example 1. ASL instruction I direct addressing mode (DPRL = 001s) cPu based CPU instruction execution sequence <)>CPU AP(CPU) ~ PG x x~---oo ~X PG ___ PG )[ AHAL(CPU) -y._ PC x x'--~~-D_P_R_H~·-d_d~~--'~ >C PC+1 PC+2 New Next DATA(CPU) Op Code Operand DH D L 1fot Used DH D L Op Code RI W(CPU) Note: All the signals are CPU internal signals, which cannot be observed from outside. The following examples 1-1 to 1-6 are examples of the cPu based instruction execution se- quences under various conditions. Example 1-1 When the instruction queue buffer is vacant Example 1-2 When two data are in the instruction queue buffer Example 1-3 When three data are in the instruction queue buffer Example 1-4 When 16-bit data is accessed from odd address Example 1-5 When external memory is accessed from the BYTE terminal using 8-bit external bus width Example 1-6 When external memory is accessed with wait by the wait bit 171 Instruction Execution Sequence (Example 1-1) When the instruction queue buffer is vacant Conditions • Number of data in the instruction queue buffer 0 •ROM, RAM External memory is used (Note) • Data length selection flag m "O" (16-bit length) • BYTE terminal level "L" (External bus width is 16 bits) • Contents of lower order bytes (PCL) of the program counter Even • Contents of the operand (dd) Even ¢ based execution sequence .1 2 3 4 5 6 7 8 9 ¢c;Pu ! Fetches Op Fetches Reads Data Modifies Writes Next Number of data in ! Code Operand Data Data ' Instruction instruction queue O 2_,1 0 2 buffer Modified DL A2T-A16 I DAT A1even) Modified DH A1s-AB I DATA1odd) Opeland (dd) A7-AD =x:~--~X 11+2 Xc_____d_d_ _~~>= BHE "L" ; . . - - - - - - - - - - - - - - - - - - - - - - - - - R/W Cause for ¢c;Pu to queue Cause 1 Cause 2 Cause 3 Note. The operation when internal ROM and internal RAM are used, will be as shown above, regardless of the level of the BYTE terminal. However, the address/data bus, BHE, R/W signal cannot be observed from outside, when the mode is single-chip mode. 172 Instruction Execution Sequence Operation of the CPU and bus interface unit under various cycles No. CPU Bus interface unit 1 (No fetching can be done, because there are no Fetches the instruction, because instruction operation codes in the instruction queue buffer.) queue buffer is vacant and the CPU is not using the bus. 2 !-- Fetches 2-byte worth of_?ata into the instruc- ~ lion queue buffer when E becomes "l.'.". Fetches the operation code. 3 Fetches the operand. Prefetches the instruction, because the in- struction queue buffer is vacant and the CPU is not using the bus. 4 (Waits till the bus used by the bus interface unit Fetches 2 bytes worth of data into the instruc- becomes vacant.) tion queue buffer when t: becomes "L". 5 Waits for t: to become "L", to read data. 6 Reads data when E becomes "L". 7 Modifies data. 8 Writes data into the data buffer. 9 Fetches the next operation code. Writes the contents of the data buffer into the original address, when E becomes "L". 173 Instruction Execution Sequence (Example 1-2) When two data are in the instruction queue buffer Conditions • Number of data in the instruction queue buffer 2 •ROM, RAM External memory is used (Note) • Oat.a length selection flag m "O" (16-bit length) • BYTE terminal level "L" (External bus width is 16 bits) • Contents of lower order bytes (PCL) of the program counter. Even • Contents of the operand (dd) Even c)> based execution sequence c)>cPU i Fetches Fetches Reads Data Modifies Writes INext Number of data in ! Op Code Operand Data Data ! Instruction instruction queue 2 I o 2 I buffer I Modified DL A2-rA1a I DATA(ovon) Modified DH MsNAa I DATA(ood) ' =*~~~~X.__~~d_d~--.--x= "L" '----------------'----+---- R/W Cause for c)>cPU to queue ..____.. Cause 2 ........ Cause 3 Note. The operation when internal ROM and internal RAM are used, will be as shown above, regardless of the level of the BYTE terminal. However, the address/data bus, BHE, RiW signal cannot be observed from outside, when the mode is single chip mode. 174 Instruction Execution Sequence Operation of the CPU and bus interface unit under various cycles No. CPU Bus interface unit 1 Fetches operation code. 2 Fetches operand (dd). Prefetches the instruction, because the instruct queue buffer is vacant and the CPU is not using the bus. 3 (Waits till the bus used by the bus interface unit Fetches 2-byte worth of data into the instruction becomes vacant.) queue buffer when E becomes "L". 4 Waits for E to become "L", to read data. 5 Reads data when E becomes "L". 6 Modifies data. 7 Writes data into the data buffer. 8 Fetches the next operation code. Writes the contents of the data buffe·r into the original address, when E becomes "L". 175 Instruction Execution Sequence (Example 1-3) When three data are in the instruction queue buffer Conditions • Number of data in the instruction queue buffer 3 • ROM, RAM External memory is used (Note) • Data length selection flag r:n "O" (16-bit length) • BYTE terminal level "L" (External bus width is 16 bits) • Contents of lower order bytes (PCL) of the program counter Even • Contents orthe operand (dd) Even based execution sequence QCPU !Fetches Fetches Reads Data Modifies Writes l°P Code Operand Data Data Number of data in instruction queue 3i 2 3 buffer A23-A16 I DATA(even) Modified DH A15-/lv:J I DATA(oddl BHE "L" !..-----------------+---- ' R/W Cause for QcPU to queue -- -- Cause 3 Cause 2 Note. The operation when internal ROM and internal RAM are used, will be as shown above, regardless of the level of the BYTE terminal. However, the address/data bus, BHE, R/W signal cannot be observed from outside, when the mode is single chip mode. 176 Instruction Execution Sequence Operation of the CPU and bus Interface unit under various cycles Q>No. CPU Bus interface unit 1 Fetches operation code . 2 Fetches operand (dd). 3 Waits for E to become "L", to read data. 4 Reads data when E becomes "L". 5 Modifies data. Prefetches the instruction, because there are two vacant instruction queue buffers and the CPU is not using the bus. 6 (Waits till the bus used by the bus interface Fetches 2-byte worth of data into the instruction unit becomes vacant.) queue buffer when E becomes "L". 7 Writes data into the data buffer. 8 Fetches the next operation code. Writes the contents of the data buffer into the origi- nal address, as E becomes "L". 177 Instruction Execution Sequence (Example 1-4) When 16-bit data is accessed from odd address Conditions • Number of data in the instruction queue buffer 0 •ROM, RAM External memory is used (Note1) • Data length selection flag m "O" (16-bit length) • BYTE terminal level "L" (External bus width is 16 bits) • Contents of lower order bytes (PCL) of the program counter Odd • Contents of the operand (dd) Odd based execution sequence ¢<;PU ~ Fetches Op Fetches Reads Data Modifies Writes j Code Operand Data Data \Instruction Number of data in instruction queue O 1~0 2~1 3 2 buffer Modified DH A2:r-A1s I DATA1even1 A1s-Aa I DATA10••1 Op Code Ne:.1 Op Code Invalid Invalid J x 11+1 x dd x dd+1 x 11+3 x dd x dd+1 :c BHE RIW Cause for cPU to queue ......__. ...___. ...___. ............... Cause 1 Cause 1 Cause 3 Cause 2 Cause 2 (Note2) Note1. The operation when internal ROM and internal RAM are used, will be as shown above, regardless of the level of the BYTE terminal. However, the address/data bus, BHE, R/W signal cannot be observed from outside, when the mode is single chip mode. Note 2. At the <- - -> part • When the CPU does not use the bus, cPu corresponds with . * When the CPU uses the bus, the No. CPU Bus interface unit (No fetching can be done, because there are Fetches the instruction, because instruction queue no operation codes in the instruction queue buffer is vacant and the CPU is not using the bus. buffer.) 2 Fetches 1 odd address byte worth of data into the instruction queue buffer, when E becomes-"L". Fetches operation code. 3 (No fetching can be done, because there are Fetches the instruction, because instruction queue no operands in the instruction queue buffer.) buffer is vacant and the CPU is not using the bus. 4 / Fetches 2-byte wort_ti of data into the instruction ~ I queue buffer when E becomes "L". Fetches operand (dd). 5 Waits for E to become "L", to read data. 6 Reads data in the odd addresses (DL) alone into the data buffer when E becomes "L". 7 Waits for E to become "L", to read data. 8 Reads data in the even addresses (DH) alone into the data buffer when E becomes "L". 9 Modifies data. Pref etches the instruction, because there are two vacant positions in the instruction queue buffer, and the CPU is not using the bus. 10 (Waits till the bus used by the bus interface Fetches 2 bytes worth of data into the instruction unit becomes vacant.) queue buffer, when E becomes "L". 11 Writes data into the data buffer. Waits till E becomes "L" to write data. 12 Fetches the next operation code. Writes the contents of the data buffer (DL) into the original address (odd address), when E becomes "L". 13 ? Waits till E becomes "L" to write data. 14 Writes the contents of the data buffer (DH) into the ? original address (even address), when E becomes "L". When internal ROM or BYTE terminal level "L" external memory is used as the program memory, the instruction is fetched into the instruction queue buffer normally in 2-byte (word) unit of sequential even and odd addresses in this order. However, when the instruction must be fetched from odd address like after execution of the JMP instruction, the 1-byte of the first odd address alone is fetched into the instruction queue buffer (¢2 cycle), and the later instructions are fetched into the instruction queue buffer in 2-byte units (¢4, ¢10 cycle). The bus interface unit automatically selects whether to fetch one word or to fetch the 1 byte of odd address alone. The operation status can be observed from outside, according to the output of the BHE terminal and the address bus signal Ao, as long as the mode is not single chip mode. •When one word is fetched The output from both the BHE terminal and the address bus Ao are at the "L" level. • When 1 byte of odd address alone is fetched The output from the BRE terminal is "L", while the output from address bus Ao is "H". 179 Instruction Execution Sequence When internal RAM and external memory at BYTE terminal level "L" are used as the data memory, with data length selection flag m = 0, both data read and write are normally done in 2-byte units of even and odd addresses, in this sequence. However, access can also be done when the word data is defined from an odd address. In other words, "H" is output first from address bl.is Ao and then "L" from the BHE terminal to access to odd address alone. Next, "L" is output from Ao, and "H" from the BHE terminal to access to the even address. (s to ¢s, ¢11 to c)>14 cycle) 180 Instruction Execution Sequence (Example 1-5) When external memory is accessed from the BYTE terminal using 8-bit external bus width Conditions • Number of data in the instruction queue buffer 0 •ROM, RAM External memory is used • Data length selection flag m "O" ( 16-bit length) • BYTE terminal level "H" (External bus width is 8 bits) • Contents of lower order bytes (PCL) of the program counter Even • Contents of the operand (dd) Even cj> based execution sequence ,1 2 3 4 5 6 7 8 9 10 11 ,12 13 14 GlCPU Fetches Op Fetches Reads Data Modifies Writes Code Operand Data Data ~ Instruction Number of data in instruction queue 0 buffer Modified DL Modified OH DP~ x mm x • DP~ :c: A1-Ao =x_____,X 11+1 ____,x dd+1 X._ dd x 11+2 x x dd dd+1 :c: BHE RIW Cause for QcPu to queue ...__.,. ___. Cause 3 ___. Cause 2 ~ ..... Cause 2 (No1e) Cause 1 Cause 1 Note. At the <- - -> part * When the CPU does not use the bus, cj>cPu corresponds with cj>. • When the CPU uses the bus, the cj>cru queues till the writing in the bus interface unit completes. (the cj>13 to cj>14 cycle) 181 Instruction Execution Sequence Operation of the CPU and bus interface unit under various cycles No. CPU Bus interface unit 1 (No fetching can be done, because there are Fetches the instruction, because the instruction queue no operation .codes in the instruction queue buffer is vacant and the CPU is not using the bus. buffer.) 2 Fetches 1 odd address byte worth of data into the in- Fe.tches operation code. ~ struction queue buffer when E becomes "L". 3 (No fetching can be done, because there are Fetches the instruction, because instruction queue no operands in the instruction queue buffer.) buffer is vacant and the CPU is not using the bus. 4 Fetches 1-byte worth of data into the instruction Fetches operand (dd). ~ queue buffer when E becomes "L". - 5 Waits for E to become "L", to read data. - 6 Reads data (DL) into the data buffer when E becomes "L". 7 Waits for E to become "L", to read data. 8 Reads data (DH) alone into the data buffer when E becomes "L". 9 Modifies data. Prefetches the instruction, because there are two vacant positions in the instruction. queue buffer, and the CPU is not using the bus. 10 (Waits till the bus used by the bus interlace Fetches 1 byte worth of data into the instruction unit is vacant.) queue buffer when E becomes "L". - 11 Writes data into the data buffer. Waits till E becomes "L" to write data. 12 Fetches the next operation code. Writes the contents of the data buffer (DL) into the original address (odd address), when E becomes "L". - 13 ? Waits till E becomes "L" to write data. 14 ? Writes the contents of the data buffer (DH) into the . original address (even address), when E becomes "L" . The external bus width becomes 8 bits when the "H" level is applied to the BYTE terminal. (The width of the internal bus is 16 bits, regardless of the level of the BYTE terminal.) When external ROM is used under this mode, the instruction can only be fetched byte by byte. (2, 4, 10 cycle) When external RAM is used, the data can likewise only be handled byte by byte. Accordingly, when data length selection flag m = 0 is selected, it takes time worth 2 cycles of the enable output E for data read and write. (lj>s to s, 11 to 14 cycle) 182 Instruction Execution Sequence (Example 1-6) When external memory is accessed with wait by the wait bit Conditions • Number of data in the instruction queue buffer O • ROM, RAM External memory is used • Data length selection flag m "O" (16-bit length) • BYTE terminal level "L" (External bus width is 16 bits) • Contents of lower order bytes (PCL) of the program counter Even • Contents of the operand (dd) Even based execution sequence 2 3 4 6 8 9 10 11 12 13 14 ,15 16 17 No. CPU Bus interface unit 1 (No fetching can be done, because there are Fetches the instruction, because instruction queue 2 no operation codes in the instruction queue buffer is vacant and the CPU is not using the bus. buffer.) 3 v Fetches 2 bytes worth of data into the instruction 4 ~ queue buffer when E becomes "L". Fetches the operation code . 5 Fetches operand (dd). Prefetches the instruction because the instruction 6 queue buffer is vacant and the CPU is not using the bus. 7 (Waits till the bus used by the bus interface Fetches 2 bytes worth of data into the instruction 8 unit becomes vacant.) queue buffer when becomes "L". 9 Waits till E becomes "L" to write data. 10 11 Reads data when E becomes "L". 12 13 Modifies data. 14 Writes data into the data buffer. 15 Fetches the next operation code. 16 ? Writes the contents of the data buffer into the original address (odd address), when E becomes "L". Note. At the <- - -> part * When the CPU does not use the bus, cPu corresponds with . * When the CPU uses the bus, the cPu extends till the writing in the bus interface unit completes. (the 11 cycle) The conditions are the same, except when wait is commanded by the wait bit (example 1-1 ). When accessing to the external memory, the cycle of enable output E becomes twice that for no-wait, and thus the cPu wait time also becomes twice the cycle. (3 to 4, 1 to a, 11 to 12, 16 to 11 cycle) 184 Instruction Execution Sequence Example 2. LOA instruction I Direct indirect long addressing mode (DPRL =001s) <)>cPu based CPU instruction execution sequence cp CPU AP( CPU) ] PG X PG X oo Xooor01 Xooor01 X ADP X PG I:_ AHAL(CPU) -y,, PC ~ DPRH, dd xD:::; x xADHADL PC+2 y::_ DATA(CPU) Next Op Code Operand ADH ADL Not Used ADP DHDL dd OpCode . RI W(CPU) "H" Note: All the signals are CPU internal signals, which cannot be observed from outside. 185 Instruction Execution Sequence (Example 2·1) When the internal as well as the external memories are used together while wait is commanded by the wait bit. Conditions • Number of data in the instruction queue buffer 0 • Bank O Internal ROM, RAM are used Bank 1 and after External memory is used • Data length selection flag m "O" ( 16-bit length) • BYTE terminal level "L" (External bus width is 16 bits) • Contents of lower order bytes (PCL) of the program counter Even • Contents of the operand (dd) Even • Data indicated by the address ADL Even ADP 1 or more (bank 1 and after)

cPU Fetches Op Fetches Reads Calculates Reads Reads Code Operand Data Address Data Data ; Instruction Number of data in instruction queue buffer o: 2-.1 0 2 A2a-A16 I DATA(even) ADP DL A,s-~ I DATAcPu to queue Cause 1 Cause 2 Cause 3 -- Cause 3 Cause 3 186 Instruction Execution Sequence O___Q_eration of the CPU and bus interface unit under various qcles No. CPU Bus interface unit (No fetching can be done, because there are no Fetches the instruction, because instruction queue operation codes in the instruction queue buffer.) buffer is vacant and the CPU is not using the bus. 2 / Fetches 2 bytes w~rth of data into the instruction ~ queue buffer when E becomes "L". Fetches the operation code . 3 Fetches operand (dd). Prefetches the instruction because the instruction queue buffer is vacant and the CPU is not using the bus. 4 (Waits till the bus used by the bus interface unit Fetches 2 bytes worth of data into the instruction becomes vacant.) queue buffer when E becomes "L". 5 Waits for E to becomes "L", to read data (ADH ADL) indicated by the address obtained by adding the contents of the operand (dd) and the DPRL. 6 Reads data when E becomes "L". 7 Calculated address. 8 Waits for E to become "L", to read data (ADP). 9 Reads data when E becomes "L". 10 Waits for E to become "L", to read the data (DH DL) at the address specified by ADP ADH ADL. 11 12 Reads data when E becomes "L". 13 The above is the case when bank 1 and after are used by the external memory under the memory expansion mode. The currently executed program is in bank 0. The contents of the lower order bytes of the direct page register DPRL is "0016", so the direct pages are all in bank 0. The access to the outside (10 to 13 cycle) alone is affected by the wait bit, and access to the internal memory is not affected by the bit. 187 APPENDIX A CPU Instruction Execution Sequence for each Addressing Mode APPENDIX A. CPU Instruction Execution Sequence for each Addressing Mode The following are the CPU instruction execution sequences for each addressing mode. The exe- cution sequences shown here describe the internal operation of the CPU. Therefore, the signals are all CPU internal signals, and cannot be observed from outside. The CPU internal operation, the actual execution time, and the relation between signals that can be externally checked are described in Chapter 6 "Instruction Execution Sequence". The following are the signals and the symbols indicating the contents. Symbol Description CPU CPU basic cycle AP(CPU) Higher order 8 bits of the CPU internal address bus. AHAL(CPU) Lower order 16 bits of the CPU internal address bus. PG Contents of the program bank register. PC Contents of the program counter. Others are data that indicates the address obtained as result of address calculation. DATA1cPu1 The CPU internal data bus. The signal is output with a half-cycle delay from the CPU internal address bus. The operation codes and the operands are fetched from the in- struction buffer. They are not directly fetched from the memory indicated by the PG and PC of this cycle. - R/W1cPU) Becomes "L" when the CPU writes data into the data buffer of the bus interface unit. The accumulator used in the above instructions in the CPU instruction execution sequence is accumulator A. When accumulator B is used, the execution cycle will have the two cycles of a "4216" that indicates accumulator B, and an internal processing cycle added at the front. (See the figure in the next page.) The number of cPu cycles differs in the addressing mode that uses the direct page register, according to whether the lower order 8 bits (DPRL) are "0016''. The number of cycles when DPRL = 0016 is 1 cycle (address calculation cycle) less than when DPRL '# 0016. The number of cycles differs in the PSH and PUL instructions according to the number and type of registers placed in (taken out of) the stack. The number of cycles differs in the block transmission instruction (MVN, MVP), according to the number of the data transmitted. 188 APPENDIX A CPU Instruction Execution Sequence for each Addressing Mode Variation of the execution cycles according to the accumulator used ADC Instruction I Immediate addressing mode < CPU AP (CPU) J PG PG PG AHAL(CPU) PC PC+1 PC+3 .... DATA (CPU) 6916 123416 _/ : OpCode Operand < CPU AP (CPU) ~ PG x x ~~ PG PG PG AHAL(CPU) J< PC x x x x PC+1 PC+1 PC+2 PC+4 DATA(CPU) 4216 Not Used 6916 123416 Op Code Op Code Operand 189 Implied Instruction : C LC, CL I. C LM, CLV, DEX, DEY,IN X, I NY, NOP, SEC, SE I. S EM, TAD, TAS, TAX, TAY, TDA, TSA, TSX, TXA, TXS, TXY, TYA, TYX Timing ¢CPU AP( CPU) R/W(cpu) Instruction T B D, T B S, TB X, TB Y, T p B , T S D, TX B , TY B Timing ¢cpu Ap(CPU} DATA(cPul Not used Op Code Not used R/Wcpu AP( CPU) PC+2 ><= Next DATA(cPul Not used Op Code Not used Op Code Instruction : S T P, W I T Timing: ¢CPlJ AP( CPU) PG PC+ I DATA1cpu1 =:x Op Codex Not used X.___N_o_t_us-ed_ _ _ _ __ "H"--------------------- R/W:cpuJ 191 Implied Instruction RTS Timing r/Jcpu AP( CPU) Instruction : R T L Timing r/Jcpu Ap(CPU) DATA(cpul 192 Implied Instruction RT I Timing ¢>CPU AplCPU I DATA:cPu (Stack) (Stack) (Stack) R/W.cpu "H"------------------------------------------- 193 Implied Instruction BRK Timing 00 ~---s_-_4_ ___.X FFFA X AD"Ao, r---..,. x::= Next Op Code 194 Immediate Instruction A D C , A N D , C MP , E 0 R, L D A, 0 RA, S B C Timing m=O When m=1, fetched operand at 2-nd cycle is 1-byte(nn). Instruction LDX, LDY, CPX, CPY Timing RIW1cpu1 "H"----------------- When x=1, fetched operand at 2-nd cycle is 1-byte(nn). 195 Immediate Instruction : . L D T Timing Instruction R LA Timing ¢CPU Ap{cpu) PC+3 ><= Next DATA( CPU I Op Code R!W(cpu\ "H"----------------------------------------- 196 Immediate Instruction : S E P Timing cPu Ap(CPU) DATA( CPU} - R/W(cPul "H"---------------------- Instruction CLP Timing ¢CPU Ap:cpul R/W(CPU 197 Immediate Instruction DIV, MPY Timing r-- 1 _ _J Ap(CPU} DATA(CPU) R/WccPul -(Note)---------~ --, I L- (Note) MPY instruction is 12-cycle, and DIV instruction is 23-cycle. 198 Accumulator Instruction A S L , D E C , I N C , L S R, R 0 L , R 0 R Timing 199 Direct Instruction ADC, AND, CMP, CPX, CPY, EOR, LDA, LDX, LDY, ORA, SBC Timing DPRL *0 ¢cpu AP( CPU) DATArcPul When DPRL =O, this cycle is nothing. Instruction LDM Timing DPRL 4' 0 cPU Ap(CPU) mm nn R/W(CPU) "H"---------------------, When DPRL =O, this cycle is nothing. 200 Direct Instruction STA, STX, STY Timing DPR,* 0 AP( CPU) PC+ 1 Next DATA( CPU) Operand Not used A dd Op Code ·- "H"--------------------. R/WtcPul When DPR, =O, this cycle is nothing. Instruction : A S L, D E C, I N C , L S R, R 0 L, R 0 R Timing DPR, *0 ¢CPU Ap(CPU) PC+ 1 PC+2 ~ Operand Next DATA(CPU) Op Code Not used Not used dd Op Code R/W(CPU) ~----;;.. When DPR, =O, this cycle is nothing. 201 Direct Instruction DIV, MPY Timing I cpu I _.J AP( CPU) DATA{ CPU) R/W(cPul "H"--------------------------- When DPRL=O, this cycle is nothing. Next Op Code MPY instruction is 12-cycle, and DIV instruction is 23-cycle. 202 Direct Bit Instruction C L B, S E B Timing DPR,4'0, m= 0 AP( CPU} 00 or 01 DPR+dd PC+4 x= Next DATA( CPU) Op Code When DPR, =O, this cycle is nothing. When m=1, fetched operand at 3-rd cycle is 1-byte(nn). 203 Direct Indexed X Instruction ADC, AND, CMP, EOR, LDA, LDY, ORA, SBC Timing OPAL oF 0 cpu AP( CPU) Operand Next OATA(CPU) Op Code dd Op Code A/W(cpu) .,,..________,,. When OPAL =O, this cycle is nothing. Instruction LDM Timing Ap(CPU) When OPAL =O, this cycle is nothing. 204 Direct Indexed X Instruction STA, STY Timing DPR, *0 ¢cPU Ap{CPUl Next DATA(cPul Op Code Operand Not used Not used dd Op Code <"----------~ When DPR, =O, this cycle is nothing. Instruction ASL, DEC, INC, LSR, ROL, ROR Timing DPR, *0 AP( CPU 00, 01 or 02 PC+l Operand Next DATA1cpu) Op Code Not used Not used dd Op Code R/W,.CPU\ ~---------- When DPR, =O, this cycle is nothing. 205 Direct Indexed X Instruction DIV, MPY Timing OPAL oF 0 cpu Ap(CPU) DATA(CPU) Not used - A/W(cPul "H"-------------------------- When OPAL =O, this cycle is nothing. --.., - - - ( N o t e ) - - - - - - - -...... I 1..,_ 00 or 01 DPA+dd ==~~Not used X Not used X~~xhode) (Note) MPY instruction is 12-cycle, and DIV instruction is 23-cycle. 206 Direct Indexed Y Instruction LDX Timing DPRc 4' 0 rf>cpu AP( CPU) Operand Next DATA( CPU) Not used Not used dd Op Code R/W(cPul "H"--------------------------------- -<'-----·-~ When DPRc =O, this cycle is nothing. Instruction STX Timing DPR, 4' 0 AP( CPU) 00, 01 or 02 DPR+dd+Y PC+2 ~ Next DATA(cPul A Op Code When DP Re =O, this cycle is nothing. 207 Direct Indirect Instruction ADC, AND, CMP, EOR, LDA, ORA, SBC Timing DPRL *0 AP( CPU) z·---~ When DPR, =O, this cycle is nothing. Instruction STA Timing DPRL *0 AP( CPU) PC x PC+ 1 Operand x x DPR+dd A DH AD, Next DATA(cPUl Op Code Not used ADHADL Not used A dd Op Code - R/W(cPul "H"------------------------ When DPR, =O, this cycle is nothing. 208 Direct Indirect Instruction DIV, MPY Timing DPRL *0 t4------------ When DPRL =O, this cycle is nothing. =::. -: ==========~ Next Op Code (Note) MPV instruction is 12-cycle, and DIV instruction is 23-cycle. 209 Direct Indexed X Indirect Instruction ADC, AND, CMP, EOR, LDA, ORA, SBC Timing DPR, *0 CPU Ap(CPU) DTorDT+l DATA1cPul Not used - "H"---------------------------- R/W(cPul When DPRL =O, this cycle is nothing. Next Op Code (Note) MPY instruction is 12-cycle, and DIV instruction is 23-cycle. 213 Direct Indirect Long Instruction ADC, AND, CMP, EOR, LOA, ORA, SBC Timing DPR, *0 Ap(CPU} AHAUcPul DATA1cPu) PC x Op Code PC+ 1 Operand x Not used DPR+dd Not used ADP Next Op Code dd "H" RIW(CPU) When DPR, =O, this cycle is nothing. Instruction STA Timing When DPR, =O, this cycle is nothing. 214 Direct Indirect Long Instruction D I V, M P Y Timing DPR,* 0 When DPR, =O, this cycle is nothing. ----. : IJ I .. : ,o ___ ...o . . _______ --------======::::: ADp <'---------~~~~:~~~----------...J (Note) MPV instruction is 12-cycle, and DIV instruction is 23-cycle. 215 Direct Indirect Long Indexed Y Instruction ADC, AND, CMP, EOR, LOA, ORA, SBC Timing When DPRL =O, this cycle is nothing. Instruction STA Timing !/Jcpu APICPU -<"c---- When DPRL =O, this cycle is nothing. 216 Direct Indirect Long Indexed Y Instruction DIV, MPY Timing DPR,* 0 cPu AP(CPU) R/WccPul When DPR, =O, this cycle is nothing (Note)--------< n__s-i_n __ j--UL____fl__J ( ADp or Ao.+ 1 x x== PG < ADHAD,+Y x x== PC+3 =~~~~e~X Not used X Not used X~~xtode (Note) MPV instruction is 12-cycle, and DIV instruction is 23-cycle. 217 Absolute Instruction ADC, AND, CM P, C PX, C PY, E OR, L DA, LD X, L DY, ORA, SBC Timing t/Jcpu Ap(CPU) R/W(cPul Instruction LDM Timing 218 Absolute Instruction S T A, S T X, S T Y Timing Ap(cPu) DATA( CPU) hhll - "H"'-------------- R/Wcpu ' _J AP( CPU) PG AHAL(cPul PC ~================= DATA1ceu) Not used R/W(CPU) Next Op Code (Note) MPY instruction is 12-cycle, and DIV instruction is 23-cycle. 220 Absolute Instruction JMP Timing rf>cPU Ap(CPU) DATA(cpul AIW(cPul "H"------------------ Instruction JSR Timing ¢cPu AP( CPU) R/W(CPU) 221 Absolute Bit Instruction C L B, S E B Timing m=O AP( CPU) PC+5 x::= Operand Next DATA( CPU) Op Code hhll Op Code When m=1, fetched operand at 3-rd cycle is 1-byte(nn) 222 Absolute Indexed X Instruction : AD C , AND , CM P, E 0 R, L D A, L D Y, 0 RA, S B C Timing Instruction : L D M Timing ¢CPU Ap(CPUl DATA(cPul 223 Absolute Indexed X Instruction : A S L, D E C , I N C , L S R, R 0 L, R 0 R Timing: ¢cpu DTorDT+l PC+l hhll+X Operand Next DATA,cPu Op Code Not used Not used hhll Op Code 224 Absolute Indexed X Absolute Indexed Y Instruction DIV, MPY Timing .,.....___.. ______ _ Ap(CPU) DATAccPU) Not used R/W(cpu) Next Op Code (Note) MPV instruction is 12-cycle, and DIV instruction is 23-cycle. 225 Absolute Indexed X Absolute Indexed Y Instruction S TA Timing ¢cPU AP( CPU) DATA(cPul PC+ 1 Operand hhll x Not used hhll+X(Y) Not used x '!::_ A PC+3 Next Op Code - R/W(cpu) "H"-·-------------~ 226 Absolute Indexed Y Instruction AD C , AND, CM P, E 0 R, L D A, L D X, 0 RA, S B C Timing cpu AP( CPU) DATA( CPU) 227 Absolute Long Instruction ADC, AND, CMP, EOR, LOA, ORA, SBC Timing ¢cpu Ap(CPU) DATA(CPU) hhll - R/W(cPul "H"-------------------------- Instruction STA Timing 228 Absolute Long Instruction DIV, MPY Timing i..---- - - - - - - - -- r/Jcpu AP( CPU) DATA(cPul Not used . "H"--------------------------- R/W(cPul --- - _______ __, Not used. X Not used X Not used X~~xhode) (Note) MPY instruction is 12-cycle, and DIV instruction is 23-cycle. 229 Absolute Long Instruction JMP Timing Ap(cPU} DATA( CPU) hhll - "H"--------------------- R/W(cPul Instruction JSR Timing AP( CPU} R/W(CPU) 230 Absolute Long Indexed X Instruction AD C, AND, CM P, E 0 R, L D A, 0 RA, S B C Timing Instruction STA Timing DATA,.cPu' PC x x Op Code PC+ I Operand PC+ 3 Operand hhtt+x Not used A Next hhll pp Op Code 231 Absolute Long Indexed X Instruction DIV, MPY Timing ..,....__ ________ _ cpu Ap(CPU) 234 Absolute Indexed X Indirect Instruction JMP Timing Instruction JSR Timing ¢cPu PC+ 1 Operand DATA( CPU hhll 235 Stack Instruction PEA Timing Instruction PEI Timing 236 Stack Instruction PER Timing t/Jcpu Ap(CPUl PG PC+l PC+3 ><= Operand Next DATA(CPU) Op Code Not used PC+mmnn mmnn Op Code R/W(CPU) Instruction PHA, PHD. PHP, PHX, PHY Timing 237 Stack Instruction PHB Timing Instruction PHG, PHT Timing AP( CPU) R/WccPul 238 Stack Instruction P LA, P L D , P L X, P L Y Timing Instruction PLB Timing ¢CPU Ap::cPul 239 Stack Instruction PLP Timing -+--le--+I-:~ ~-+-1 -t- +--t-t--tH-+-r-+1 -~-tt- ~r- .:-~ ~-~- · ~ ~i: i:O-d"=·_1 ;~9~·~-br~- l • 0 C7 10 2 07 11 2 CD 4 3 +-t--+- -+-+-+- +--+--l-+T +-+-+-+- DD 6 3 09 6 3 C16 4 DF 7 4 CJ 5 2 03 8 2 1. N • z c 42 12 3 42 13 3 42 614-i 42 8 4 42 8 4 42 8 5 42 9 5 11 42 7 3 42 I 0 3 Cl D7 D DD 09 CF DF CJ DJ 253 APPENDIX 8 Series MELPS 7700 Machine Instructions I Addressing mode Symbol Function Details IMP IMM A DIR DIR,b DIR,X DIR,Y (DIR) (DIR,X) (DIR),Y opn:l:l:opn # op n ~ op n ft: op n !# opl n # op n !:1:1: op n :1:1: op 'n :1:1: op n ~ CPX (Note 1, 2) X-M Compares the contents of the index register X with the contents of the memory. EO 2 2 E4 4 2 I i CPY Y-M Compares the contents of the index register Y with the co 2 2 C4 4 2 I (Note 1, 2) DEC Acc-Acc-1 or contents of the memory. Decrements the contents of the accumlator or memory by l (Note 1) M-M-1 1 IA21C672 I 0017 2 I 11 I I ~ I IA I DEX x-x-1 Decrements the contents of the index register X by 1. CA 2 1 DEY Y-Y-1 __,_D_e_c-re_m_e_n-ts-t-he~co-n-te-n-ts_o_f-th_e_i_nd_e_x_r-eg-i-st-er-Y~by~1.~~r88+-2+1-++-+-H-+++-+-H-+++-+-r_j_;'-+-++-+-H- ~ DIV A(quotient)+--B,A/M The numeral that places lt1e cootents ct acCtJmulatcr B to the higher crder and the 89 27 3 89 29 3 89 30 3 89 31 3 89 32 3 89 33 3 (Note 2,10) B( remainder) cmtents d accumulato: A to the looer crder is divded by ltle cootents ct the memcry- 29 251 35 32 21 31 The quctient is entered into accuroolata A and the remainder into accumulata 8 EOR Acc-AccVM Logical exclusive sum is obtained of the contents of the 49 2 2 45' 4 2 55 5 2 52 6 2 41 7 2 51 8 2 (Note 1,2) 1 accumulator and the contents of the memory. The result is I placed into the accumulator ~ ~ ttj7'3 42 8 3 42 9 3 42 I 0 3 49 45 551 52 41 J51 INC Acc-Acc+l or I Increments the contents of the accumulator or memory by 3A21E672 F617 2 (Note 1) M -M+l 11 ~ JA I 1-~--~t--~~~~~-·~+--~~~~~~~~~~~~~~~~~~+----T-+-+-+-+--r-+--+-r-t-+-++-t-t-t-+-++-t-t--t-+-+·+-+-t--t-1 INX x-x+ 1 . Increments the c.ontents of the index register X by 1 E8 2 1 j INY ; Y+--Y+l Increments the contents of the index register Y by 1. ca· 2 1 1----+---------+---- --·----·+--t--t-+-++-+-t--t-+-++-+-t--t-+~+·+-H-c-+++-HH-+-j JMP : ABS Places a new address into the program counter and jumps ; I I PCL - AOL to that new address. PCH-ADH ABL PCL +---AOL PCH .-.- ADH PG+---ADo (ABS) PCc -(ADH, ADcl PCH-(ADH,ADc+l) L(ABS) PCL +-(ADtt, AOL) PCH-(ADH,ADc+ll PG -(ADH, ADc +2) (ABS, X) PCc-IADH, ADc +xi PCH-(ADH,ADc+X +11 JSR ABS Saves the contents of the program counter (also the con+ M(S)-PCH tents of the program bank register for ABL) into the stack, s-s-1 and jumps to the new address. M(S)- PCc s-s-1 PCL -AOL PCH +--AOH ABL M(S)-PG s-s-1 M(S)- PCH s-s-1 M(S)-PCc s-s-1 PCL +--AOL PCH +-- ADH PG-ADG (ABS, X) M(S)- PCH s-s-1 M(S)-PCc s-s-1 PCc -(ADH, ADc+X) PCH -(ADH, ADc +x +11 254 APPENDIX 8 Series MELPS 7700 Machine Instructions Processor status register ·-·---,------ --- ,---------,--·- ·---·- Addressing mode ---···- ·---~---· --- - - - - - - - - - - -------'--------=------ L(DIR) L(DIR),Y ABS ABS,b ABS,X ABS,Y ABL ABL,X (AB~_i_ L(ABS) (ABS,X) STK REL DIR.b.R ABS,b,R SR (SR),Y BLK 10 9 8 7 6 5 4 3 2 1 0 z c ~··~··~··~··~··~··~··~··~··~··~··~··~··~··~··~··~··~·· IPL N V m x D I EC 4 3 1 N z c pc 4 3 N z c CE 7 3 DE 8 3 N z l--+-t-+-J-+i--t-t-+-t-+-+-+-+-1--+-t-+-J-+-t-J-+-J--t--+- J- ++-+I- . +- -J-++-- - - --1-.-l--t-+--C-+-' "'-+-l--1-..J-L-L--'--l--'-L-+-t-J...-L..C- ..l-'-..l N z N z 8935 3 8936 3 8929 4 8931 4 8931 4 8931 5 8932 5 89 30 3 89 33 3 N V z c 27 37 2D JD 39 2F 3F 23 33 1--+-+-+-1--+-+-+-1--+-+-+-+-++-+-+-t-+-+--++-+-+-++-+-+-t-+-1--+-+-+-1--+-+-+-11-- -·- 47 10 2 57 11 2 4D 4 3 5D 6 3 59 6 3 4F 6 4 5F 7 4 43 5 2 53 8 2 N Z 4212 3 4213 3 42 6 4 42 s 4 42 s 4 42 sJsl 4zfg+g- 42 7 3 42 10 3 I 47 57 4D 5D 59 4F 5F I 43 53 -1-1--. EE 7 3 FE 8 3 N Z I I i N z N z 4C 2 3 5C 4 4 6C43DC837C63 I I ' ! ' I i 20 6 3 22 8 4 FC 8 3 i I I I I 255 APPENDIX B Series MELPS 7700 Machine Instructions Addressing mode Symbol Function Details 'IMP IMM A DIA DIA,b DIA,X DIA,Y (DIA) (DIR)C) (DIRl.Y op n #op n # op n #op n # op n # op n # op n # op n # op n #op n # LOA Acc-M Enters the contents of the memory Into the accumulator. A9 2 2 Afj 4 2 85 5 2 B1 6 2 Al 7 2 Bl 8 2 (Note 1,2) ~ ~ ~ 42 8 3 42 9 3 42 10 3 JIJ Afj 85 B1 Al Bl LDM M-IMM Enters the immediate value into the memory. 64 4 3 74 5 3 (Note 5) LDT DT-IMM Enters the Immediate value into the data bank register. 89 5 3 C2 LOX X-M Enters the contents of the memory into Index register X. A2 2 2 Af, 4 2 86 5 2 (Notel,2) LOY Y-M Enters the contents of the memory into Index register Y. AO 2 2 A4 4 2 84 5 2 (Note1,2) LSA m=O Shifts the contents of the accumulator or the contents of 4A 2 1 46 7 2 56 7 2 (Note 1 I o-~-c the memory one bit to the right. The bit 0 of the accumula- m=l tor or the memory is entered into the C flag. "O" is entered ~ Into bit 15 (bit 7 when them flag is "1".) 4A o-~-c MPY B, A-A*M Multiplies the contents of accumulator A and the cootents of the mem- 8916 3 8918 3 8919 3 89 20 3 89 21 3 89 22 3 (Note 2,11) ory. The higher order of the result of operation are entered into accu- 09 05 15 12 01 11 mulator 8, and the lower order into accumulator A. MVN Mn+i-Mm+i Transmits the data block. The transmission is done from (Note 8) the lower order address of the block. MVP Mn-i-Mm-i Transmits the data block. Transmission is done form the (Note9) higher order address of the data block. NOP PC-PC+l Advances the program counter, but performs nothing else. EA 2 1 ORA Acc-AccVM Logical sum per bit of the contents of the accumulator and 09 2 2 05 4 2 15 5 2 12 6 2 01 7 2 11 8 2 (Note 1,2) the contents of the memory is obtained. The result is en- tered into the accumulator. ~ ~ ~ 42 8 3 42 9 3 42 10 3 09 05 15 12 01 11 PEA M(S)-IMM2 The 3rd and the 2nd bytes of the instruction are saved into s-s-1 the stack, in this order. M(S)-IMM1 s-s-1 PEI M(S)-M((DPR)tlMM Specifies 2 sequential bytes in the direct page in the 2nd tl) byte of the instruction, and saves the contents into the s-s-1 stack. M(S)-M((DPR)tlMM) s-s-1 PEA EAR-PCtlMM2,IMM1 Regards the 2nd and 3rd bytes of the inslruction as 16-bit M(S)-EAAH numerals, adds them to the program counter, and saves s-s-1 the result into the stack. M(S)-EAAL s-s-1 PHA m=O Saves the contents of accumulator A into the stack. M(S)-AH s-s-1 M(S)-AL s-s-1 m=1 M(S)-AL s-s-1 PHB m=O Saves the conten~ of accumulator B into the stack. M(S)-BH s-s-1 M(S)-B, s-s-1 m=l M(S)-BL s-s-1 256 APPENDIX B Series MELPS 7700 Machine Instructions Addressing mode Processor status register r----~-~-~-~--~·-~--~-~-~---~·-~~--~-~--~~- ---,------ ,,--,--! L(DIR) LIDIA).Y ABS ABS,b ABS,X ABS,Y ABL ABL,X (ABS) L(ABS) (ABS,X) STK REL DIR,b,R ABS,b,R SR (SR),Y BLK 10 9 8 7 6 5 4 3 2 I 0 A7ID2B7112AD43 - H-- t- +-+- 1 op n # op n # op n # op n # op n # op n # op n # op n # op n # op n # opff:J:l: op n # op n # op n # op n # op n # op n # op n # BD638963AF64BF74 A3528382 - IPL N V m x D I Z C N• •Z ~~42"113'416- 4 W41:\2 8 4 42 8 5 42 9 5 I ' ~ i~ 3 M ro ~ oo m Af ~ ~ m t---t---+-t-+t-t--H- - +-H- H-t-++1 1-- --- - i+--H---H--+-+-+-+-t-++-r--t---t----J-T-+--t--t--1--+--1 9C54 9E64 f-+-+-+--r-+-+-r-+-+-+-1-t-+-+-l-+-+-+-+-+-+-+-+-+-t-+-+-+-t-+-+-++-+-+-++-f--+t-t-+---l-c·-t-+-H- f-- -- t I-+ - - +-+-+-+-+-+-+-+-f--+ -1-++- l-++-+--1 AE43 BE63 N • • z AC 4 3 BC 6 3 N • • z l >-+-+-+--+-+-+4-E+-7-+-3+-+-+I-+5-E1-8+3--+--+-"r-+-+-+-~>-+-+-+-+-+-t--+--1-++-r-+-+-+-r-+-+-+-+--+--+-+-+--+-~l-+--+-+-+-+--+-+-+--+--+--+-o+-~--+-+--+-z+-;c I 1 89 24 3 89 25 3 89 18 4 89 2014 89 20 4 89 20 5 89 21 5 8919 3 8922 3 • N • • z 0 1 19 I 07 17 OD lD OF 1F 03 13 I l 54li 3 __!_X7 : >-+-+--+-r-+-+-+--f-+-+-+--+-+--+-+--+-+--+-+--+-+--+-+--+--+--+-+--+--+- 2 r-+--+--1 -+--+--t--1--+--+--+--t--1 44W3 +x? 07102171120D4 3 ID 6 3 19 6 3 OF 6 4 IF 7 4 II N • • Z 1 03521382 1 42 12 3 42 13 3 42 6 4 428 4428 4428 5429 5 1-42+--7f--3+4-2f--10+3--1 07 17 OD ID 19 UF IF 03 l 13 42 6 2 48 I I I l ..l I I I 1 l l 257 APPENDIX B Series MELPS 7700 Machine Instructions Addressing mode Symbol Function Details IMP IMM A DIR DIR,b DIR,X DIR,Y (DIR) (DIR,X) (DIR),Y I op n :j:I: op n ll op n ll op n ll op n ll op n ll op n ll op n ll op n ll op n ll PHD M(S)-DPRH Saves the contents of the direct page register into the s-s-1 stack I M(S)-DPR, s-s-1 I I PHG M(S)-PG Saves the contents of the program bank register into the s-s-1 stack. PHP M(S)-PSH Saves the contents of the program status register into the s-s-1 stack. PHT M(S)-PS, s-s-1 M(S)-DT s-s-1 Saves the contents of the data bank register into the stack. l i I I PHX x=O Saves the contents of the index register X into the stack. M(S)-XH s-s-1 MISl-x, s-s-1 x=l M(S)-X, s-s-1 PHY x=O Saves the contents of the index register Y into the stack. I M(S)-YH ! s-s-1 M(S)-Y, s-s-1 I i x=l M(S)-Y, s-s-1 PLA m=O Restores the contents of the stack on the accumulator A. s-s+1 i A,-M(S) s-s+1 AH-M(S) m=l s-s+1 A,-M(S) PLB m=O Restores the contents of the stack on the accumulator B. s-s+1 B,-M(S) s-s+1 BH-M(S) m=l s-s+1 B,-M(S) . PLD s-s+1 Restores the contents of the stack on the direct page reg- DPR,-M(S) ister. s-s+1 DPRH-M(S) PLP s-s+1 Restores the contents of the stack on the processor status PS,-M(S) register s-s+1 PSH-M(S) PLT s-s+1 Restores the contents of the stack on the data bank reg- DT-M(S) ister PLX x=O Restores the contents of the stack on the index register X. s-s+1 x,-M(S) s-s+1 XH-M(S) x=l s-s+1 x,-M(S) 258 APPENDIX B Series MELPS 7700 Machine Instructions Addressing mode Processor status register L(DIR) LIDIR),Y ABS ABS,b ABS,X ABS,Y ABLABL,X (ABS) L(ABS) (ABS,X) STK REL DIR,b,R A8S,b,R SR (SR),Y BLK 10 9 8 7 6 5 4 3 2 1 0 --,-j -,--- ~+-,,-j op n # op n #op n # op n #op n # op n #op n # op n # op n # op n #op n # op n # op n # op n #op n # op n # op n # op n # IPL N v m x D I z c OB 4 1 48 3 1 08 4 1 -- 88 3 1 DA 4 1 5A 4 1 68 5 1 N z 42 7 2 N z 68 2B 5 1 28 6 1 Value saved in stack. AB 6 1 N z FA 5 1 N z 259 APPENDIX B Series MELPS 7700 Machine Instructions Addtessing mode Symbol Function Details IMP IMM A DIR DIR,b DIR,X DIR,Y (DIR) (DIR,X) (DIR),Y op n #op n # op n # op n # op n #op n # op n #op n # op n #op n # PLY x=O Restores the contents of the stack on the index register Y. s-s+1 v,-M(S) s-s+1 YH-M(S) x=l s-s+1 Y,-M(S) PSH M(S)-A, B, X... Saves the registers among accumulator, index register, (Note 6) direct page register, data bank register, program bank register, or processor status register, specified by the bit pattern of the second byte of the instruction into the stack. PUL A, B,X--·-M(S) Restores the contents of the stack to the registers among (Note 7) accumulator, index register. direct page register, data bank register, or processor status register, specified by the bit pattern of the second byte of the instruction. ALA m=O Rotates the contents of the accumulator A, n bits to the 89 6 3 (Note 13) n bit rotate left left. 49+ I ~J m=l n bit rotate left y b1I ulbo 1J AOL m=O Links the accumulator or the memory to C flag, and rotates 2A 2 1 26 7 2 36 7 2 (Note 1) result to the left by 1 bit. 4iiN-llilj ~ 2A m=l Y b,i Ibo 1-llilj ROA m=O Links the accumulator or the memory to C flag, and rotates 6A 2 1 66 7 2 76 7 2 (Note 1) result to the right by 1 bit. Lllil-~I u I bOJJ ~ 6A m=l [llil-1 b1I Ibo~ RTI s-s+1 Returns from the interruption routine. 4011 1 PS,-M(S) s-s+1 PSH-M(S) s-s+1 PC,-M(S) s-s+1 PCH-M(S) s-s+1 PG-M(S) RTL s-s+1 Returns from the subroutine. The contents of the program SB 8 1 PC,-M(S) bank register are also restored. s-s+1 PCH-M(S) s-s+1 PG-M(S) ATS s-s+1 Returns from the subroutine. The contents of the program 60 5 1 PC,-M(S) bank register are not restored. s-s+i PCH-M(S) SBC Acc. C-Acc-M-C Subtracts the contents of the memory and the borrow from E9 2 2 E5 4 2 F5 5 2 F2 6 2 El 7 2 Fl 8 2 (Note 1,2) the contents of the accumulator. ~ ~ '4217IJ 42 B 3 42 9 3 4210 3 E9 E5 F5 F2 El Fl 260 APPENDIX B Series MELPS 7700 Machine Instructions Addressing mode Processor status_~~~e~ _ f--~--~·-~--~---~-~--~-~---~--T-·--- L( DIR) L(DIR),Y ABS ABS,b ABS,X ABS,Y ABL ABL,X (ABS) L(ABS) (ABS,X) STK REL DIR,b,R ABS,b,R SR (SR),Y BLK 10 9 8 7 6 5 4 3 2 1 0 7A 5 1 N z -···t·-··i-+--+·-+·-t-t-it--+-+-t--t-+-t--+-+-t--t-+-f-t-t--+--+--+--+--t-+-+-+---+-~-~-t EB 12 2 + 2i1+i2 FB 14 2 If restored the contents of PS, + it becomes its value. And the 311+4i2 other case is no change. 1E 7 3 3E 8 3 N Z C 6E 7 3 7E 8 3 N Z C - -+ --I- -+-t-+-+-t--+-+--+-+ -t-+--t-t-1-t-t-~ -+-t-+--+-+--+-+-t--+-+-++-+--+-+-+-t-+-+--+-+-1---~~~~~~~~~-t Value saved in stack., E7102F7112ED43 FD63F963EF64FF74 E3 5 2 F3 8 2 N V Z C ~212342133426 4 428 4428 4428 5419 5 427342103 E7 F7 ED FD F9 EF FF E3 F3 261 APPENDIX 8 Series MELPS 7700 Machine Instructions Addressing mode Symbol Function Details IMP IMM A DIR DIR,b DIR,X DIR,Y (DIR) (DIR,X) (DIR),Y op n #op n # op n #op n # op n # op n # op n # op n # op n #op n # SEB Mb-1 Makes the contents of the specified bit in the memory "1". 04 8 3 (Note 5) SEC c-1 Makes the contents of the C flag "1". 38 2 1 SEI 1-1 Makes the contents of the I flag "1 ". 78 2 1 0 SE M m-1 Makes the contents of them flag "1". FS 2 1 SEP PSb-1 Set the specified bit of the processOI" status register's low~ E2 3 2 er byte (PSL) to "1". STA M-Acc Stores the contents of the aqcumulator into the memory. 85 4 2 95 5 2 92 7 2 81 7 2 91 7 2 (Note 1) ~ ~ 42 9 3 42 9 3 42 9 3 85 95 92 81 91 STP Stops the oscillation of the oscillator. DB 3 1 STX M-X Stores the contents of the index register X Into the memory. 86 4· 2 96 5 2 STY M-Y Stores the contents of the index register Y Into the memory. 84 4 2 94 5 2 TAD DPR-A Transmits the contents of the accumulator A to the direct SB 2 1 page register. TAS S-A Transmits the contents of the accumulator A to the stack pointer. IB 2 1 TAX X-A Transmits the contents of the accumulator A to the Index AA 2 1 register X. TAY Y-A Transmits the contents of the accumulator A to the Index AS 2 1 register Y. TBD DPR-B Transmits the contents of the accumulator B to the direct 42 4 2 page register. SB TBS S-B Transmits the contents of the accumulat0t B to the stack 42 4 2 pointer. IB TBX x-e Transmits the contents of the accumulator B to the index 42 4 2 register X. AA TBY Y-e Transmits the contents of the accumulator B to the Index 42 4 2 register Y. AS TOA A-DPR Transmits the contents of the direct page register to the 7B 2 1 accumulator A. TDB B-DPR Transmits the contents of the direct page register to the 42 4 2 accumulator B. 7B TSA A-S Transmits the contents of the stack pointer to the accumulator A. 3B 2 I TSB e-s Transmits the contents of the stack pointer to the accumu- 42 4 2 later s·. 3B TSX x-s Transmits the cOntents of the stack pointer to the Index BA 2 I register X. TXA A.._X Transmits the contents of the Index register X to the accu- SA 2 1 mulator A. TXB e-x Transmits the contents of the Index register X to the accu- 42 4 2 mutator B. BA TXS s-x Transmits the contents of the index register X to the stack 9A 2 1 pointer. TXY Y-x Transmits the contents of the Index register X to the Index 9B 2 1 register Y. TYA A-Y Transmits the contents of the index register Y to the accu- 98 2 1 mulator A. TYB B-Y Transmits the contents of the index register Y to the accu- 42 4 2· mulator B. 98 TYX x-Y Transmits the contents of the index register Y to the Index BB 2 I register X. WIT Stops the Internal clock. CB 3 1 XAB A!;B Exchanges the contents of the accumulator A and the con- 69 6 2 tents of the accumulator B. 28 262 APPENDIX B Series MELPS 7700 Machine Instructions Addressing mode Processor status register ~-DIR)Y ABS ABSb Tf..~BS.v AB~- A-BL~ 0-:Bsl L(A-BS) (ABSX) -STK- -REL DrnbR 'ABSbf; sR'T8R)v'SL~ ~ 7 6 5 4~2 1-.. ·~ op n # op n :tt: op n # op n # op n # op] n # op n # op n # op n # op n # op n I# op n # op n # op n # op n # op n # op n # op n # IPL N V m x D I z C 0C94 --: I ... ··1·:~ - t + 1- t-++- --+-~-+-+-·+- -· t-- t·+++- . -+-+-- -r- - --- -t • 1 1-+-+--+-·+~-+-+-+-+-+-+-·+-+-+-+-+-t-+-+-+-~1· I· ++-i-+-+-+--i··-j- +·-t-+-+-+-t-+-+-t-+-i-+-+-+-+-+-+-+-.f-1-+-+-I 1-+-+-+-+~-+-t· t-+-+-· +-t·-t--t-+-+-+-+-r-+-t-+-+-+-+-+1-+-+-+-+- +-+--+--t-+-+-+-+-+-+--+-+-+-+-+-+-+-t-+-+-+-+-~-t-+-+--i--+-+-+--1-1 • 1 t-+-t-1-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-~-+-+-+-I-+-+-+-+-+-+-+- t-i-+-t-+-t-1-+-+-+-+-+-++-+-1-+-t-+-t-1-+-+-+-·+-+-+--L~--LL.'-l Specified flag be- comes "1" 1-+-++-+-+-+-f-+-t-1-+·++-1-+-++++++-·1-+-+-+-I-+· t-i-++-t·- - 83 5 2 93 B 2 -+-+-+-+-+-+-.-1·-. ~ r:-':' 8710 2 9711 2 SD 5 3 90 5 3 99 5 3 SF 6 4 9F 7 ! 4212 3 4213 3 42 7 4· 42 7 4 42 7 4 42 8 5 42 9 427342103 87 97 SD 9D 99 BF 9F 83 93 I +-+f--t--t-·+-+-+ +-t-+-+--+--+-·j-j -+--+-+-+-+-+-+-+-+-+-~-+-+·-+-+--+-+-+-< !, t-+-+--+-+-+-+-+-+-+-+--r-+-·-· ··t-+-+-+-+--+-+--+ ·1--t--t--1-+-t--t--+-t--+-+-+-t-+-+--t-+-+-+-+-+-+-+--r-T-+-t--+--t--t-+-+-+-+-+--+--+-+-+-+--+-i BE 5 3 +-+-+-+-!-+-+-+-++-+--+-++-+-++ t-t-+- . BC 5 3 . . i· t-+-+-- . - --1- +-- • 1 • -t--+-+-~1-+-+--+-+-+-+-+·+-1-+-+-+-+- .. +-+-+- - t-+-+-+-+-t- t - . 1 0 -++-+-+-+-+-+-t-++-+-·+-+--+-+-+-+-+-+-+-i-+--+-+-+--+--+I_· 1--+-+-+--+-·H N • Z . .. t-+-t-i +-i -++- -+--+-+-+~+-+-+ ++i-+-+-·+-+-+-+·-t-+-+-+-1-+ ·+I · +-+-+·-+-+-+-+-+--+-+-+-+--+-+-+-+--+-+-+-+-< N • z • 1-+-++-i - ··-+-+-+-+-+-+-+ t+-+-+--+-+-+-tf-+ 1-+-t-+- -+-+-+--+-+--+-+j··-t-J-i·-+-+-+-+-t-+-r-+-+-+-·+-+-+-+-+-t-+-+-+-+--+-+-+-+-+-+-+-+-t-+-+--+-+--+-+--+-+-+-+-t--+-+-+-+--+- ·r·,. l t-+-+--t-+--+-+-l-r'-+--+-+-+1-+-+-+-+-+-+-+--+--r-+--t-+~-+-+--t-+-+--+--+-+-t-+-+--t-+-+--+--+-+-+-+-t--t-+-+-+-+-+-t-+-+--+--t-+-Nt~ •t-+-t· N • • z Z • I I -1-i--·-r-+-+1-+-t--t--+-+-+-+-+-t-+-+--+-+--i-+-+--+--+-+-+-+-t--+-+-+- i Ni• t-++++- .. -t·+t·-i--t++ - t·t t-+-T-t- +++++ -t-j- ! + ·t-+-+-t-f-~·-1- t ·+- -+-t-i-++- -+-+-+-+--+-+--t--+-+-~--j-- N z I . +-++-· +-- . +-. ++-r-+-+-+-+-+-+· +-++-+-~-++-+-t-+-~-+-+-+-+--+--+-+-+-C-~-···· N z T N t--i-+--+-+-+-·+--+-+-+-+-+-+-+·t-t·+·-t-- I I I I ' t-+ ·l N Z +-++-t+++-i-I i -++-+-+-+-r-++-t-+-+-+-+-+-+-+ f +-+-t+- t-1 N Z N • z • 1-+-+--+-+-+-+-+-+-+-+-+--+-+-t-+-+--+-+-+-+-+-+-+-+-+-+-+-t-+-+--+-t-+--+-+--+-+--+-+-+-+-+-+-+-+-+--+-+--+-+-+-+--+-+-•--+-+--f-j·+-+- t-+-+-·+--+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+~-+-+-+-+-+-+-+-+-r-+-+-+-r-+-+-+-+t-+-+-~-+-+-+-+-+-+-+-+-~~.+-t--t-+-f +-+-+-+-1·-t-+-1 I N • • z • - t-, _J_,_~--t--i-+-t--· 1--j - 1-+++-i 1 I I ++-+-t- ••• N •• -+-+--t-+-+-+-+--t-+-+-+-+-+-t-+-+--t-+-+-+-+--t-+-+-+-+-+-t-+-+--t-+-+t-+-+--+-++-+-r·+-+-t-+-+--+-+-t··t·l·+-+-+-+--t--+--+-+-+-+--+-+-+-+--+ N • z • N • • Z .,. z • J. I T l l N • 263 APPENDIX 8 Series MELPS 7700 Machine Instructions The number of cycles shown in the table is described in case of the fastest mode for each instruction. The number of cycles shown in the table is calculated for DPRL =O. The number of cycles in the addressing mode concerning the DPR when DPRL 4'0 must be incremented by 1. The number of cycles shown in the table differs according to the bytes fetched into the instruction queue buffer, or according to whether the memory read/write address is odd or even. It also differs when the external region memory is accessed by BYTE="H". Note 1 . The operation code at the upper row is used for accumulator A, and the operation at the lower row is used for accumulator B. Note 2. When setting flag m=O to handle the data as 16-bit data in the immediate addressing mode, the number of bytes increments by 1. Note 3. The number of cycles increments by 2 when branching. Note 4. The operation code on the upper row is used for branching in the range of -128-+127, and the operation code on the lower row is used for branching in the range of -32768-+32767. Note 5. When handling 16-bit data with flag m=O, the byte in the table is incremented by 1. Note 6. T e of register A B x y DPR DT PG PS Number of c cles 2 2 I The number of cycles corresponding to the register to be pushed are added. The number of cycles when no pushing is done is 12. i1 indicates the number of registers among A, B, X, Y, DPR, and PS to be saved, while i 2 indicates the number of registers among DT and PG to be saved. Note 7. Ty e of register A B ~X~+--_Y,_ _D~P~R-+-~D~T-+ PS t--N-u~m~b_e_r_o_f~c-c-le-s-t---3~-t-~3 3 3 4 3 3 The number of cycles corresponding to the register to be pulled are added. The number of cycles when no pulling is done is 14. i, indicates the number of registers among A, B, X, Y, DT, and PS to be restored, while b=1 when DPR is to be restored. Note 8. The number of cycles is the case when the number of bytes to be transfered is even. When the number of bytes to be transfered is odd, the number is calculated as; 7+ (i/2) X7+4 Note that, ( i/2) shows the integer part when i is divided by 2. Note 9. The number of cycles is the case when the number of bytes to be transfered is even. When the number of bytes to be transfered is odd, the number is calculated as; 9 + (i/2) x 7+ 5 Note that, (i/2) shows the integer part when i is divided by 2. Note 10. The number of cycles is the case in the 16-bit+8-bit operation. The number of cycles is incremented by 16 for 32-bit+16-bit operation. Note 11. The number of cycles is the case in the 8-bitX8-bit operation. The number of cycles is incremented by 8 for 16-bit X16-bit operation. Note 12. When setting flag x=O to handle the data as 16-bit data in the immediate addressing mode, the number of bytes increments by 1. Note 13. When flag m is 0, the byte in the table is· incremented by 1. 264 APPENDIX B Series MELPS 7700 Machine Instructions Symbol Description Symbol Description IMP - -----· Implied addressing mode ---~----------- ------------ t---V------··· -E-x-cl~;i-ve_O_R __________ _ IMM Immediate addressing mode Negation A Accumulator addressing mode Movement to the arrow direction DIR Direct addressing mode Ace Accumulator DIR, b Direct bit addressing mode AccH Accumulator's upper 8 bits DIR, X Direct indexed X addressing mode AccL Accumulator's lower 8 bits DIR, Y Direct indexed Y addressing mode A Accumulator A (DIR) Direct indirect addressing mode Accumulator A's upper 8 bits (DIR, X) Direct indexed X indirect addressing mode Accumulator A's lower 8 bits (DIR), Y Direct indirect indexed Y addressing mode Accumulator B L (DIR) Direct indirect long addressing mode Accumulator B's upper 8 bits L (DIR), Y Direct indirect long indexed Y addressing mode Accumulator B's lower 8 bits ABS Absolute addressing mode Index register X ABS, b Absolute bit addressing mode XH Index register X's upper 8 bits ABS,X Absolute indexed X addressing mode XL ' Index register X's lower 8 bits ABS, Y I Absolute indexed Y addressing mode y Index register Y ABL Absolute long addressing mode YH Index register Y's upper 8 bits ABL, X I Absolute long indexed X addressing mode YL Index register Y's lower 8 bits (ABS) Absolute indirect addressing mode s Stack pointer L (ABS) Absolute indirect long addressing mode PC Program counter (ABS, X) Absolute indexed X indirect addressing mode PCH Program counter's upper 8 bits STK Stack addressing mode PCL Program counter's lower 8 bits REL Relative addressing mode PG Program bank register DIR, b, REL Direct bit relative addressing mode OT Data bank register ABS, b, REL Absolute bit relative addressing mode DPR Direct page register SR Stack pointer relative addressing mode DPRH Direct page register's upper 8 bits (SR), Y Stack pointer relative indirect indexed Y addressing DPRL Direct page register's lower 8 bits mode PS Processor status register BLK Block transfer addressing mode PSH Processor status register's upper 8 bits c Carry flag PSL Processor status register's lower 8 bits z Zero flag PSb Processor status register's b-th bit I Interrupt disable flag M(S) Contents of memory at address indicated by stack D Decimal operation mode flag pointer x Index register length selection flag b-th memory location m Data length selection flag Value of 24-bit address's upper 8-bit (A 23 ,..._.A 16 ) v Overflow flag Value of 24-bit address's middle 8-bit (A 15 ~A 8 ) N Negative flag Value of 24-bit address's lower 8-bit (A 7 ,..._.A0 ) IPL Processor interrupt priority level Operation code + Addition n Number of cycte Subtraction Number of byte Multiplication Number of transfer byte or rotation * / Division Number of registers pushed or pulled /\ Logical AND v Logical OR l 265 APPENDIX C Series MELPS 7700 Instruction Code Table INSTRUCTION CODE TABLE-1 D3 -D. 0 t-~ -0~~0010-+-~TI~ 0101 0110 i 0111 1000 1001 _1_0__1_0-t-_1_0__1__ 1-+-----1----10----0-+l----1__ 1-+- - l- - l - - O- -+- - l- - l -I-~ 10__ adecimal -+--------+---~t------J-- notation 0 I 2 3 4 5 6 I 7 8 9 A B C D E F ORA ORA SEB ORA ASL ORA ORA ASL SES ORA ASL ORA 0000 0 BRK ~- PHP PHD D_IR,b ~ 1 ~R -T-A__,L__( __ t ---lA,(~---- _ __ A,SR_Dl__ R-t)----+-A__,__ IM__M-+---D----A __ EC_',__,---+---A__ B__ b-+,__A__,A__B__S-+·- ABS ~~El_~ S,__ ORA CLB ORA 1 ORAASL ORA ORA ORA CLB ORA ASL ORA 0001 CLC TAS I BPL A,(DIR),YIA,( DIR) A,(SR),Y DIR,b A,DIR,X DIR,X A,LIDIR),Y A,ABS,Y A ABS,b A,ABS,X ABS,X A,ABL.:'----+------+- B B CMP ~:~.YIB,~:~R) B,~;R~,Y CMP B.~:~X1 CMP iB L~: )_.'I CMP 1_.~_:__:__ CMP ,Y_,_______ _,_ __ I 1 -tlB_.~_:_:_.x ---i-----l--i-iB_,_~:_:_.x_t CMP I __ CMP 1100 c 8,(DIR,X) B,SR ---+B,DIR ____ B,L(DIR) B,IMM I B,A_B_S__,_ _ _-+--B_,_AB_L~ 1 : CMP CMP CMP CMP CMP CMP I I CMP CMP (SR),Yt------~_f1_;''!<_11 1101 0 1 :B,(DIRl,Y B,(OIR) 8 _____ 8,L(DIRIJ B.ABS.tl B.ABS,X 8,ABL,X SBC SBC I SBC SBC SBC I SBC I SBC 1110 E I I I B,(DIR,XI ~,SR __ _j_B,DIR B,L(DIR) ---+-B_,IM_Mj-+---+----1-----+-~ B,ABL 1111 F SBC SBC i SBC B,(DIR),YB,(DIRlB,(SRl,Y i SBC lB,DIR,4 I SBC B,L(DIR~ I ls.ABS.YI SBC ,I I SBC B,ABS.1 I ----tssc-i B,ABL,X I ( 267 APPENDIX C Series MELPS 7700 Instruction Code Table INSTRUCTION CODE TABLE-3 (The first word's code of each instruction is 89 16) D,-Do lladecimal notation oroo T""' O l I 1 "'"'1"'"' 1: ]213 oorn oon 4 1 5, m10 6 0111 7 1000 : 1001 8]9!AIB i 1010 1011 1100 c 1101 D ! 1 lllO E 1111 F I i l , 0000 0 MPY I : MPY MPY I MPY I MPY : : MPY I MPY I ! !-------"------+----{~~-+~- ~R) I I I I ABL MPY I MPY ' MPY DIR MPY : I MPY ' IMM I MPY I I ABS ' MPY : t--;;wy r r"' j_,::ti-- __ 0001 I I I I 1 : I : : 1------+----+---+-DIV __R_)_,Y_, (DIR),Y (_D_l_R_d (_S -, DIV ~- ___ ~ l ___t'L_(D_IR_)Y I DIV DIV t ABS Y 1 1 ----- ___,__ .:_ ___ __j_ _ _ t----r--'-__;_ 1 ABSX 1 ASL X .____o_m_o_+--2-+---+(_D_IR_,_X+) 1 DIV ----~--Ju" I- DIV I DIV 1 DIV I DIV AA' , DIV ti______ --- 1 ;;~t-J-:~:- DIV 1 DIV 0011 3 I i i I I : : ](DIR),Y (DIR)-j(§_Rl 2~ ~---- ----r- __ f!-E3_8_.~_I __ ~_13_l:c_X : +-r : ____ ,_121_R,J<' L(DIR1 Y ABS Y 1 r----010014 : I +- i RLA I : ' : : ~--'-+H-1-:~'---; :ur--,-1'MM:J~~- c1-1- I :I ----+-- --+----+----+----+ : t t---t .-~-~---· I ++.'. n+m!--t Hrn r t I I-' I I I I I : I I i 1~- 1'·-+ )--1-_J __ ·-····-I rt ! H H 1-------------+-+-----r--- - r -----l---- J ~ I : +-----1 -i-- i -i-f---- ----+----11----1L -+---- : 1 : I I I : I i l------f-------jf----f----f----1>--,- I I I i ' ' ' ----+---+-------t--,---1L-:~- +1-_,t--_iJ I i -+ I I I 1- I I ~ 1---+----+----+----+------+---f----+---+----~--+--- : I , : I I ----r---r ---+--i-- ' I I I I : I I i <-------+----+---- t---+-----+~----l-----+---+---'r-----+----+------+----+--f--+-----~~---i----r-----1 l l l i l 1 268 CONTACT ADDRESSES FOR FURTHER INFORMATION JAPAN SOUTHWEST WEST GERMANY Semiconductor Marketing Division Mitsubishi Electronics America, Inc. Mitsubishi Electric Europe GmbH Mitsubishi Electric Corporation 991 Knox Street Headquarters: 2-3, Marunouchi 2-chome Torrance, CA 90502 Gothear Str. 8 Chiyoda-ku, Tokyo 100, Japan Telephone: (213) 515-3993 4030 Rat1ngen 1, West Germany Telex: 24532 MELCO J Facsimile: (213) 217-5781 Telex 8585070 MED D Telephone: (03) 218-3473 Telephone: (02102) 4860 (03) 218-3499 SOUTH CENTRAL Facsimile: (02102) 486-115 Facsimile: (03) 214-5570 Mitsubishi Electronics America, Inc 1501 Luna Road, Suite 124 Munich Office: Overseas Marketing Manager Carrollton, TX 75006 ArabellastraBe 31 Kita-ltami Works Telephone: (214) 484-1919 8000 MUnchen 81, West Germany 4-1, Mizuhara, ltami-shi, Facsimile· (214) 243-0207 Telex· 5214820 Hyogo-ken 664, Japan Telephone: (089) 919006-09 Telex· 526408 KM ELCO J NORTHERN Facsimile· (089) 9101399 Telephone: (0727) 82-5131 Mitsubishi Electronics America, Inc Facsimile: (0727) 72-2329 15612 Highway 7 +F 243 FRANCE Minnetonka, MN 55345 Mitsubishi Electric Europe GmbH HONG KONG =~·~·=ccc Telephone: (612) 938-7779 55, Avenue de Colmar MITSUBISHI ELECTRIC (H.K) LTD Facsimile: (612) 938-5125 92563 Rueil Malmaison Cedex 25 Floor, Leighton Centre, Telex: 632326 77, Leighton Road. Causeway Bay. NORTH CENTRAL Telephone: 47087871 Hong Kong Mitsubishi Electronics America, Inc Facsimile: 47513622 Telex: 60800 MELCO HX 800 N. Bierman Circle Telephone: (5) 773901-3 Mt. Prospect, IL 60056 ITALv--- -- Facsimile: (5) 895-3104 Telephone: (312) 298-9223 Mitsubishi Electric Europe GmbH Facsimile: (312) 298-0567 Centro Direzionale Colleoni SINGAPORE=~ ---·- Palazzo Cassiopea 1 MELCO SALES SINGAPORE PTE. NORTHEAST 20041 Agrate Brianza I-Milano LTD. Mitsubishi Electronics America, Inc. Telephone: (039) 636011 230 Upper Bukit Timah Road # 03- 200 Unicorn Park Drive Facsimile (039) 6360120 01 /15 Woburn, MA 0180 t Hock Soon Industrial Complex Telephone: (617) 932-5700 SWEDEN ==c.=c.~ Singapore 2158 Facsimile: (617) 938-1075 Mitsubishi Electric Europe GmbH Telex: RS 20845 MELCO Lastbilsvagen 6B Telephone: 4695255 MID-ATLANTIC 5-19149 Sollentuna, Sweden Facsimile: 4695347 Mitsubishi Electronics America, Inc. Telex: 10877 {meab S) 800 Cottonta1i Lane Telephone: (08) 960468 TAIWAN·--= ...~ Somerset, NJ 08873 Facsimile: (08) 966877 MELCO-TAIWAN CO., Ltd Telephone: (201) 469-8833 1st fl., Chung-Ling Bldg., Facsimile: (201) 469-1909 U.K. 3G3, Sec. 2, Fu-Hsing S Road, Mitsubishi Electric (U.K.) Ltd. Taipei R.0.C. SOUTH ATLANTIC Travellers Lane Telephone: (02) 735-3030 Mitsubishi Electronics America, Inc. Hatfield Facsimile: (02) 735-6771 2500 Gateway Center Blvd, Suite 300 Herts AL 10 8X B, England, U.K Telex 25433 CHURYO "MELCO- Morrisville. NC 27560 Telephone: (0044) 7072 76100 TAIWAN" Telephone (404) 368-4850 Facsimile· (0044) 7072 78692 Facsimile: (404) 662-5208 U.S.A.~~-­ AUSTRALIA' NORTHWEST SOUTHEAST Mitsubishi Electric Australia Pty. Ltd. Mitsubishi Electronics America. Inc. Mitsubishi Electronics America, Inc 73-75, Epping Road, North Ryde, 1050 East Arques Avenue Town Executive Center P.O. Box 1567, Macquarie Centre, Sunnyvale, CA 94086 6100 Glades Roan # 21 o N.S.W., 21 t3, Australia Telephone: (408) 730-5900 Boca Raton, FL 33433 Telex· MESYD AA 26614 Facsimile: (408) 730-4972 Telephone: (407) 487-7747 Telephone· (02) (888) 5777 Facsimile· (407) 487-2046 Facsimile· (02) (887) 3635 SAN DIEGO Mitsubishi Electronics America, Inc. CANADA 11545 West Bernardo Court Mitsubishi Electronics America, Inc Suite 100 6185 Ordan Drive, Unit ii 11 O San Diego CA 92128 Mississauga, Ontario, Canada L5T 2E1 Telephone: (619) 592-1445 Telephone: (416) 670-8711 Facsimile: (619) 592-0242 Facsimile (416) 670-8715 DENVER Mitsubishi Electronics America, Inc. Mitsubishi Electronics America, Inc. 300 March Road, Suite 302 4600 South Ulster Street Kanata, Ontario, Canada K2K 2E2 Metropoint Building. 7th Floor Telephone: (416) 670-8711 Denver, CO 80237 Facsimile' (416) 670-8715 Telephone· (303) 740-6775 Facsimile: (303) 694-0613 MITSUBISHI SEMICONDUCTORS MELPS 7700 (SOFT WARE) USER'S MANUAL July. First Edition 1989 Editioned by Committee of editing of Mitsubishi Semiconductor USER'S MANUAL Published by Mitsubishi Electric Corp., Semiconductor Marketing Division This book, or parts thereof, may not be reproduced in any form without permission of Mitsubishi Electric Corporation. ©1989 MITSUBISHI ELECTRIC CORPORATION MITSUBISHI SEMICONDUCTORS MELPS 7700