=== page 1 === TOSHIBA TLCS-900/H CPU OR dst, sre < LogicalOR > Operation : dst (mem),# = [ifm] 02 ]my mmm] CPU900H-115 2001-03-16 === page 2 === TOSHIBA TLCS-900/H CPU Flags : S Z H V N C S = MSB value of the result is set. Z = 1isset when the result is 0, otherwise 0. H = Oisset. V = 1 is set when the parity (number of 1s) of the result is even, 0 when odd. When the operand is 32-bit, an undefined value is set. N = Cleared to 0. C = Cleared to 0. Execution example: OR HL,IX When the HL register = 7350H and the IX register is 3456H, execution sets the HL register to 7756H. 0111 0011 0101 0000 < HLregister (before execution) OR) 0011 0100 0101 0110 < IX register (before execution) 0111 0111 0101 0110 < MHLregister (after execution) CPU900H-116 2001-03-16 === page 3 === TOSHIBA TLCS-900/H CPU ORCF num, sre < ORCarry Flag > Operation : CY Description : Ors the contents of the carry flag with those of bit num of sre and loads the result to the carry flag. Details : Size Mnemonic Code Byte Word Long word O OO x oRCF #42 ErerCed c ere O O x oRCF As GWEC) Ed ere O x x oRCE —#8,0mem) Fm mma O x x oRcF —Atmem) [fm], [mm mm Note : When bit num is specified by the A register, the value of the lower 4 bits of the A register is used as bit num. When the operand is a byte and the value of the lower bits of bit num is from 8 to 15, the result is undefined. flag : §S Z H V N C S = Nochange Z = Nochange H = Nochange V = Nochange N = Nochange C = The result of or-ing the contents of the carry flag with those of bit num of src is set. Execution example: ORCF 6, (100H) When the contents of memory at address 100H = 01000000B (binary) and the carry flag= 0, execution sets the carry flag to 1. 76543210 fo} 1/0 }0/0 fo jo jo| Address 100 (or)<-[0] Carry flag (before execution) Carry flag (after execution) CPU900H-117 2001-03-16 === page 4 === TOSHIBA TLCS-900/H CPU PAA dst < Pointer Adjust Accumulator > Operation : if dst =1 thendst Operation : dst<(XSP+)|Inbytes : dst<(XSP), XSP (mem) amma Yom ro,0,0,0,0,1]2[0| Flags : S Z H V N C S = Nochange Z = Nochange H = Nochange V = Nochange N = Nochange C = Nochange (Note) Executing POP F changes all flags. CPU900H-119 2001-03-16 === page 6 === TOSHIBA TLCS-900/H CPU Execution example: POP IX When the stack pointer XSP = 0100H, the contents of address 100H = 56H, and the contents of address 101H = 78H, execution sets the IX register to 7856H and the stack pointer XSP to 0102H. Memory IX register | Address 100H (stack pointer before execution) Address 101H | | Address 102H (stack pointer after execution) CPU900H-120 2001-03-16 === page 7 === TOSHIBA TLCS-900/H CPU < Pop SR > Operation : SR<(XSP+) Description : Loads the contents of the address specified by the stack pointer XSP to status register. Then increments the contents of the stack pointer XSP by 2. Details : Size Mnemonic Code Byte Word Long word xO. x POP SR Flags : S Z H V N C Ss = Z= H = . . yv — ¢ Contents of the memory address specified by the stack pointer XSP are set. N = C= Notel: Please execute this instruction during DI condition. The timing for executing this instruction is delayed by several states than that for fetching the instruction. This is because an instruction queue (4 bytes) and pipeline processing method is used. Note2: When this instruction is executed, change all bits in the SR. If there are the bits which must not change (example: the minimum mode is not supported for 900/H, therefor, the SR< MAX > register must be set to “1”), prevent the bits from changing. CPU900H-121 2001-03-16 === page 8 === TOSHIBA TLCS-900/H CPU Operation : (—XSP) Operation: (—XSP) # 0,0 ,0,9;1,0] | OQ O x — PUSH (mem) Pan [om Flags : S Z H V N C S = Nochange Z = Nochange H = Nochange V = Nochange N = Nochange C = Nochange CPU900H-123 2001-03-16 === page 10 === TOSHIBA TLCS-900/H CPU Execution example: PUSH HL When the stack pointer XSP = 0100H and the HL register = 1234H, execution changes address 0OFEH to 34H, address OOFFH to 12H, and sets the stack pointer XSP to OOFEH. Memory HL register a Address OFEH (stack pointer after execution) Address OFFH | | Address 100H (stack pointer before execution) CPU900H-124 2001-03-16 === page 11 === TOSHIBA TLCS-900/H CPU < Reset Carry Flag > Operation : CY<0 Description : Resets the carry flag to 0. Details : Mnemonic Code ROF Flags : S Z H V N C S = Nochange Z = Nochange H = Reset to 0. V = Reset to 0. N = Nochange C = Reset to 0. CPU900H-125 2001-03-16 === page 12 === TOSHIBA TLCS-900/H CPU RES num, dst < Reset > Operation : dst < 0 Description : Resets bit num of dst to 0. Details : Size Mnemonic Code Byte Word Long word O 0 x RES #4 me Ey a | O x x RBS #8,(mem) [Em] fom mmm Flags : S Z H V N C S = Nochange Z = Nochange H = Nochange V = Nochange N = Nochange C = Nochange Execution example: RES _ 5, (100H) When the contents of memory at address 100H = 00100111B (binary), execution sets the contents to 00000111B (binary). 76543210 fo[of Jo]9]1]1]1] Address 100 [ow CPU900H-126 2001-03-16 === page 13 === TOSHIBA TLCS-900/H CPU RET condition < Return > Operation : Ifccis true, then the 32-bit PC —(XSP), XSP Operation : 32-bitPC <—(XSP), XSP Operation : SR<(XSP), 32-bit PC —(XSP+2), XSP Operation : {CY &dst _ (mem) |i [m] 0] z[m)m)m jm Note : When the number of rotates is specified by the A register, the value of the lower 4 bits of the A register is used. Specifying 0 rotates 16 times. When dst is memory, rotating is performed only once. Flags : S Z H V N C f*{*lol*lo|* S = MSB value of dst after rotate is set. Z = 1isset when the contents of dst after rotate is 0, otherwise 0. H = Reset to 0. V = 1isset when the parity (number of 1s) of dst is even after rotate, otherwise 0. If the operand is 32 bits, an undefined value is set. N = Reset to 0. C = The value after rotate is set. Executionexample: RL 4,HL When the HL register = 6230H and the carry flag = 1, execution sets the HL register to 230BH and the carry flag to 0. CPU900H-130 2001-03-16 === page 17 === TOSHIBA TLCS-900/H CPU RLC num, dst < Rotate Left without Carry > Operation : {CY, dst< left rotate value of dst} Repeat num Description : Loads the contents of the MSB of dst to the carry flag and rotates left the contents of dst. Repeats the number of times specified in num. Description figure : dst MSB < LSB Details : Size Mnemonic Code Byte Word Long word 0 0 OO RO #4 oleh 0 0 OO Re Ar TP ePl a | O O x RLC (mem) 1 fm] 0 | 2 fmm mm Note : When the number of rotates is specified by the A register, the value of the lower 4 bits of the A register is used. Specifying 0 rotates 16 times. When dst is memory, rotating is performed only once. Flags : S Z H V N C f*{*lol*lo|* S = MSB value of dst after rotate is set. Z = 1isset when the contents of dst after rotate is 0, otherwise, 0. H = Reset to 0. V = 1 is set when the parity (number of 1s) of dst is even after rotate. If the operand is 32 bits, an undefined value is set. N = Reset to 0. C = MSB value of dst before the last rotate is set. Execution example: RLC 4,HL When the HL register = 1230H, execution sets the HL register to 2301H and the carry flag to 1. CPU900H-131 2001-03-16 === page 18 === TOSHIBA TLCS-900/H CPU RLD dstl, dst2 < Rotate Left Digit > Operation : dstl<3:0>, dst2<7:4>, dst2<3:0> Description : Rotates left the lower 4 bits of dst1 and the contents of dst2 in units of 4 bits. dstl dst2 Details : Size Mnemonic Code Byte Word Long word O x x RED A I¢mem) [En] 0 [inom mm Flags : S Z H V N C S = MSB value of the A register after rotate is set. Z = 1isset when the contents of the A register after the rotate are 0, otherwise 0. H = Reset to 0. V = 1 is set when the parity (number of 1s) of the A register is even after the rotate, otherwise 0. N = Reset to 0. C = Nochange Execution example: RLD A, (100H) When the A register = 12H and the contents of memory at address 100H = 34H, execution sets the A register to 13H and the contents of memory at address 100H to 42H. CPU900H-132 2001-03-16 === page 19 === TOSHIBA TLCS-900/H CPU RR num, dst < Rotate Right > Operation : {CY &dst < right rotates the value of CY & dst} Repeat num Description : Rotates right the linked contents of the carry flag and dst. Repeats the number of times specified in num. Description figure: dst MSB — LSB Details : Size Mnemonic Code Byte Word Long word oO 0 OO RR #4, foPepl | 0 0 OO RR Ar TP ePla | O O x RR (mem) 1 fm] 0 | 2 fmm mm Note : When the number of rotates is specified by the A register, the value of the lower 4 bits of the A register is used. Specifying 0 rotates 16 times. When dst is memory, rotating is performed only once. Flags : S Z H V N C f*{*lol*lo|* S = MSB value of dst after rotate is set. Z = 1isset when the contents of dst after rotate is 0, otherwise 0. H = Reset to 0. V = 1 is set when the parity (number of 1s) of dst is even after the rotate, otherwise 0. If the operand is 32 bits, an undefined value is set. N = Reset to 0. C = The value after rotate is set. Execution example: RR 4,HL When the HL register = 6230H and the carry flag = 1, execution sets the HL register to 1623H and the carry flag to 0. CPU900H-133 2001-03-16 === page 20 === TOSHIBA TLCS-900/H CPU RRC num, dst < Rotate Right without Carry > Operation : {CY, dst < right rotate value of dst} Repeat num Description : Loads the contents of the LSB of dst to the carry flag and rotates the contents of dst to the right. Repeats the number of times specified in num. Description figure: pdt MSB — LSB Details : Size Mnemonic Code Byte Word Long word O 0 CO RRO #4 oleh O 0 GO RRO Ay TP epla | O O x RRC (mem) 1 fm] 0 | 2 fmm mm Note : When the number of rotates num is specified by the A register, the value of the lower 4 bits of the A register is used as the number of rotates. Specifying 0 rotates 16 times. When dst is memory, rotating is only once. Flags : S Z H V N C f*{*lol]*lo|* S = MSB value of dst after rotate is set. Z = 1isset when the contents of dst after rotate is 0, otherwise 0. H = Reset to 0. V = 1isset when the parity (number of 1s) of dst is even after rotate, otherwise 0. If the operand is 32 bits, an undefined value is set. N = Reset to 0. C = MSB value of dst before the last rotate is set. Execution example: RRC 4,HL When the HL register = 1230H, execution sets the HL register to 0123H and the carry flag to 0. CPU900H-134 2001-03-16 === page 21 === TOSHIBA TLCS-900/H CPU RRD_ dstl, dst2 < Rotate Right Digit > Operation : dstl1<3:0>, dst2<7:4>, dst2<3:0> Description : Rotates right the lower 4 bits of dst1 and the contents of dst2 in units of 4 bits. Description figure : dst1 dst2 Details : Size Mnemonic Code Byte Word Long word Ox x RRD [A (mem) [Jin 0 0 Jom mmm] Flags : S Z H V N C S = MSB value of the A register after rotate is set. Z = 1isset when the contents of the A register after rotate is 0, otherwise 0. H = Reset to 0. V = 1isset when the parity (number of 1s) of the A register is even after rotate, otherwise 0. N = Reset to 0. C = Nochange Execution example: RRD A, (100H) When the A register = 12H and the contents of memory at address 100H = 34H, execution sets the A register to 14H and the contents of memory at address 100H to 23H. CPU900H-135 2001-03-16 === page 22 === TOSHIBA TLCS-900/H CPU SBC dst, sre < Subtract with Carry > Operation : dst tmem,# [ifm] o]= [mm mm] CPU900H-136 2001-03-16 === page 23 === TOSHIBA TLCS-900/H CPU Flags : S Z H V N C Pete te] fade S = MSB value of the result is set. Z = 1isset when the result is 0, otherwise 0. H = 1 is set when a borrow from bit 3 to bit 4 occurs as a result, otherwise 0. When the operand is 32 bits, an undefined value is set. V = 1isset when an overflow occurs as a result, otherwise 0. N = lisset. C = 1isset when a borrow from the MSB occurs as a result, otherwise 0. Execution example: SBC HL,IX When the HL register is 7654H, the IX register = 5000H, and the carry flag = 1, execution sets the HL register to 2653H. 7654 HL register oj 1 | Carry flag 2653 HL register CPU900H-137 2001-03-16 === page 24 === TOSHIBA TLCS-900/H CPU SCC condition, dst < Set Condition Code > Operation : Ifccis true, then dst <1 else dst —0. Description : Loads 1 to dst when the operand condition is true; when false, 0 is loaded to dst. Details : Size Mnemonic Code Byte Word Long word OO x SO eer Ppl | Flags : S Z H V N C S = Nochange Z = Nochange H = Nochange V = Nochange N = Nochange C = Nochange Execution example: SCC OV,HL When the contents of the V flag = 1, execution sets the HL register to 0001H. CPU900H-138 2001-03-16 === page 25 === TOSHIBA TLCS-900/H CPU < Set Carry Flag > Operation : CY<1 Description : Sets the carry flag to 1. Details : Mnemonic Code SCF Flags : S Z H V N C }-|-Jo]-]o]1) S = Nochange Z = Nochange H = Reset to 0. V = Nochange N = Reset to 0. C = Settol. CPU900H-139 2001-03-16 === page 26 === TOSHIBA TLCS-900/H CPU SET num, dst < Set > Operation : dst <1 Description : Sets bit num of dst to1. Details : Size Mnemonic Code Byte Word Long word 0 O x ser #42 me Ey a | O x x Ser #8,(mem) Jw] fom mm Flags : S Z H V N C S = Nochange Z = Nochange H = Nochange V = Nochange N = Nochange C = Nochange Execution example: SET 5,(100H) When the contents of memory at address 100H = 00000000B (binary), execution sets the contents of memory at address 100H to 00100000B (binary). 76543210 fo]0] ]0]0[0]0]0] Address 100H Loads CPU900H-140 2001-03-16 === page 27 === TOSHIBA TLCS-900/H CPU SLA num, dst < Shift Left Arithmetic > Operation : {CY , dst < left shift value of dst, dst < 0} Repeat num Description : Loads the contents of the MSB of dst to the carry flag, shifts left the contents of dst, and loads 0 to the LSB of dst. Repeats the number of times specified in num. dst Description chart: MSB < LSB «yy Details : Size Mnemonic Code Byte Word Long word 0 0 OO SIA #42 oP ehl 0 0 OO SLA Ar TP ePly | O O x SLA (mem) 1 fm] 0 | 2 fmm mm Note : When the number of shifts, num, is specified by the A register, the value of the lower 4 bits of the A register is used. Specifying 0 shifts 16 times. When dst is memory, shifting is performed only once. Flags : S Z H V N C f*{*lol*lo|* S = MSB value of dst after shift is set. Z = 1isset when the contents of dst after shift is 0, otherwise 0. H = Reset to 0. V = 1isset when the parity (number of 1s) of dst is even after shifting, otherwise 0. If the operand is 32 bits, an undefined value is set. N = Reset to 0. C = MSB value of dst before the last shift is set. Executionexample: SLA 4,HL When the HL register = 1234H, execution sets the HL register to 2340H and the carry flag to 1. CPU900H-141 2001-03-16 === page 28 === TOSHIBA TLCS-900/H CPU SLL num, dst < Shift Left Logical > Operation : {CY <—dst, dst < left shift value of dst, dst < 0} Repeat num Description : Loads the contents of the MSB of dst to the carry flag, shifts left the contents of dst, and loads 0 to the MSB of dst. Repeats the number of times specified in num. dst Description chart: MSB_<_ LSB |<~—— «0” Details : Size Mnemonic Code Byte Word Long word 0 0 OO SL #4 oP ehl 0 0 0 SL Ar TiPePla | O O x SLL (mem) 1 fm] 0 | 2 fmm mm Note : When the number of shifts, num, is specified by the A register, the value of the lower 4 bits of the A register is used. Specifying 0 shifts 16 times. When dst is memory, shifting is performed only once. Flags : S Z H V N C f*{*lol]*lo|* S = MSB value of dst after shift is set. Z = 1isset when the contents of dst after shift is 0, otherwise 0. H = Reset to 0. V = 1isset when the parity (number of 1s) of dst is even after shifting, otherwise 0. If the operand is 32 bits, an undefined value is set. N = Reset to 0. C = MSB value of dst before the last shift is set. Executionexample: SLL 4,HL When the HL register = 1234H, execution sets the HL register to 2340H and the carry flag to 1. CPU900H-142 2001-03-16 === page 29 === TOSHIBA TLCS-900/H CPU SRA num, dst < Shift Right Arithmetic > Operation : {CY < dst, dst < right shift value of dst, dst is fixed} Repeat num Description : Loads the contents of the LSB of dst to the carry flag and shifts right the contents of dst (MSB is fixed). Repeats the number of times specified in num. Description chart: dst iMse|_—> LSB Details : Size Mnemonic Code Byte Word Long word O 0 OC SRA #47 TiPepT ys | O 0 © SRA As Eves ered ca eri O 0 x SRA (mem Pano Po [mm Note : When the number of shifts, num, is specified by the A register, the value of the lower 4 bits of the A register is used. Specifying 0 shifts 16 times. When dst is memory, shifting is performed only once. Flags : S Z H V N C f*{*lol]*lo|* S = MSB value of dst after shift is set. Z = 1isset when the contents of dst after shift is 0, otherwise 0. H = Reset to 0. V = 1isset when the parity (number of 1s) of dst is even after shift, otherwise 0. If the operand is 32 bits, an undefined value is set. N = Reset to 0. C = LSB value of dst before the last shift is set. Execution example: SRA 4,HL When the HL register = 8230H, execution sets the HL register to F823H and the carry flag to 0. CPU900H-143 2001-03-16 === page 30 === TOSHIBA TLCS-900/H CPU SRL num, dst < Shift Right Logical > Operation : {CY , dst < right shift value of dst, dst < 0} Repeat num Description : Loads the contents of the LSB of dst to the carry flag, shifts right the contents of dst, and loads 0 to the MSB of dst. Repeats the number of times specified in num. dst Details : Size Mnemonic Code Byte Word Long word 0 0 OO SRL #42 oe hl O 0 OC SRL Ar TP ePl a | O O x SRL (mem) 1 fm] 0 | 2 fmm mm Note : When the number of shifts, num, is specified by the A register, the value of the lower 4 bits of the A register is used. Specifying 0 shifts 16 times. When dst is memory, shifting is performed only once. Flags : S Z H V N C S = MSB value of dst after shift is set. Z = 1isset when the contents of dst after shift is 0, otherwise 0. H = Reset to 0. V = 1isset when the parity (number of 1s) of dst is even after shift, otherwise 0. If the operand is 32 bits, an undefined value is set. N = Reset to 0. C = LSB value of dst before the last shift is set. Executionexample: SRL 4,HL When the HL register = 1238H, execution sets the HL register to 0123H and the carry flag to 1. CPU900H-144 2001-03-16 === page 31 === TOSHIBA TLCS-900/H CPU STCF num, dst < Store Carry Flag > Operation : dst Operation : dst (mem),# [i ]m[o] = Jom mm,m| CPU900H-146 2001-03-16 === page 33 === TOSHIBA TLCS-900/H CPU Flags : S Z H V N C Pete te] fade S = MSB value of the result is set. Z = 1isset when the result is 0, otherwise 0. H = 1 is set when a borrow from bit 3 to bit 4 occurs as a result, otherwise 0. When the operand is 32 bits, an undefined value is set. V = 1isset when an overflow occurs as a result, otherwise 0. N = lisset. C = 1isset when a borrow from MSB occurs as a result, otherwise 0. Execution example: SUB HL,IX When the HL register = 7654H and the IX register = 5000H, execution sets the HL register to 2654H. 7654 HL register O-—{ sooo | IX register CPU900H-147 2001-03-16 === page 34 === TOSHIBA TLCS-900/H CPU SWI num < Software Interrupt > Operation : 1) XSP Operation : Zflag dst <1 Description : Loads the inverted value of the bit num of dst to the Z flag. Then the bit num of dst is set to “1”. Details : Size Mnemonic Code byte word long word __ OO x SET As Toe bla O x x TSET —— #8,(mem) [am om J oto] #3 Flags : § ZH VNC x]+ fi} xio|-| S = Anundefined value is set. Z = The inverted value of the sre is set. H = Settol V = Anundefined value is set. N = Setto0 C = Nochange Execution example: When the contents of memory at address 100H=00100000B (binary), TSET 3, (100H) execution sets the Z flag to 1, the contents of memory at address 100H =00101000B (binary). 765 4 3 2 1 ~*0 fojoli{olojojojol address 100H (before execution) Inverted Z flag 1o]0]1}{0{/1]0]0]0] address 100H (after execution) CPU900H-150 2001-03-16 === page 37 === TOSHIBA TLCS-900/H CPU UNLK dst < Unlink > Operation : XSP Flags : S Z H V N C S = Nochange Z = Nochange H = Nochange V = Nochange N = Nochange C = Nochange Execution example: UNLK XIZ As a result of executing this instruction after executing the Link instruction, the stack pointer XSP and the XIZ register revert to the same values they had before the Link instruction was executed. (For details of the Link instruction, see page 100) CPU900H-151 2001-03-16 === page 38 === TOSHIBA TLCS-900/H CPU XOR_ dst, sre < Exclusive OR > Operation : dst tmem,# —— [T]m] 0] [mm mm] CPU900H-152 2001-03-16 === page 39 === TOSHIBA TLCS-900/H CPU Flags : S Z H V N C S = MSB value of the result is set. Z = 1isset when the result is 0, otherwise 0. H = Reset to 0. V = 1isset when the parity (number of 1s) of dst is even as a result, otherwise 0. If the operand is 32 bits, an undefined value is set. N = Cleared to 0. C = Cleared to 0. Execution example: XOR HL,IX When the HL register = 7350H and the IX register = 3456H, execution sets the HL register to 4706H. 0111 0011 0101 0000 < HLregister (before execution) XOR) 0011 0100 0101 0110 < IX register (before execution) 0100 0111 0000 0110 < MHLregister (after execution) CPU900H-153 2001-03-16 === page 40 === TOSHIBA TLCS-900/H CPU XORCF num, sre < Exclusive OR Carry Flag > Operation : CY Description : Exclusive ors the contents of the carry flag and bit num of src, and loads the result to the carry flag. Details : Size Mnemonic Code Byte Word Long word O 0 x XORCR #4, ENE) es ere O 0 x XORCF Ayr ERC) Es ere O x x XORCF #3, (mem) f}ifm]1,1/m)m,;m)m O x x XORCF —Aytmem) [Jem], [mmm] Note : When bit num is specified by the A register, the value of the lower 4 bits of the A register is used. When the operand is a byte and the value of the lower 4 bits of bit num is from 8 to 15, the result is undefined. Flags : S Z H V N C S = Nochange Z = Nochange H = Nochange V = Nochange N = Nochange C = The value obtained by exclusive or-ing the contents of the carry flag with those of bit num of src is set. Execution example: XORCF 6, (100H) When the contents of memory at address 100H = 01000000B (binary) and the carry flag = 1, execution sets the carry flag to 0. 76543210 10{1]/0/0/0/0}0/0] Address 100H oR) Carry flag (before execution) [0] Carry flag (after execution) CPU900H-154 2001-03-16 === page 41 === TOSHIBA TLCS-900/H CPU < Zero flag toCarry Flag > Operation : CY < inverted value of Z flag Description : Loads the inverted value of the Z flag to the carry flag. Details : Mnemonic Code zcF Flags : S Z H V N C |-|-|x|-]o] =| S = Nochange Z = Nochange H = An undefined value is set. V = Nochange N = Reset to 0. C = The inverted value of the Z flag is set. Execution example: ZCF When the Z flag = 0, execution sets the carry flag to 1. 0) Z flag Inverted Carry flag CPU900H-155 2001-03-16