=== page 1 === TOSHIBA TLCS-900/H CPU Appendix B Instruction Lists | Explanation of symbols used in this document 1. Size B The operand size is in bytes (8 bits) W The operand size is in word (16 bits) L The operand size is in long word (32 bits) 2. Mnemonic R Eight general-purpose registers including 8/16/32-bit current bank registers. 8 bitregister: W, A, B, C, D, E, H, L 16 bitregister: WA, BC, DE, HL, IX, IY, IZ, SP 32 bit register: XWA, XBC, XDE, XHL, XIX, XIY, XIZ, XSP r 8/16/32-bit general-purpose registers cr All 8/16/32-bit CPU control registers DMASO to 3, DMADO to 3, DMACO to 3, DMAMO to 3, INTNEST A A register (8 bits) F Flag registers (8 bits) F’ Inverse flag registers (8 bits) SR Status registers (16 bits) PC Program Counter (in minimum mode, 16 bits; in maximum mode, 32 bits) (mem) 8/16/32-bit memory data mem Effective address value When the operand size is a word, “W” must be specified. [ ] Operands enclosed in square brackets can be omitted. # 8/16/32-bit immediate data. #3 3-bit immediate data: 0 to 7 or 1 to 8 ------ for abbreviated codes. #4 4-bit immediate data: 0 to 15 or 1 to 16 d8 8-bit displacement: — 80H to + 7FH d16 16-bit displacement: - 8000H to + 7FFFH cc Condition code (#8) Direct addressing : (00H) to (OFFH) --- 256-byte area (#16) 64K-byte area addressing : (Q000H) to (OFFFFH) $ A start address of the instruction is located CPU900H-156 2001-03-16 === page 2 === TOSHIBA TLCS-900/H CPU 3. Cord Z The code crepresent the operand sizes. byte (8-bit) =0 word (16-bit) =2 long word (32-bit) =4 ZZ The code represent the operand sizes. byte (8-bit) = 00H word (16-bit) = 10H long word (32-bit) = 20H 4. Flag (SZHVNC) - Flag doesn’t change. * Flag changes by executing instruction. 0 Flag is cleared to “0”. 1 Flag isset to “1”. P Flag changes by executing instruction (It works as parity flag). V Flag changes by executing instruction (It works as overflow flag). xX An undefined value is set in flag. 5. Instruction length Instruction length is represented in byte unit. +# adds immediate data length. +M adds addressing code length. +4M adds immediate data length and addressing code length. 6. State Execution processing time of instruction are shown in order of 8 bit, 16 bit, 32 bit processing in status unit. 1 state = 100 ns at 20 MHz oscillation 1 state = 80 ns at 25 MHz oscillation CPU900H-157 2001-03-16 === page 3 === TOSHIBA TLCS-900/H CPU HB 900/H Instruction Lists (1/10) (1) Load . . F Length Size Mnemonic Codes (16 hex) Function ZHVNC (byte) State BWL {LD R,r C8+zz+r :88+R Rer 2 2. 2. 2 BWL |LD r,R C8+zz+r =:98+R re¢R 2 2. 2. 2 BWL |LD r,#3 C8+zz+r =: A8+#3 re #3 2 2. 2. 2 BWL |LD R,# 20+zzt+R :# R<«# 1+# 2. 3. 5 BWL |LD ri# C8+zz+r =:03:# re# 2+# 3. 4. 6 LD BWL |LD R, (mem) 80+zz+mem: 20+R R <« (mem) 24M O44. 4. OG BWL |LD (mem) ,R BO+mem :40+zz+R |(mem) « R 2+M «6/4. 4. 26 BW- |LD (#8) ,# 08+z 748 :# (#8) « # 2+# |b. 6. - BW- |LD (mem),# BO+mem :00+z:# (mem) <« # 2+M# 15. 6. - BW- |LD (#16),(mem) /80+zz+mem:19:#16 (#16) <« (mem) 44M 8. 8. - BW- |LD (mem),(#16) |BO+mem :14+z:#16 |(mem) <« (#16) 4AM 68. 8. - B-- |PUSH F 18 (-XSP) « F 1 B. 7. 7 B-- |PUSH A 14 (-XSP) « A 1 3. -. - PUSH | ~WL |PUSH R 18+zz+R (-XSP) « R 1 -. 3.5 BWL |PUSH r C8tzz+r 304 (-XSP) « r 2 4.4.6 BW- |PUSH # 09+z i# (-XSP) « # 1+# 4.5. - BW- |PUSH (mem) 80+zz+mem: 04 (-XSP) « (mem) 2+M «OG. 6. - B-- |POP F 19 F < (XSP+) sida F 4. -. - B-- |POP A 15 A « (XSP+) -~-----|1 4. -. - -WL |POP R 38+Zz+R R © (XSP+) woeren td -. 4.6 BWL |POP r C8+zz+r = :05 r © (XSP+) ~-----|2 5. 5.7 BW- |POP (mem) BO+mem =: 04+z (mem) « (XSP+)|------]24*M 7. 7. - LOAR | -wL |LDAR R,$+4+d16 —-|F3:13:d16:20+zz+R |R< PCHd16 |------|5 +. 7. 7 (2) Exchange . . . Length Group| Size Mnemonic Codes (16 hex) Function ZHVNC (byte) State B-- |EX F,F’ 16 F< F’ 1 2.7. 7 EX BW- |EX R,r C8+zzt+r =: B8+R Rer 2 3. 3. - BW- |EX (mem) ,R 80+zz+mem: 30+R (mem) <= R 2+M «6. 6. - MIRR | -w- |MIRR r D8+r :16 r<0:MSB>«r ------|2. fb. 3. = CPU900H-158 2001-03-16 === page 4 === TOSHIBA TLCS-900/H CPU HM = 900/H Instruction Lists (2/10) (3) Load/Increment/Decrement & Compare Increment/Decrement Size . . . Length Group] Size Mnemonic Codes (16 hex) Function SZHVNC (byte) State LDI 83+zz :10 |(XDE+) © (XHL+) |--0@0-|2 8. 8. - [ (XDE+), (XHL+) ] BC 0+ ~=6BC-1 LDI 85+zz 210 ~—«|| (XIX+) © (XIY+) |--0@0-[2 8. 8. - (XIX+), (XIY+) BC ¢ BC-1 LDIR 83+2z :11 repeat 2 7n+1 [ (XDE+) , (XHL+)] (XDE+) © (XHL+) BC « BC-1 until BC=0 LDIR 85+2z :11 repeat 2 7n+1 (XIX+) , (XIY+) (XIX+) © (XIY+) BC « BC-1i until BC=0 LDxx LDD 83+zz :12 |(XDE-) © (XHL-) |--0@0-|2 8. 8. - [ (XDE-) , (XHL-) ] BC « BC-1 LDD 85+zz :12 |(XIX-) © (XIY-) |--0@0-|2 8. 8. - (XIX-), (XIY-) BC + BC-1 LDDR 83+zz :13 repeat 2 7n+1 [ (XDE-) , (XHL-)] (XDE-) © (XHL-) BC « BC-1i until BC=0 LDDR 85+zz 213 repeat 2 7n+1 (XIX-), (XIY-) (XIX-) © (XIY-) BC « BC-1i until BC=0 CPI [A/WA,(R+)] |80+zz+R :14 |A/WA - (Rt) *Q*D1-|2 BC ¢ BC-1 CPIR [A/WA,(R+)] [80+zz+R :15 |repeat *Q*Q1-|2 6n+1 A/WA - (Rt) BC ¢ BC-1 until A/WA=(R) or BC=0 CPxx CPD = [[A/WA,(R-)] |[80+zz+R :16 |A/WA - (R-) *Q*1-/2 BC ¢« BC-1 CPDR- [A/WA,(R-)] 80+zz+R :17 repeat *@*@O1-|2 6n+1 A/WA - (R-) BC « BC-1 until A/WA=(R) or BC=0 Notel: ©; IfBC=0 after execution, the P/V flag is set to 0, otherwise 1. @; IfA/WA=(R), the Z flag is set to 1, otherwise, 0 is set. Note 2: When the operand is omitted in the CPI, CPIR, CPD, or CPDR instruction, A, (XHL+/—) is used as the default value. CPU900H-159 2001-03-16 === page 5 === TOSHIBA TLCS-900/H CPU HM 900/H Instruction Lists (3/10) (4) Arithmetic Operations . F . Length Group] Size Mnemonic Codes (16 hex) Function SZHVNC| (byte) State BWL |ADD R,r C8+zz+r :804+R |R +Rtre *EEVYOF!Z 2. 2. 2 BWL |ADD r,# C8+zztr =:C8:# |r ert+# *REVO*|2+# 3. 4. 6 BWL |/ADD R,(mem) |80+zz+mem:80+R |R « R + (mem) |***V0*/2+M 4. 4.6 BWL |/ADD (mem),R |80+zz+tmem:88+R |(mem) « (mem) + R |***VO*)2+M 6. 6. 10 BW- |ADD (mem),# |80+zztmem:38:# |(mem) « (mem) + # |***VO*|2+M¥ | 7. 8. - BWL |ADC R,r C8+zztr :90+R |R ¢R+r + CY |***V0*/2 2. 2. 2 BWL |ADC ri# C8+zzt+r = :CO:# |r erp + # + CY |***V0*|2+# 3. 4. 6 ADC BWL |ADC R,(mem) |80+zz+mem:90+R |R < R+(mem)+CY | ***V0*)2+M 4. 4.6 BWL |ADC (mem),R |80+zz+mem:98+R |(mem) <(mem)+R+CY | ***V0*!2+M 6. 6. 10 BW- |ADC (mem),# |80+zz+mem:39:# |(mem) <(mem)+#+CY |***VO*|2+M# | 7. 8. - BWL |SUB R,r C8+zz+r :A0+R |R +R-r REY LEI 2.2. 2 BWL |SUB r.# C8t+zzt+r =:CA:# |r er-# *REVL* | O+H 3. 4. 6 SUB BWL |SUB R,(mem) |80+zz+nem:A0+R |R « R - (mem) |***V1*/2+M 4, 4. 6 BWL |SUB (mem),R /80+zz+mem:A8+R |(mem) « (mem) - R |***V1*/2+M 6. 6. 10 BW- |SUB (mem),# |80+zz+tmem:3A:# |(mem) « (mem) - # |***V1*/24+M# | 7. 8. - BWL |SBC R,r C8+zz+r :BO+R |R © R- pr - CY |***V1*12 2.2. 2 BWL |SBC r,# C8+zztr =:CB:# |r er - # - CY |***V1*|2+# 3. 4. 6 SBC BWL |SBC R, (mem) 80+zz+mem:BO0+R |R «R-(mem) - CY|***V1*/24M 4.4.6 BWL |SBC (mem),R |80+zz+mem:B8+R |(mem) « (mem) - R - CY ***V1*/24+M 6. 6. 10 BW- |SBC (mem),# |80+zzt+mem:3B:# |(mem) « (mem)- #-CY|***V1*|2+M# | 7. 8. - BWL |CP R,r C8t+zztr :FO+R |R- 6 *RRVYITEID 2. 2. 2 BW- |CP r, #3 C8+zz+r =:D8+#3 |r - #3 HEE LRT 2.2. - BWL |CP r,# C8+zztr = :CF:# |r - # *REV1* | O+# 3. 4. 6 cP BWL |CP R,(mem) |80+zztmem:FO+R |R - (mem) REY Te) 24M 4. 4. 6 BWL |CP (mem),R |80+zz+mem:F8+R |{mem) - R ***V1*) 24M 4. 4. 6 BW- |CP (mem),# |[80+zz+mem:3F:# |(mem) - # HEV) OIMA | 5. 6. OH INC B-- |INC #3,97 C8+r :60+#3 |r «r+ #3 *eEVQ-12 2.7. 7 -WL |INC #37 C8+zz+r =:60+#3 |r «r+ #3 ------/2 -. 2.2 BW- |INC #3,(mem) /80+zz+mem:60+#3 |(mem) < (mem) + #3 |***V0-/2+M 6. 6. - B-- |DEC #347 C8+r :68+#3 |r #3,(mem) /80+zzt+mem:68+#3 |(mem) < (mem) - #3 |***V1-/2+M 6. 6. - EXTZ | -WL |EXTZ or C8+zztr 312 r « 0 |------|2, [-. 3.3 | EXTS | -WL |EXTS r C8+zz+r = 313 r « r DAA r C8+r 210 Decimal adjustment 2 after addition or subtraction -WL |PAA r C8+zz+r = :14 if r<0>=1 then 2 INC r Note 1: With the INC/DEC instruction, when the code value of #3 =0, functions as + 8/—8. Note 2: When the ADDR, r (word type) instruction is used in the TLCS-90, the §, Z, and V flags do not change. In the TLCS-900, these flags change. CPU900H-160 2001-03-16 === page 6 === TOSHIBA TLCS-900/H CPU HM 900/H Instruction Lists (4/10) F F . Length Group] Size Mnemonic Codes (16 hex) Function SZHVNC (byte) State BW- {MUL RR,r C8+zztr :40+R RR « RXr 2 11.14. - MUL BW- )MUL rri# C8+zzt+r 08:4 re «© rxX# 2+# 12.15. - BW- )MUL RR, (mem) |80+zz+mem: 40+R RR « RX (mem) 2+M = |13.16. - BW- |MULS RR,r C8+zztr =:48+R RR « RXr_— ;signed 2 9.12. - MULS | BW- |MULS rri# C8+zz+r =: 09:# re« rX# ;signed 2+# (10.13. - BW- |MULS RR, (mem) |80+zz+mem: 48+R RR «RX (mem) ;signed 2+M =(11.14. - BW- |DIV RR,r C8+zztr :50+R R « RRer ---V--|2 15.23. - DIV BW- |DIV rri# C8+zztr =: 0A:# re rrt# ---V--|2+# [15.23. - BW- |DIV RR, (mem) |80+zz+mem: 50+R R « RR+(mem) ---V--|24+M (16.24. - BW- |DIVS RR,r C8+zz+r =: 58+R R « RRer ;Signed|---V--|2 18.26. - DIVS | BW- |DIVS rri# C8+zz+r =: 0B:# re rrt# ;Signed|---V--|2+# 18.26. - BW- |DIVS RR, (mem) |80+zz+mem: 58+R R « RR+(mem);signed|---V--|2+M |19.27. - MULA rr D8+r 219 Multiply and add ee-V--12 -.19. - MULA Signed ere rr+(XDE) x (XHL) 32bit 32bit 16bit 16bit XHL « XHL-2 MINC1 #,r D8+r :38:#-1 |modulo increment (#=2**n) 3+1 (1<=n<=15) if (r mod #)=(#-1) then rer-(#-1) else rer+l MINC2 #,r D8+r :39:#-2 |modulo increment MINC (#=2**n) 3+2 (2<=n<=15) if (r mod #)=(#-2) then rer-(#-2) else rer+2 MINC4 #,r D8+r :3A:#-4 |modulo increment (#=2**n) 3+4 (3<=n<=15) if (r mod #)=(#-4) then rer-(#-4) else rer+4 MDEC1 #,r D8+r :3C:#-1 |modulo decrement (#=2**n) 3-1 (1<=n<=15) if (r mod #)=0 then rer+(#-1) else rer-1 MDEC2 #,r D8+r :3D:#-2 |modulo decrement MDEC (#=2**n) 372 (2<=n<=15) if (r mod #)=0 then rer+(#-2) else rer-2 MDEC4 #,r D8+r :3E:#-4 |modulo decrement (#=2**n) 374 (3<=n<=15) if (r mod #)=0 then rer+(#-4) else rer-4 Note: Operand RR of the MUL, MULS, DIV, and DIVS instructions indicates that a register twice the size of the operation is specified. When the operation is in bytes (8 bits x8 bits, 16/8 bits), word register (16 bits) is specified; when the operation is in words (16 bits x 16 bits, 32/16 bits), long word register (32 bits) is specified. CPU900H-161 2001-03-16 === page 7 === TOSHIBA TLCS-900/H CPU HB 900/H Instruction Lists (5/10) (5) Logical operations . F . Length Group] Size Mnemonic Codes (16 hex) Function SZHVNC| (byte) State BWL /AND R,r C8+zz+r =:CO+R |R« R andr **1P00/2 2.2. 2 BWL |/AND ri# C8+zz+r =:CC:# |r © r and # **1P00|2+# 3. 4. 6 BWL /AND R,(mem) |80+zz+mem:CO+R |R « R and (mem) **1P00)/2+M 4. 4.6 BWL |/AND (mem),R |80+zz+mem:C8+R |(mem) « (mem) and R |**1P00)2+M 6. 6. 10 BW- |AND (mem),# |80+zztmem:3C:# |(mem) « (mem) and # |**1P00/2+M#¥ | 7. 8. - BWL |OR R,r C8+zz+r =:EO+R |R« Rorer **QP00/2 2.2.2 BWL |OR r,# C8t+zztr = :CE:# |r «ror # **0QP00|2+# 3.4.6 BWL |OR R,(mem) |80+zz+mem:E0+R |R « R or (mem) **0P00/2+M 4. 4.6 BWL |OR (mem),R |80+zz+mem:E8+R |(mem) <« (mem) or R_= |**QP00/2+M 6. 6. 10 BW- |OR (mem),# |80+zz+mem:3E:# |(mem) « (mem) or # |**OP00/2+M# | 7, 8. - BWL |/XOR R,r C8+zz+r =:DO+R |R« R xor er **QP00/2 2.2.2 BWL |XOR r,# C8+zztr =:CD:# |r « r xor # **QP00|2+# 3. 4.6 XOR BWL |XOR R,(mem) |80+zz+tmem:DO+R |R « R xor (mem) **0P00|2+M 4.4.6 BWL |XOR (mem),R |80+zz+mem:D8+R |(mem) « (mem) xor R |**0P00/2+M 6. 6. 10 BW- |XOR (mem),# |80+zz+mem:3D:# |(mem) « (mem) xor # |**OP00|2+M# | 7. 8. - CPU900H-162 2001-03-16 === page 8 === TOSHIBA TLCS-900/H CPU HB 900/H Instruction Lists (6/10) (6) Bit operations F F . Length Group| Size Mnemonic Codes (16 hex) Function SZHVNC (byte) State BW- |LDCF #4,r C8+zz+r :23:#4 |CY « r<#4> -----* 13 3.3.- LDCF BW- |LDCF A,r C8+zz+r :2B CY « r ~----* 12 3.3.- B-- |LDCF #3,(mem)|BO+men :98+#3 |CY « (mem)<#3> -----* |24+M 6.-.- B-- |LDCF A ,(mem)|BOt+men :2B CY < (mem) -----* 124M 6.-.- BW- |STCF #4,r C8+zzt+r :24:#4 | r<#4> « CY 3 3.3.- STCF BW- |STCF A,r C8+zz+r :2C r « CY 2 3.3.- B-- |STCF #3,(mem)|BO+mem :A0+#3 |(mem)<#3> ¢ CY 2+M 7.7.7 B-- |STCF A ,(mem)/BO+mem :2C (mem) + CY 2+M 7.7.7 BW- |ANDCF #4,r C8+zztr :20:#4 |CY « CY and r<#4> -----* 13 3.3.- ANDC BW- jANDCF A ,r C8+zzt+r :28 CY « CY and r -----* 12 3.3.- B-- |ANDCF #3,(mem)|BO+mem :80+#3 |CY « CY and (mem)<#3> -----* |24+M 6.-.- B-- |ANDCF A ,(mem)|BO+mem :28 CY « CY and (mem) -----* |24+M 6.-.- BW- |ORCF #4,r C8+zz+r :21:#4 |CY « CY or r<#4> -----* 13 3.3.- ORCE BW- |ORCF A,r C8+zz+r 329 cY « CY or r an (4 3.3.- B-- |ORCF #3,(mem)|BO+mem :88+#3 |CY « CY or (mem)<#3> -----* 124M 6.-.- B-- |ORCF A ,(mem)|BO+mem :29 CY « CY or (mem) -----" |24+M 6.-.- BW- |XORCF #4,r C8+zzt+r :22:#4 |CY « CY xor r<#4> -----* 13 3.3.- XORC BW- |XORCF A ,r C8+zz+r :2A CY « CY xor r mn * 12 3.3.- B-- |XORCF #3,(mem)|BO+mem :90+#3 /CY « CY xor (mem)<#3> -----* 124M 6.-.- B-- |XORCF A ,(mem)|BO+mem :2A CY < CY xor (mem) -----* 124M 6.-.- RCF RCF 10 cY « 0 --0-00 |1 2 SCF SCF 11 cY «1 --0-01 |1 2 CCF CCF 12 CY « not CY --X-0* |1 2 ZCF ZCF 13 CY « not "Z" flag --X-0* |1 2 BIT BW- |BIT #4,7 C8t+zztr :33:#4 |Z ¢ not r<#4> X*1X0- [3 3.3.- B-- |BIT #3,(mem) |BO+mem :C8+#3 |Z <« not (mem)<#3> X*1X0- |2+M 6.-.- RES BW- |RES #4,7r C8+zztr :30:#4 | r<#4> « 0 3 3.3.- B-- |RES #3,(mem) |BO+mem :BO+#3 |(mem)<#3> < 0 2+M 7.7.7 SET BW- |SET #4,7r C8+zz+r :31:#4 |r<#4> «i 3 3.3.- B-- |SET #3,(mem) |BO+mem :B8+#3 |(mem)<#3> « 1 2+M 7.7.7 CHG BW- |CHG #4,7 C8+zz+r :32:#4 | r<#4> ¢ not r<#4> 3 3.3.- B-- |CHG #3,(mem)|BO+mem :C0+#3 |(mem)<#3> 2+M 7.7.7 BW- |TSET #4,r C8+zz+r :34:#4 |Z«not r<#4> : r<#4>e1 X*1X0- 3 4.4.- TSET | B-- |TSET #3,(mem)|BO+mem :A8+#3 |Z « not (mem)<#3> X*1X0- —_ 2+M 7.7.7 (mem)<#3> « 1 BS1F A,r D8+r :0E A<¢1 search r ; ---@O--/2 -~.3.- BS1 Forward BSiB. so A,r D8+r : OF A<¢1 search r ; ---@--|2 -.3.- Backward Note: © ; Oisset when the bit searched for is found, otherwise 1 is set and an undefined value is set in the A register. CPU900H-163 2001-03-16 === page 9 === TOSHIBA TLCS-900/H CPU HM 900/H Instruction Lists (7/10) (7) Special operations and CPU control fuop | --- roe foo operation asm Sets interrupt enable EI EI [#3] 06 #3 flag. 2 3 IFFe#3 . Disables interrupt. Software interrupt SWI SWI [#3] F8+#3 PUSH PC&SR 1 19 JP (FFFFOOH+4 x #3) LDC BWL |LDC cr,r C8+zz+r :2E:cr jcrer 3 3.3.3 BWL |LDC r,cr C8+zztr :2F:cr |r ¢ cr 3 3.3.3 |ox | B-- |LDX —(#8),# |F7:00:#8:00:#:00|(#8) © # ------|6fg.-.- | PUSH r LINK --L |LINK r,d1i6 E8+r :0C:d16 |LD r,XSP ADD XSP,d16 UNLK --L |UNLK r E8+r :0D LD XSP,r 2 -.-.7 POP r 17 243 Seta register bank. jor fj RFP « #3 (0 at reset) fo Switches register INCF INCF oc banks. 1 2 RFP« RFP + 1 Switches register DECF DECF banks. 1 RFP« RFP — 1 SCC SCC cc,r C8+zztr :70+cc [if ce then re 1 2.2.- else r<« 0 Note 1: When operand #8 coding in the EI instruction is omitted, 0 is used as the default value. Note 2: When operand #8 coding in the SWI instruction is omitted, 7 is used as the default value. CPU900H-164 2001-03-16 === page 10 === TOSHIBA TLCS-900/H CPU HB 900/H Instruction Lists (8/10) (8) Rotate and Shift BWL |RLC #4,r C8+zz+r =: E8: #4 **0P0*|3 3+n/4 RLC BWL |RLC A,r C8+zz+r =: F8 MSB<0 **QP0*|2 3t+n/4 BW- |RLC (mem) 80+zz+mem: 78 **0PO*/24+M (6.6 BWL |RRC #4,r C8+zzt+r =: E9: #4 **0P0*|3 3+n/4 RRC BWL |RRC A,r C8+zzt+r =: F9 MSB—>0 **0QP0*|2 3t+n/4 BW- |RRC (mem) 80+zz+mem: 79 **O0PO*|2+M 16.6 BWL |RL #4,r C8+zzt+r =: EA: #4 **0P0*|3 3t+n/4 RL BWL |RL A,r C8+zzt+r :FA MSB—O **0QP0*|2 3t+n/4 BW- |RL (mem) 80+zz+mem: 7A **0PO*|2+M 16.6 BWL |RR #4,r C8+zz+r =: EB: #4 **0P0*|3 3+n/4 BWL |RR A,r C8+zz+r :FB MSB>0 **QP0*|2 3t+n/4 BW- |RR (mem) 80+zz+mem: 7B **0PO*/24+M 16.6 BWL |SLA #4,r C8+zzt+r =: EC: #4 **QP0*|3 3t+n/4 SLA | BWL |SLA A,r C8tzztr = FC MSB<—O|< 0 |##gpg#|2 3+n/4 BW- |SLA (mem) 80+zz+mem: 7C **QPO*|2+M 16.6 BWL |SRA #4,r C8+zzt+r = :ED:#4 MSB50 | **0P0*|3 3t+n/4 SRA BWL |SRA A,r C8+zz+r = =:FD MSB—90 cy **0P0*|2 3+n/4 BW- |SRA (mem) 80+zz+mem: 7D **QPO*|2+M 16.6 BWL |SLL #4,r C8+zzt+r = =:EE:#4 **QPQ* 13 3+n/4 SLL | BWL |SLL A,r C8+zz+r : FE MSB—O]< 0 |**0P0*|2 3+n/4 BW- |SLL (mem) 80+zz+mem: 7E **QP0*|/2+M 6.6 BWL |SRL #4,r C8+zz+r =: EF: #4 **0P0*|3 3+n/4 SRL | BWL |SRL A,r C8+zzt+r FF 0 >([MSB>0 **QP0*|2 3+n/4 BW- |SRL (mem) 80+zz+mem: 7F **0PO*/24+M 16.6 RLD RRD [A, ](mem)|80+mem :07 Areg 2+M SO 4..-.- | 7-4 | 3-0 | Note 1: When #4/A is used to specify the number of shifts, module 16 (0 to 15) is used. Code 0 means 16 shifts. Note 2: When the following instructions are used in the TLCS-90, the §, Z and V flags do not change. Note 3: RLCA,RRCA, RLA, RRA, SLAA, SRAA, SLLA, and SRLA In the TLCS-900, these flags change. CPU900H-165 2001-03-16 === page 11 === TOSHIBA TLCS-900/H CPU HB 900/H Instruction Lists (9/10) (9) Jump, Call and Return JP #16 1A :#16 |PC « #16 3 5 JP #24 1B :#24 |PC « #24 4 6 JP JR [cc, ]$+2+d8 |60+cc :d8 if cc then PC « PC+d8 2 5/2 (1/F) JRL [cc, ]$+3+d16)70+cc :d16 Jif cc then PC « PC+d16 3 5/2 (1/F) JP [cec, ]mem BO+mem :DO+cclif cc then PC « mem 2+M 7/4 (T/F) CALL #16 1c :#16 |PUSH PC : JP #16 3 9 CALL #24 1D :#24 |PUSH PC : JP #24 4 10 CALL CALR $+3+d16 1E :d16 |PUSH PC : JR $+3+d16 3 10 CALL [cc, ]mem BO+mem :EO+cclif cc then 24M = |12/4 (T/F) PUSH PC : JP mem DINZ DJNZ C8+zztr :1C0:d8jrer-1 3 6 (rz0) [r, ]$+3/4+d8 if r#0 then JR $+3+d8 4 (r=0) RET OE POP PC wen---/1 9 RET RET cc BO :FOt+ccl/if cc then POP PC ------|2 12/4 (T/F) RETD d16 OF :d16 |RET : ADD XSP,d16 w-----13 il RETI 07 POP SR&PC EREEEE) 12 Notel: (T/F) represents the number of states at true / false. CPU900H-166 2001-03-16 === page 12 === TOSHIBA TLCS-900/H CPU | Instruction Lists of 900/H (10/10) (10) Addressing mode es a a a (R) +0 (R + d8) +1 (#8) +1 (#16) +2 (#24) +3 (mem) (r) +1 (r+d16) +3 (r+r8) +3 (r +116) +3 (-r) +1 (r+) +1 (11) Interrupt General-purpose PUSH PC interrupt processing PUSH SR IFF <— accepted level + 1 INTNEST <—INTNEST + 1 JP (FFFFOOH + vector) HDMA 1/0 to /O (DMADn) < (DMASn) (Note) Fordetails of interrupt processing, refer to Chapter2 “3.3 Interrupts”. CPU900H-167 2001-03-16 === page 13 === TOSHIBA TLCS-900/H CPU Appendix C Instruction Code Maps (1/4) 1-byte op code instructions ef o PtP e2tsta ts te} 7istofateltc}o jel er - PUSH POP y HALT RETI LD PUSH | LDW |PUSHW| INCF DECF | RET | RETD aN SR SR /~ (n),n n |(n),nn} nn dd RCF SCF CCF ZCF | PUSH POP EX LDF | PUSH POP JP JP CALL CALL | CALR A A F, F’ n F F nn nnn nn nnn |PC+dd a ee ee ee 5 JR cc,PC +d F LT LE ULE PE/OV M/MI Zz Cc (7) GE GT UGT po/nov P/PL NZ NC j JRL cc,PC+dd F LT LE ULE PE/OV M/MI Zz Cc (1) GE GT UGT po/nov” P/PL NZ NC scr. B ser. B . (XWA (XBC (XDE (XHL_ (XIX (XIY (XIZ (XSP (XWA) (XBC) (XDE) (XHL) (XIX) (XIY) (XIZ) (XSP) | +d) +d) +d) +d) +d) +d) +d) +d) scr. W (XWA) (XBC) (XDE) (XHL) (XIX) (XIY) (XIZ) (XSP) | +d) +d) +d) +d) +d) +d) +d) +d) ser. Lb (XWA) (XBC) (XDE) (XHL) (XIX) (XIY) (XIZ) (XSP) | +d) +d) +d) +d) +d) +d) +d) +d) dst dst (XWA (XBC (XDE (XHL_ (XIX (XIY (XIZ (XSP (XWA) (XBC) (XDE) (XHL) (XIX) (XIY) (XIZ) (XSP) | +d) +d) +d) +d) +d) +d) +d) +d) c scr.B reg.B reg. B (n) (nn) | (nnn) [(mem) |(- xrr) | (xrr +) r Ww A B Cc D E H L scr. W reg. W reg. W (n) (nn) | (nnn) (mem) | (- xrr) | (xrr +) rr WA BC DE HL IX IY IZ SP ser. L reg.L reg.L (n) (nn) | (nnn) |(mem) | (- xrr) | Grr +) xrr XWA XBC XDE XHL XIX XIY XIZ XSP F dst LDX SWI n (n) (nn) [| (nnn) |(mem) | (- xrr) | (xrr +) (n),n 0 1 2 3 4 5 6 7 Note 1: Codes in blank parts are undefined instructions (i.e., illegal instructions). Note 2: Dummy instructions are assigned to codes 01H and 04H. Do not use them. CPU900H-168 2001-03-16 === page 14 === TOSHIBA TLCS-900/H CPU Appendix C Instruction Code Maps (2/4) Ist byte: reg Hef oo PrP ets tats tet 7} siotatetc}oleter LD | PUSH] POP | CPL | NEG | MUL MULS DIV DIVS | LINKL |UNLKL] BS1F BS1B BW | BW BW Ww # r r r r ree ore or Horr, # r,dd r A,r Ar , [DAAB EXTZ | EXTS | PAA MIRR MULA \J\ 7 DJNZ WL | WE} WL Ww w BW r r r r r r / \ /\ rd 2 |ANDCF ORCF XORCF LDCF STCF ANDCF ORCF XORCF LDCF STCF Lpbc_ = LDC. BW BW #,r #,r #,9r #,9r #,0 A,r A,r A,r A,r A,r cr,r r,cr RES SET CHG BIT TSET MINC1 MINC2 MINC4 \/ MDEC1 MDEC2 MDEC4 \ / 3 BW #,9 #,;, #,r #,r #,r #,9 WwW VAN #,9 WwW VAN a INC #3,r DEC #3,r 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 7 scC ce, r BW F LT LE ULE PE/OV M/MI Z Cc (T) GE GT UGT PO/NOV P/PL NZ Nc ee ee a A SUB R,r LD sor, #3 ) 1 2 3 4 5 6 7 ee c AND Rr ADD ADC SUB SBC AND XOR- OR cP t# t,# t,# t, # t# 1 # t,# t, # XOR Rr cP or, #3 BW ) 1 2 3 4 5 6 7 RLC RRC RL RR SLA SRA SLL SRL #,1r #1 #,r #,9 #,7 #,1r #,¢ #,¢ F cP OR RLC RRC RL RR SLA SRA SLL SRL A,r A,r A,r A,r A,r A,r A,r A,r r : Register specified by the 1st byte code. (Any CPU registers can be specified.) R : Register specified by the 2nd byte code. (Only eight current registers can be specified.) B : Operand size is a byte. W : Operand size is a word. L : Operand size is a long word. Note : Dummy instructions are assigned to codes 1AH, 1BH, 3BH, and 3FH. Do not use them. CPU900H-169 2001-03-16 === page 15 === TOSHIBA TLCS-900/H CPU Appendix C Instruction Code Maps (3/4) 1st byte: src (mem) Hef o | tf 2}si4}s{et7}s}ofats|tc}o|ele | PUSH RLD RLDB BW (mem) A, (mem) LDI LDIR LDD LDDR| CPI CPIR CPD CPDR LD BW BW BW (nn), (m) a 3 EX (mem),R BW] ADD ADC SUB SBC AND XOR OR CPBW (mem) ,# es en INC #3,(mem) BW DEC #3, (mem) BW 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 7 RLC —- RRC RL RR SLA SRA SLL SRLBWI (mem) as cna ee a a ee ee B : Operand size is a byte. W : Operand size is a word. CPU900H-170 2001-03-16 === page 16 === TOSHIBA TLCS-900/H CPU Appendix C Instruction Code Maps (4/4) 1st byte: dst (mem) Halo fs f2{sitai{sie;7{s]o fale] c jojele LDB LDW POPB POP W (m), # (m), # (mem) (mem) 1 LDB LD W (m), (nn) (m), (nn) 2 LDA R,mem WIANDCF ORCF XORCF LDCF STCFB A, (mem) ee ee ee ee a ee ANDCF #3, (mem) B ORCF #3,(mem) B 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 XORCF #3, (mem) B LDCF #3,(mem) B 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 A STCF #3,(mem) B TSET #3,(mem) B 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 RES #3,(mem) B SET #3,(mem) B 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 c CHG #3, (mem) B BIT #3, (mem) B 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 JP cc,mem F LT LE ULE PE/OV M/MI Z Cc (1) GE GT UGT PO/NOV P/PL NZ NC CALL cc, mem F LT LE ULE PE/OV M/MI Z Cc (71) GE GT UGT PO/NOV P/PL NZ NC F RET = cc (1st byte code is BOH.) F LT LE ULE PE/OV M/MI Z ie (1) GE GT UGT PO/NOV P/PL NZ NC B : Operand size is a byte. W : Operand size is a word. L : Operand size is along word. CPU900H-171 2001-03-16 === page 17 === TOSHIBA TLCS-900/H CPU Appendix D Differences between TLCS-90 and TLCS-900 Series cPU architecture 8-bit CPU 16-bit CPU Built-in ROM/built-in RAM 8-bit data bus 16-bit data bus Built-in l/O 8-bit data bus 8-bit data bus External data bus 8-bit data bus 8-bit/16-bit data bus (can be mixed) Program space 64 KB 16MB (linear) (except devices with MMU) Data space 16MB (bank) 16MB (linear) Instruction set/instruction TLCS-90 TLCS-90 + a mnemonic a = enhancement of 16-bit multiply / divide instructions and bit operation instruction. 32-bit load/operation instructions, C compiler instructions, register bank operation instructions, etc. Instruction code Unique to TLCS-90 Unique to TLCS-900 (object code) (Different from TLCS-90.) Addressing mode TLCS-90 TLCS-90 + a a = (-Reg), (Reg +), (Reg + disp16), (Reg + Reg16), (nnn) General-purpose register TLCS-90 TLCS-90 + a a = Uses as 32 bits and register bank, and adds a system stack pointer. Flag sfz[ifatx]y|y |e] Ls] efor} oly sf c| | flag is extended to IFF2 to 0 of status register.X flag is deleted. Reset PC — 0000H PC < (Vector base address) (SP does not change.) XSP<100H Built-in ROM address 0000H to undefined Built-in RAM address to FFxxH 0080H to Built-in l/O address FFxxH~FFFFH 0000H~007FH Direct addressing area (n) FFOOH~FFFFH 0000H~OOFFH Interrupt Interrupt start address OOOOH + (8x V) Vector base address + 4x V Register to be saved PC & AF PC & SR Mask register IFF IFF2~0 Mask level O~1 0~7 CPU900H-172 2001-03-16 === page 18 === TOSHIBA TLCS-900/H CPU ewe Instruction @® ADDR, r (word type) S/ZN flags don’t change. S/ZNV flag changes. S/ZIV flag changes expect add | [ 16 bit register. @ Shift of A register RLCA S/ZNV flag changes. RRCA RLA RRA SLAA SRAA SLLA SRLA S/ZIV flags don’t change in these instruction. RLCA RRC A RLA RRA SLA A SRA A SLL A SRLA S/ZNN flag changes in these instruction. CPU900H-173 2001-03-16 === page 19 === TOSHIBA TLCS-900/H CPU Note: The TLCS-900 series is essentially the same as the TLCS-90 series but with a 16-bit CPU. Built-in I/Os are completely compatible with those of the TLCS-90. However, six types of instructions used in the TLCS-90 series do not directly correspond with those used in the TLCS-900 series. Thus, when transfering programs designed for the TLCS-90 to the TLCS-900, replace them with equivalents as follows: Instructions in TLCS-90 Equivalent instructions in but not in TLCS-900 TLCS-900 EXX EX BC, BC’ EX DE, DE’ EX HL, HL’ EX AF, AF’ EX A, A’ EX F, F’ PUSH AF PUSH A PUSH F POP AF POP F POP A Some TLCS-900 series instructions, though basically the same as TLCS-90 instructions, have more functions and more specification items in their operands. They are listed below. INC reg INC imm3, reg INC mem INC imm3, mem DEC reg DEC imm3,reg DEC mem DEC imm3,mem RLC reg RLC imm, reg RRC reg RRC imm, reg RL reg RL imm, reg RR reg RR imm, reg SLA reg SLA = imm, reg SRA reg SRA imm,reg SLL reg SLL imm, reg SRL reg SRL imm, reg CPU900H-174 2001-03-16