=== page 1 === TOSHIBA TLCS-900/H CPU 5. Instructions In addition to its various addressing modes, the TLCS-900 series also has a powerful instruction set. The basic instructions are classified into the following nine groups: @ Load instructions (8/16/32 bits) @ Exchange instructions (8/16 bits) e@ Block transfer and Block search instructions (8/16 bits) e Arithmetic operation instructions (8/16/32 bits) @ Logical operation instructions (8/16/32 bits) e Bit operation instructions (1 bit) @ Special operations, CPU control instructions @ Rotate and Shift instructions (8/16/32 bits) e Jump, Call, and Return instructions Table 5.1 lists the basic instructions of the TLCS-900 series. For details of instructions, see Appendix A; for the instruction list, Appendix B; for the instruction code map, Appendix C; and for the differences between the TLCS-90 and TLCS-900 series, Appendix D. CPU900H-23 2001-03-16 === page 2 === TOSHIBA TLCS-900/H CPU Table 5.1 TLCS-900 Series Basic Instructions LD dst, sre Load dst value to C flag. STCF bit, dst Store carry flag: copy C flag value to dst. ANDCF | bit, src And carry flag: and src value and C flag, then load the result to C flag. ORCF bit, sre Or carry flag: or src and C flag, then load result to C flag. XORCF bit, sre Exclusive-or carry flag: exclusive-or src< bit > value and C flag, then load result to C flag. RCF Reset carry flag: reset C flag to 0. SCF Set carry flag: set C flag to 1. CCF Complement carry flag: invert C flag value. ZCF Zero flag to carry flag: copy inverted value of Z flag to C flag. BIT bit, src Bit test: Z flag — not src RES bit, dst Bit reset dst <0 SET bit, dst Bit set dst <1 CHG bit, dst Bitchange dst TSET bit, dst Bit test and set: Z flag — not dst dst <1 CPU900H-25 2001-03-16 === page 4 === TOSHIBA TLCS-900/H CPU BS1F A, dst Bit search 1 forward: search dst for the first bit set to 1 starting from the LSB, then set the bit number in the A register. BS1B A,dst Bit search 1 backward: search dst for the first bit set to 1 starting fom the MSB, then set the bit number in the A register. NOP No operation El imm Enable interrupt. IFFeimm DI Disable maskable interrupt. IFF<-7 PUSH SR Push status registers. POP SR Pop status registers. SWI imm Software interrupt PUSH PC&SR JP FFFFOOH + 10H ximm HALT Halt CPU. LDC CTRL - REG, reg Load control: copy the register contents to control register of CPU. LDC reg, CTRL—- REG Load control: copy the control register contents to register. LDX dst, src Load extract. dst<-src LINK reg, dd Link: generate stack frame. PUSH reg LD reg, XSP ADD SP, dd UNLK reg Unlink: delete stack frame. LD XSP, reg POP reg LDF imm Load register file pointer: specify register bank. RFP LSB RL num, dst Rotate left Lreyq MSB.— LSB <1 RR num, dst Rotate right MSB. => LSB SLA num, dst Shift left arithmetic MsB_<_ LSB }<0 SRA num, dst Shift right arithmetic MSB.—> LSB SLL num, dst Shift left logical MSB_<— LSB ]<-0 SRL num, dst Shift right logical o—! MSB —> LSB RLD dst Rotate left digit 9 Areg -____|as RRD dst Rotate right digit gens Areg as JR cc, PC +d Jump relative (8-bit displacement) if cc then PC<—PC +d. JRL cc, PC +dd Jump relative long (16-bit displacement) if cc then PC<-PC + dd. JP cc, dst Jump if cc then PC 1 bit [3 430/29|28)2 726125124)23)2212 1/20119/18)17/16/15[14[13[12[1 110] 9 |8|7|6/ 5/4] 3] 2] 1 | 0| BCD| Upper | lower | Upper | Lower | Upper ,; Lower | Upper | Lower | Byte MSE SBIMSB SRB CSBIMSBDCCULSB word MSB Sese cB Long word Notel : To access the parts indicated by F4 the instruction code is one byte longer than when accessing the other parts. (2) Memory Data Format 1 bit Address n|7|6|5|4[3|2[1]0| Byte Address n[MiSB_____ 158 ] Word Address n n+] Longword Addressn n+ ee n+3 Note2 : There are no restrictions on the location of word or long word data in memory. They can be located from even or odd numbered address. Note3 : When the PUSH instruction is used to save data to the stack area, the stack pointer is decremented, then the data is saved. Example: PUSH HL; XSP x1 _ a RAW ) es ee ee a A0 to 23 ) a a ee ee Z =| Addto1s nead 2 RD 7 e Ps 3| ADOto 15 = Write w DO to 15 (Din) a Read w RD ° Ps S DO to 15 a Ls WAIT es ee ee ee eee Note : CLK outputs are not always the same as the above phases. Figure 7.1 0 WAIT Read/Write Cycle CPU900H-32 2001-03-16 === page 11 === TOSHIBA TLCS-900/H CPU (at 25 MHz) <—___________———————- 240 ns T1 TW T2 < 40ns >| " fe CLK a Gee ee ee ee, Cee _ Sn a RAW ) a Ee ee ee (Se A0 to 23 ) Ea ee 5 a J LL ES x Read v nae 3 RD a = a a 3] ADO to 15 (AOtoI5 XK Dot Ss 7 Write rn ER, w| DOto 15 {__Din__) a Read » RD a 6 Po =| D0to 15 a rr ee war ~[ | |: | + ||. | Figure 7.2 1WAIT Read/Write Cycle CPU900H-33 2001-03-16 === page 12 === TOSHIBA TLCS-900/H CPU (at 25 MHz) }<—______________—_ 240 ns T1 TW T2 ~< 40ns > " fe CLK aD Ge ee ee eee eee __ a RAW ) a Es ee (Se A0 to 23 KR |: fT 5 mo hed aenmanne 3 RD a > ee ee >] ADO to 15 S 7 Write — eet tp w| DOto 15 (__Din__) a Read » RD a 3 a ee ee ee ~| DOto 15 8 Write Bm ——_ a ee WAIT ee ee ee Figure 7.3. 1WAIT +n Read/Write Cycle (n = 0) CPU900H-34 2001-03-16 === page 13 === TOSHIBA TLCS-900/H CPU 320 ns (at 25 MHz) T1 TW TW T2 < 40 ns > " PAYS CLK PoXt : | iXt tt | Xt TX _ SESE EEE RW ) rs ee ee ee ee eee (Sn a A0 to 23 a a ee 5 ©] ADO to 15 (_Din_) a Read 2 RD 2 FEE EEEEELT | 3] ADO to 15 = Lo] Write rn EEREEEEEEEE, w| DOto 15 (_Din_) a Read » RD | 6 re ee ee @| DOto15 o. Write §| em pL TTT hi ppt war 1 TT NYT VL Figure7.4 1WAIT +n Read/Write Cycle (n = 1) CPU900H-35 2001-03-16 === page 14 === TOSHIBA TLCS-900/H CPU 320 ns (at 25 MHz) T1 TW TW T2 <— 40 ns >] " PAYS CLK PX: Tt Xt XT XT _ SESE EEE RAV ) Ea (Sn a AO to 23 ) Ea 5 ©] ADO to 15 (_Din_) a Read 2 RD i ee S| ADOto 15 S Lo] Write Fe, wR teed | tp w| DOto 15 «_Din_) a Read » RD | ® Po «| DOto15 o Write S| em pT TTT re ee ee war TP Figure 7.5 2WAIT Read/Write Cycle CPU900H-36 2001-03-16 === page 15 === TOSHIBA TLCS-900/H CPU (at 25 MHz) 80 ns 40ns >| X1 ak —]. XT TT “yf A0to23 _ indeterminate _| =} a Vv o __ 3} = HWR, WR 3 DO to 15 vo “essen . WY WAIT Figure 7.6 1State Dummy Cycle CPU900H-37 2001-03-16 === page 16 === TOSHIBA TLCS-900/H CPU X1 CLK iD CE a Ce Ce ee Cee Os a ee AO to 23 ) eee) C50 to 2 ) a A RW rr rr a a ee wn a | ADOto 15 {_Din_) {_Din_) 2 Read 2 Pt ia 3] ADOto 15 HWR, WR _ ie a 2) Read e RD «| DOto15 ey Write Ww nn sa tre me Falling edge interrupt fi Rising edge interrupt Ld Level interrupt —_| Final cycle of instruction Interrupt response sequence — ---- Note : This timing chartisa theoretical example. In practice, due to the operation of the bus interface unit in the CPU, external bus and internal interrupt receive timings do not correspond one to one. Figure 7.7 Interrupt Receive Timing CPU900H-38 2001-03-16 === page 17 === TOSHIBA TLCS-900/H CPU R £ y 3 ! ! bor : ior I ~ re | : 2 bot oo ! Be Port E : 1 | 88 bor ne I 1 3% ne = Se i oi oi 6 ! boi ot “S77 fT TF +4 4 i I en ee . I . . . ! bor I I I I 1 . I . . « ro of ot ; ! ! ott = 1 I I Ie Is 1 1g ig if a8 I Ie I if 12 18 i I vin 1 -F +o Ss . I re 1 les Je le ask maskea as —— =