Rabbit 2000 Instruction & Reference Manual

Summary of 2000

  • Page 1

    Rabbit 2000 /3000 microprocessor instruction reference manual 019–0098 f • 040114 this manual (or an even more up-to-date revision) is available for free download at the rabbit website: www.Rabbitsemiconductor.Com.

  • Page 2

    Ii rabbit 2000/3000 microprocessor.

  • Page 3: Table Of Contents

    Instruction reference manual iii table of contents 1. Alphabetical listing of instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2. Instructions listed by group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. Docume...

  • Page 4

    Iv rabbit 2000 microprocessor.

  • Page 5

    Instruction reference manual 1 1. Alphabetical listing of instructions a adc a,n ..............................14 adc a,r ..............................15 adc a,(hl) .........................13 adc a,(ix+d) ......................13 adc a,(iy+d) ......................13 adc hl,ss .......................

  • Page 6

    2 rabbit 2000/3000 microprocessor ld (iy+d),n ..........................64 ld (iy+d),r ..........................64 ld (mn),a ............................65 ld (mn),hl ..........................65 ld (mn),ix ...........................65 ld (mn),iy ...........................65 ld (mn),ss .............

  • Page 7

    Instruction reference manual 3 2. Instructions listed by group a. Load immediate data ld dd,mn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 ld ix,mn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 ld iy,mn . . . . . . . . . . . . . . . . . . . . . . . . . . . ....

  • Page 8

    4 rabbit 2000/3000 microprocessor exx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 h. Stack manipulation add sp,d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 pop ip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 pop ix . . . ....

  • Page 9

    Instruction reference manual 5 bit b,r . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 res b,(hl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 res b,(ix+d) . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 res b,(iy+d) . . . . . . . . . . . . . . . . ....

  • Page 10

    6 rabbit 2000/3000 microprocessor r. Miscellaneous ccf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 ipset 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 ipset 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 ipset 2 . . . . ...

  • Page 11: 3. Document Conventions

    Instruction reference manual 7 3. Document conventions instruction table key • opcode : a hexidecimal representation of the value that the mnemonic instruction represents. • instruction : the mnemonic syntax of the instruction. • clocks : the number of clock cycles it takes to complete this instruct...

  • Page 12

    8 rabbit 2000/3000 microprocessor altd, i/o and flags table keys table 2: altd (“a” column) symbol key table 3: ioi and ioe (“i” column) symbol key table 4: flag register key flag description f r sp • altd selects alternate flags • altd selects alternate destination register • altd operation is a sp...

  • Page 13

    Instruction reference manual 9 document symbols key table 5: symbols rabbit z180 meaning b b bit select (000 = bit 0, 001 = bit 1, 010 = bit 2, 011 = bit 3, 100 = bit 4, 101 = bit 5, 110 = bit 6, 111 = bit 7) cc cc condition code select (00 = nz, 01 = z, 10 = nc, 11 = c) d d 8-bit signed displacemen...

  • Page 14

    10 rabbit 2000/3000 microprocessor condition codes table 6: condition code description condition flag=value description nz z=0 not zero z z=1 zero nc c=0 no carry (c=0) c c=1 carry (c=1) p s=0 positive m s=1 minus lz l/v=0 for logic operations, logic zero (all of the four most significant bits of th...

  • Page 15: 4. Processor Registers

    Instruction reference manual 11 4. Processor registers s z lv c sign zero logical/ overflow carry ix iy sp pc index register index register stack pointer program counter general purpose external interrupt internal interrupt interrupt priority extension of program counter eir iir ip xpc accumulator f...

  • Page 16

    12 rabbit 2000/3000 microprocessor.

  • Page 17: 5. Opcode Descriptions

    Instruction reference manual 13 5. Opcode descriptions description the data in a is summed with the c flag and with the data in memory whose location is: • held in hl, or • the sum of the data in ix and a displacement value d, or • the sum of the data in iy and a displacement value d. The result is ...

  • Page 18

    14 rabbit 2000/3000 microprocessor description the 8-bit constant n is summed with the c flag and with the data in a. The sum is then stored in a. Adc a, n opcode instruction clocks operation ce n adc a, n 4 (2,2) a = a + n + cf flags altd i/o s z l/v c f r sp s d • • v • • •.

  • Page 19

    Instruction reference manual 15 description the data in a is summed with the c flag and with the data in r (any of the registers a, b, c, d, e, h, or l). The result is stored in a. Adc a, r opcode instruction clocks operation —— adc a, r 2 a = a + r + cf 8f adc a,a 2 a = a + a + cf 88 adc a,b 2 a = ...

  • Page 20

    16 rabbit 2000/3000 microprocessor description the data in hl is summed with the c flag and with the data in ss (any of bc, de, hl, or sp). The result is stored in hl. Adc hl, ss opcode instruction clocks operation —— adc hl, ss 4 (2,2) hl = hl + ss + cf ed 4a adc hl,bc 4 (2,2) hl = hl + bc + cf ed ...

  • Page 21

    Instruction reference manual 17 description the data in a is summed with the data in the memory location whose address is: • held in hl, or • the sum of the data in ix and a displacement value d, or • the sum of the data in iy and a displacement value d. The result is stored in a. Add a,(hl) add a,(...

  • Page 22

    18 rabbit 2000/3000 microprocessor description the data in a is summed with the 8-bit constant n. The result is stored in a. Add a, n opcode instruction clocks operation c6 n add a, n 4 (2,2) a = a + n flags altd i/o s z l/v c f r sp s d • • v • • •.

  • Page 23

    Instruction reference manual 19 description the data in a is summed with the data in r (any of the registers a, b, c, d, e, h, or l). The result is stored in a. Add a, r opcode instruction clocks operation —— add a, r 2 a = a + r 87 add a,a 2 a = a + a 80 add a,b 2 a = a + b 81 add a,c 2 a = a + c 8...

  • Page 24

    20 rabbit 2000/3000 microprocessor description the data in hl is summed with the data in the ss (any of bc, de, hl, or sp). The result is stored in hl. Add hl, ss opcode instruction clocks operation —— 09 19 29 39 add hl, ss add hl,bc add hl,de add hl,hl add hl,sp 2 2 2 2 2 hl = hl + ss hl = hl + bc...

  • Page 25

    Instruction reference manual 21 description the data in ix is summed with the xx (any of bc, de, ix, or sp). The result is stored in ix. The data in iy is summed with the yy (any of bc, de, iy, or sp). The result is stored in iy. Add ix, xx add iy, yy opcode instruction clocks operation —— dd 09 dd ...

  • Page 26

    22 rabbit 2000/3000 microprocessor description the data in the stack pointer register (sp) is summed with the 7-bit signed displacement d, and then stored in sp. Add sp, d opcode instruction clocks operation 27 d add sp, d 4 (2,2) sp = sp + d flags altd i/o s z c f r sp s d - - - • •.

  • Page 27

    Instruction reference manual 23 description this is an instruction prefix. Causes the instruction immediately following to affect the alternate flags, or use the alternate registers for the destination of the data, or both. For some instructions altd causes special alternate register uses, unique to...

  • Page 28

    24 rabbit 2000/3000 microprocessor description performs a logical and operation between the byte in a and the byte whose address is: • in hl, or • the sum of the data in ix and a displacement value d, or • the sum of the data in iy and a displacement value d. The relative bits of each byte are compa...

  • Page 29

    Instruction reference manual 25 description performs a logical and operation between the word in hl and the word in de. The relative bits of each byte are compared (i.E., bit 0 of both bytes are compared, bit 1 of both bytes are compared, etc.). The associated bit in the result byte is set only if b...

  • Page 30

    26 rabbit 2000/3000 microprocessor description performs a logical and operation between the byte in a and the 8-bit constant n. The relative bits of each byte are compared (i.E., bit 0 of both bytes are compared, bit 1 of both bytes are compared, etc.). The associ- ated bit in the result byte is set...

  • Page 31

    Instruction reference manual 27 description performs a logical and operation between the byte in a and the byte in r (any of the registers a, b, c, d, e, h, or l). The relative bits of each byte are compared (i.E., bit 0 of both bytes are compared, bit 1 of both bytes are compared, etc.). The associ...

  • Page 32

    28 rabbit 2000/3000 microprocessor description tests the bit b (any of the bits 0, 1, 2, 3, 4, 5, 6, or 7) of the byte whose address is: • contained in hl, or • the sum of data in ix plus a displacement value d, or • the sum of data in iy plus a displacement value d. The z flag is set if the tested ...

  • Page 33

    Instruction reference manual 29 description tests bit b (any of the bits 0, 1, 2, 3, 4, 5, 6, or 7) of the byte in r (any of the registers a, b, c, d, e, h, or l). The z flag is set if the tested bit is 0, reset if the bit is 1. Bit b , r opcode instruction clocks operation b,r a b c d e h l bit b,r...

  • Page 34

    30 rabbit 2000/3000 microprocessor description if the data in hl does not equal zero, then it is set to 1. Bool hl opcode instruction clocks operation cc bool hl 2 if (hl != 0) hl = 1 flags altd i/o s z l/v c f r sp s d • • 0 0 • •.

  • Page 35

    Instruction reference manual 31 description if the data in ix or iy does not equal zero, then that register is set to 1. Bool ix bool iy opcode instruction clocks operation dd cc bool ix 4 (2,2) if (ix != 0) ix = 1 fd cc bool iy 4 (2,2) if (iy != 0) iy = 1 flags altd i/o s z l/v c f r sp s d • • 0 0...

  • Page 36

    32 rabbit 2000/3000 microprocessor description this instruction is used to call a subroutine. First the data in pc is pushed onto the stack. The high-order byte of pc is pushed first, then the low-order byte. Pc is then loaded with mn,16-bit address of the first instruction of the subroutine. Sp is ...

  • Page 37

    Instruction reference manual 33 description the c flag is inverted: if it is set, it becomes cleared. If it is not set, it becomes set. Ccf opcode instruction clocks operation 3f ccf 2 cf = ~cf flags altd i/o s z l/v c f r sp s d - - - • •.

  • Page 38

    34 rabbit 2000/3000 microprocessor description compares the data in a with the data whose address is contained in: • hl, or • the sum of the data in ix and a displacement value d, or • the sum of the data in iy and a displacement value d. These compares are accomplished by subtracting the appropriat...

  • Page 39

    Instruction reference manual 35 description compares the data in a with an 8-bit constant n. This compare is accomplished by subtracting n from a. The result is: a a = n : s=0, c=0, z=1, l/v=v a > n : s=0, c=0, z=0, l/v=v “v” indicates that the overflow flag is set on an arithmetic overflow result. ...

  • Page 40

    36 rabbit 2000/3000 microprocessor description compares the data in a with the data in register r (any of the registers a, b, c, d, e, h, or l). This compare is accomplished by subtracting the data in register r from a. The result is: a a = x : s=0, c=0, z=1, l/v=v a > x : s=0, c=0, z=0, l/v=v where...

  • Page 41

    Instruction reference manual 37 description the data in a is inverted (one’s complement). Example if the data in a is 1100 0101, after the instruction cpl a will contain 0011 1010. Cpl opcode instruction clocks operation 2f cpl 2 a = ~a flags altd i/o s z l/v c f r sp s d - - - - •.

  • Page 42

    38 rabbit 2000/3000 microprocessor description decrements the byte whose address is: • in hl, or • the data in ix plus a displacement value d, or • the data in iy plus a displacement value d. Dec (hl) dec (ix+ d ) dec (iy+ d ) opcode instruction clocks operation 35 dec (hl) 8 (2,1,2,3) (hl) = (hl) -...

  • Page 43

    Instruction reference manual 39 description decrements the data in ix or iy. Dec ix dec iy opcode instruction clocks operation dd 2b dec ix 4 (2,2) ix = ix - 1 fd 2b dec iy 4(2,2) iy = iy - 1 flags altd i/o s z l/v c f r sp s d - - - -.

  • Page 44

    40 rabbit 2000/3000 microprocessor description decrements the data in r (any of the registers a, b, c, d, e, h, or l). Dec r opcode instruction clocks operation —— 3d 05 0d 15 1d 25 2d dec r dec a dec b dec c dec d dec e dec h dec l 2 2 2 2 2 2 2 2 r = r - 1 a = a - 1 b = b - 1 c = c - 1 d = d - 1 e...

  • Page 45

    Instruction reference manual 41 description decrements the data in ss (any of bc, de, hl, or sp). Dec ss opcode instruction clocks operation —— 0b 1b 2b 3b dec ss dec bc dec de dec hl dec sp 2 2 2 2 2 ss = ss - 1 bc = bc - 1 de = de - 1 hl = hl - 1 sp = sp - 1 flags altd i/o s z l/v c f r sp s d - -...

  • Page 46

    42 rabbit 2000/3000 microprocessor description this instruction’s mnemonic stands for decrement and jump if not zero. It decrements the data in b then, if the data in b does not equal 0, it adds the 8 bit signed constant e to pc. 2 is subtracted from the value e so the instruction jumps from the cur...

  • Page 47

    Instruction reference manual 43 description exchanges the byte in h with the data whose address is the data in sp plus 1; and exchanges the byte in l with the data whose address is the data in sp. Ex (sp),hl opcode instruction clocks operation ed 54 ex (sp),hl 15 (2,2,1,2,2,3,3) h (sp+1); l (sp) fla...

  • Page 48

    44 rabbit 2000/3000 microprocessor description • ex (sp),ix exchanges the high order byte of ix with the data whose address is 1 plus the data in the stack pointer register, and exchanges the low order byte of ix with the data whose address is the data in the stack pointer register, sp. • ex (sp),iy...

  • Page 49

    Instruction reference manual 45 description exchanges the data in af with the data in the alternate register af'. Ex af,af ' opcode instruction clocks operation 08 ex af,af' 2 af af' flags altd i/o s z l/v c f r sp s d - - - -.

  • Page 50

    46 rabbit 2000/3000 microprocessor description • ex de,hl exchanges the data in de with the data in hl. If the altd instruction is present then the data in de is exchanged with the data in the alternate register hl'. • ex de',hl exchanges the data in the alternate register de' with the data in hl. I...

  • Page 51

    Instruction reference manual 47 description exchanges the data in bc, de, and hl, with the data in their respective alternate registers bc', de', and hl'. Exx opcode instruction clocks operation d9 exx 2 bc bc'; de de'; hl hl' flags altd i/o s z l/v c f r sp s d - - - -.

  • Page 52

    Rabbit 3000a instruction 48 rabbit 2000/3000 microprocessor description the idet instruction asserts a system mode violation interrupt if system/user mode is enabled (by writing to the enable dual mode register, edmr) and the processor is currently in user mode. Note that idet has the same opcode va...

  • Page 53

    Instruction reference manual 49 description increments the byte whose address is: • held in hl, or • the sum of the data in ix and a displacement value d, or • the sum of the data in iy and a displacement value d. Inc (hl) inc (ix+ d ) inc (iy+ d ) opcode instruction clocks operation 34 inc (hl) 8 (...

  • Page 54

    50 rabbit 2000/3000 microprocessor description • inc ix increments the data in ix. • inc iy increments the data in iy. Inc ix inc iy opcode instruction clocks operation dd 23 inc ix 4 (2,2) ix = ix + 1 fd 23 inc iy 4 (2,2) iy = iy + 1 flags altd i/o s z l/v c f r sp s d - - - -.

  • Page 55

    Instruction reference manual 51 description increments the data in r (any of the registers a, b, c, d, e, h, or l). Inc r opcode instruction clocks operation —— 3c 04 0c 14 1c 24 2c inc r inc a inc b inc c inc d inc e inc h inc l 2 2 2 2 2 2 2 2 r = r + 1 a = a + 1 b = b + 1 c = c + 1 d = d + 1 e = ...

  • Page 56

    52 rabbit 2000/3000 microprocessor description increments the data in ss (any of bc, de, hl, or sp). Inc ss opcode instruction clocks operation —— 03 13 23 33 inc ss inc bc inc de inc hl inc sp 2 2 2 2 2 ss = ss + 1 bc = bc + 1 de = de + 1 hl = hl + 1 sp = sp + 1 flags altd i/o s z l/v c f r sp s d ...

  • Page 57

    Instruction reference manual 53 description • ioi: the ioi prefix allows the use of existing memory access instructions as internal i/o instructions. When prefixed, a 16-bit memory instruction accesses the i/o space at the address specified by the lower byte of the 16-bit address. With ioi, the uppe...

  • Page 58

    54 rabbit 2000/3000 microprocessor description the interrupt priority register, ip is an 8-bit register that forms a stack of the current priority and the other previous 3 priorities. Ipset 0 forms the lowest priority; ipset 3 forms the highest priority. These instruc- tions are privileged. • ipset ...

  • Page 59

    Instruction reference manual 55 description the ipres instruction rotates the contents of the interrupt priority register 2 bits to the right, replacing the current priority with the previous priority. It is impossible to interrupt during the execution of this instruction. This instruction is privil...

  • Page 60

    56 rabbit 2000/3000 microprocessor description • jp (hl): the data in hl is loaded into pc. Thus the address of the next instruction fetched is the data in hl. • jp (ix): the data in ix is loaded into pc. Thus the address of the next instruction fetched is the data in ix. • jp (iy): the data in iy i...

  • Page 61

    Instruction reference manual 57 description if the condition f is true then the 16-bit data mn is loaded into pc. If the condition is false then pc increments normally. The condition f is one of the following: nz, z flag not set; z, z flag set; nc, c flag not set; c, c flag set; lz, l/v flag is not ...

  • Page 62

    58 rabbit 2000/3000 microprocessor description if condition cc is true then the 8-bit signed displacement value e is added to pc. Since the instruction takes two increments of the pc to complete, two is subtracted from the displacement value so that the displacement takes place from the instruction ...

  • Page 63

    Instruction reference manual 59 description adds a signed constant e to pc. Since the instruction takes two increments of pc to complete, two is subtracted from the displacement value so that the displacement takes place from the instruction opcode. This instruction recognizes labels when used in th...

  • Page 64

    60 rabbit 2000/3000 microprocessor description this instruction is similar to the call routine in that it transfers program execution to the subroutine address specified by the 16-bit operand mn. The lcall instruction is special in that it allows calls to be made to a computed address in xmem. Note ...

  • Page 65

    Instruction reference manual 61 description • ld (bc),a: loads the memory location whose address is the data in bc with the data in a. • ld (de),a: loads the memory location whose address is the data in de with the data in a. • ld (hl),n: loads the memory location whose address is the data in hl wit...

  • Page 66

    62 rabbit 2000/3000 microprocessor description loads the data in l into the memory location whose address is the sum of the data in hl and a displacement value d. Then, loads the data in h into the memory location whose address is the sum of the data in hl and a displacement value d plus 1. Ld (hl+ ...

  • Page 67

    Instruction reference manual 63 description • ld (ix+d),hl: loads the data in l into the memory location whose address is the sum of the data in ix and a displacement value d. Then, loads the data in h into the memory location whose address is the sum of the data in ix and a displacement value d plu...

  • Page 68

    64 rabbit 2000/3000 microprocessor description • ld (iy+d),hl: loads the data in l into the memory location whose address is the sum of the data in iy and a displacement value d. Then, loads the data in h into the memory location whose address is the sum of the data in iy and a displacement value d ...

  • Page 69

    Instruction reference manual 65 description • ld (mn),a: loads the memory location whose address is mn with the data in a. • ld (mn),hl: loads the memory location whose address is mn with the data in l, then loads the memory location whose address is 1 plus mn with the data in h. • ld (mn),ix: loads...

  • Page 70

    66 rabbit 2000/3000 microprocessor description • ld (sp+n),hl: loads the data in the l into the memory location whose address is the sum of the data in sp and the displacement n. Then loads the data in the h into the memory location whose address is the sum of the data in sp, the displacement n, and...

  • Page 71

    Instruction reference manual 67 description loads a with the data whose address in memory is: • the data in bc, or • the data in de, or • the 16-bit constant mn. Ld a,(bc) ld a,(de) ld a,( mn ) opcode instruction clocks operation 0a ld a,(bc) 6 (2,2,2) a = (bc) 1a ld a,(de) 6 (2,2,2) a = (de) 3a n m...

  • Page 72

    68 rabbit 2000/3000 microprocessor description • ld a,eir: loads a with the data in the external interrupt register, eir. The eir is used to specify the most significant byte (msb) of the external interrupt address. The value loaded in the eir is concatenated with the appropriate external interrupt ...

  • Page 73

    Instruction reference manual 69 description loads a with the data in xpc. This instruction is privileged. Ld a,xpc opcode instruction clocks operation ed 77 ld a,xpc 4 (2,2) a = xpc flags altd i/o s z l/v c f r sp s d - - - - •.

  • Page 74

    70 rabbit 2000/3000 microprocessor description loads the low-order byte of the dd (any of bc, de, hl or sp) with the data at memory address mn. Then loads the high-order byte of register dd with data at memory address mn plus 1. Ld dd ,( mn ) opcode instruction clocks operation —— ed 4b n m ed 5b n ...

  • Page 75

    Instruction reference manual 71 description loads the alternate register dd' (any of the registers bc', de', or hl') with the data in bc or de. Ld dd ' ,bc ld dd ' ,de opcode instruction clocks operation —— ed 49 ed 59 ed 69 ld dd' ,bc ld bc',bc ld de',bc ld hl',bc 4 (2,2) 4 (2,2) 4 (2,2) 4 (2,2) dd...

  • Page 76

    72 rabbit 2000/3000 microprocessor description loads dd (any of bc, de, hl, or sp) with the 16-bit value mn. Ld dd , mn opcode instruction clocks operation —— 01 n m 11 n m 21 n m 31 n m ld dd , mn ld bc, mn ld de, mn ld hl, mn ld sp, mn 6 (2,2,2) 6 (2,2,2) 6 (2,2,2) 6 (2,2,2) 6 (2,2,2) dd = mn bc =...

  • Page 77

    Instruction reference manual 73 description • ld eir,a: loads the external interrupt register, eir, with the data in a. The eir is used to specify the most significant byte (msb) of the external interrupt address. The value loaded in the eir is concatenated with the appropriate external interrupt ad...

  • Page 78

    74 rabbit 2000/3000 microprocessor description • ld hl,(mn): loads l with the data whose address is mn and loads the h with the data whose address is mn plus 1. • ld hl,(hl+d): loads l with the data whose address is the data in hl plus a displacement d. Then loads h with the data whose address is th...

  • Page 79

    Instruction reference manual 75 description loads l with the data whose address is the data in sp plus a displacement d. Then loads h with the data whose address is the data in sp plus a displacement d plus 1. Ld hl,(sp+ n ) opcode instruction clocks operation c4 n ld hl,(sp+ n ) 9 (2,2,1,2,2) l = (...

  • Page 80

    76 rabbit 2000/3000 microprocessor description • ld hl,ix: loads hl with the data in ix. • ld hl,iy: loads hl with the data in iy. Ld hl,ix ld hl,iy opcode instruction clocks operation dd 7c ld hl,ix 4 (2,2) hl = ix fd 7c ld hl,iy 4 (2,2) hl = iy flags altd i/o s z l/v c f r sp s d - - - - •.

  • Page 81

    Instruction reference manual 77 description loads the low order byte of ix with the data whose address is mn. Then loads the high order byte of ix with the data whose address is mn plus 1. Ld ix,( mn ) opcode instruction clocks operation dd 2a n m ld ix,( mn ) 13* ix (low) = ( mn ); ix (high) = ( mn...

  • Page 82

    78 rabbit 2000/3000 microprocessor description loads the low order byte of ix with the data whose address is the data in the stack pointer, sp, plus a dis- placement n. Then loads the high order byte of ix with the data whose address is the data in the stack pointer register plus a displacement n pl...

  • Page 83

    Instruction reference manual 79 description • ld ix,hl: loads ix with the data in hl. • ld ix,mn: loads ix with the 16-bit constant mn. • ld iy,hl: loads iy with the data in hl. • ld ix,mn: loads iy with the 16-bit constant mn. Ld ix,hl ld ix, mn ld iy,hl ld iy, mn opcode instruction clocks operatio...

  • Page 84

    80 rabbit 2000/3000 microprocessor description loads the low order byte of iy with the data at the address mn and loads the high order byte of iy with the data at the address mn+1. Ld iy,( mn ) opcode instruction clocks operation fd 2a n m ld iy,( mn ) 13* iy (low) = ( mn ); iy (high) = ( mn + 1) *c...

  • Page 85

    Instruction reference manual 81 description loads the low order byte of iy with the data whose address is the data in the stack pointer register sp plus a displacement n. Then loads the high order byte of iy with the data whose address is the data in the stack pointer register plus a displacement n ...

  • Page 86

    82 rabbit 2000/3000 microprocessor description loads r (any of the registers a, b, c, d, e, h, or l) with the data whose address is: • the data in hl, or • the sum of the data in ix and a displacement d, or • the sum of the data in iy and a displacement d. Ld r ,(hl) ld r ,(ix+ d ) ld r ,(iy+ d ) op...

  • Page 87

    Instruction reference manual 83 description loads r (any of the registers a, b, c, d, e, h, or l) with the 8-bit constant n. Ld r , n opcode instruction clocks operation —— 3e n 06 n 0e n 16 n 1e n 26 n 2e n ld r , n ld a, n ld b, n ld c, n ld d, n ld e, n ld h, n ld l, n 4 (2,2) 4 (2,2) 4 (2,2) 4 (...

  • Page 88

    84 rabbit 2000/3000 microprocessor description loads r (any of the registers a, b, c, d, e, h, or l) with the data in g (any of the registers a, b, c, d, e, h, or l). Ld r , g opcode instruction clocks operation r,g a b c d e h l ld r , g 2 r = g a 7f 78 79 7a 7b 7c 7d b 47 40 41 42 43 44 45 c 4f 48...

  • Page 89

    Instruction reference manual 85 description loads sp with the data in (a) hl, (b) the data in ix, or (c) the data in iy. These are privileged instructions. Ld sp,hl ld sp,ix ld sp,iy opcode instruction clocks operation f9 ld sp,hl 2 sp = hl dd f9 ld sp,ix 4 (2,2) sp = ix fd f9 ld sp,iy 4 (2,2) sp = ...

  • Page 90

    86 rabbit 2000/3000 microprocessor description loads xpc with the data in a. This instruction is privileged. Ld xpc,a opcode instruction clocks operation ed 67 ld xpc,a 4 (2,2) xpc = a flags altd i/o s z l/v c f r sp s d - - - -.

  • Page 91

    Instruction reference manual 87 description • ldd: loads the memory location whose address is in de with the data at the address in hl. Then it decrements the data in bc, de, and hl. • lddr: while the data in bc does not equal 0 then the memory location whose address is in de is loaded with the data...

  • Page 92

    Rabbit 3000a instruction 88 rabbit 2000/3000 microprocessor description • lddsr : while the data in bc does not equal 0, the memory location whose address is in de is loaded with the data at the address in hl. The data in bc and hl (but not de) is then decre- mented. This instruction then repeats un...

  • Page 93

    Instruction reference manual 89 description these instructions are used to access 20-bit addresses. In all cases, the four most significant bits of the 20-bit address (bits 19 through 16) are defined as the four least significant bits of a (bits 3 though 0). The ldp instructions bypass the mmu’s add...

  • Page 94

    90 rabbit 2000/3000 microprocessor description these instructions are used to access 20-bit addresses. In all cases, the four most significant bits of the 20-bit address (bits 19 through 16) are defined as the four least significant bits of a (bits 3 though 0). The ldp instructions bypass the mmu’s ...

  • Page 95

    Instruction reference manual 91 description these instructions are used to access 20-bit addresses. In all cases, the four most significant bits of the 20-bit address (bits 19 through 16) are defined as the four least significant bits of a (bits 3 though 0). The ldp instructions bypass the mmu’s add...

  • Page 96

    92 rabbit 2000/3000 microprocessor description these instructions are used to access 20-bit addresses. In all cases, the four most significant bits of the 20-bit address (bits 19 through 16) are defined as the four least significant bits of a (bits 3 though 0). The ldp instructions bypass the mmu’s ...

  • Page 97

    Instruction reference manual 93 description this instruction is similar to the jp mn instruction in that it transfers program execution to the memory loca- tion specified by the 16-bit address, mn. Ljp is special in that it allows a jump to be made to a computed address in xmem. Note that the value ...

  • Page 98

    94 rabbit 2000/3000 microprocessor description the lret transfers execution from a subroutine to the calling program by popping pc and the xpc off of the stack, in order to return from an lcall operation. First, the low order byte of pc is loaded with the data whose address is in sp. Next, the high ...

  • Page 99

    Rabbit 3000a instruction instruction reference manual 95 description • lsdr : while the data in bc does not equal 0, the memory location whose address is in de is loaded with the data at the address in hl. The data in bc, de, and hl is then decremented. This instruction then repeats until bc equals ...

  • Page 100

    96 rabbit 2000/3000 microprocessor description a signed multiplication operation is performed on the contents of the 16-bit binary integers contained in the bc and de registers. The signed 32-bit result is placed in hl (bits 31 through 16) and bc (bits 15 through 0) registers. Examples: ld bc, 0ffff...

  • Page 101

    Instruction reference manual 97 description subtracts the value of the data in a from zero and stores the result in a. Neg opcode instruction clocks operation ed 44 neg 4 (2,2) a = 0 - a flags altd i/o s z l/v c f r sp s d • • v • • •.

  • Page 102

    98 rabbit 2000/3000 microprocessor description no operation is performed during this cycle. Nop opcode instruction clocks operation 00 nop 2 no operation flags altd i/o s z l/v c f r sp s d - - - -.

  • Page 103

    Instruction reference manual 99 description performs a logical or operation between the byte in a and the byte whose address is (a) in hl, (b) the sum of the data in ix and a displacement d, or (c) the sum of the data in iy and a displacement d. The relative bits of each byte are compared (i.E., the...

  • Page 104

    100 rabbit 2000/3000 microprocessor description performs a logical or between the data in hl and the data in de. The relative bits of each byte are compared (i.E., the bit 1 of both bytes are compared, the bit 2 of both bytes are compared, etc.) and the associated bit in the result byte is set if ei...

  • Page 105

    Instruction reference manual 101 description • or ix,de: performs a logical or operation between the data in ix and the data in de. The result is stored in ix • or iy,de: performs a logical or operation between the data in iy and the data in de. The result is stored in iy the relative bits of each b...

  • Page 106

    102 rabbit 2000/3000 microprocessor description • or n: performs a logical or operation between the byte in a and the 8-bit constant n. • or r: performs a logical or operation between the byte in a and the byte in r (any of the reg- isters a, b, c, d, e, h, or l). The relative bits of each byte are ...

  • Page 107

    Instruction reference manual 103 description • pop ip: loads the interrupt priority register, ip, with the data at the memory location in the stack pointer, sp, and then increments the data in sp. This is a privileged instruction. • pop ix: loads the low order byte of ix with the data at the memory ...

  • Page 108

    Rabbit 3000a instruction instruction reference manual 104 description loads the system/user mode register su with the data at the memory location in sp, then increments the data in sp. This instruction is privileged and is implemented in the rabbit 3000a. Pop su opcode instruction clocks operation e...

  • Page 109

    Instruction reference manual 105 description loads the low order byte of the zz (any of af, bc, de, or hl) with the data at the memory address in sp then loads the high order byte of zz with the data at the memory address immediately following the one held in sp. Sp is then incremented twice. Pop zz...

  • Page 110

    106 rabbit 2000/3000 microprocessor description • push ip: loads the location in memory whose address is 1 less that the data held in the stack pointer, sp, with the data in the interrupt priority register ip. Then decrements sp. • push ix: loads the memory location with the address 1 less than the ...

  • Page 111

    Rabbit 3000a instruction instruction reference manual 107 description loads the location in memory whose address is 1 less than the data held in sp with the data in the system/ user mode register (su) then decrements sp. This instruction is privileged and is implemented in the rabbit 3000a. Push su ...

  • Page 112

    108 rabbit 2000/3000 microprocessor description loads the memory location with the address 1 less than the data in the sp with the high order byte of the data in zz (any of af, bc, de, or hl), and loads the memory location with the address two less than the data in sp with the low order byte of the ...

  • Page 113

    Rabbit 3000a instruction instruction reference manual 109 description the rdmode instruction sets the c flag to the value of bit 0 of the system/user mode register (su). This instruction is implemented in the rabbit 3000a. Rdmode opcode instruction clocks operation ed 7f rdmode 4 (2,2) cf = su[0] fl...

  • Page 114

    110 rabbit 2000/3000 microprocessor description resets bit b (any of the bits 0, 1, 2, 3, 4, 5, 6, or 7) of the data whose address is: • held in hl, or • the sum of the data in ix and a displacement d, or • the sum of the data in iy and a displacement d. The bit is reset by performing a logical and ...

  • Page 115

    Instruction reference manual 111 description resets bit b (any of the bits 0, 1, 2, 3, 4, 5, 6, or 7) of the data held in r (any of the register a, b, c, d, e, h, or l). The bit is reset by performing a logical and between the selected bit and its complement. Res b , r opcode instruction clocks oper...

  • Page 116

    112 rabbit 2000/3000 microprocessor description ret transfers execution from a subroutine to the program that called it. First it loads the low order byte of pc with the data at the memory address in sp then loads the high order byte of pc with the data at the memory address immediately following th...

  • Page 117

    Instruction reference manual 113 description if the condition f is false, then the instruction is ignored. If the condition f is true, then the instruction loads the low order byte of pc with the data at the memory address in sp then loads the high order byte of pc with the data at the memory addres...

  • Page 118

    114 rabbit 2000/3000 microprocessor description loads the interrupt priority register (ip) with the data whose address is in sp. Then loads the low order byte of pc with the data whose address is 1 higher than the data in sp and loads the high order byte of pc with the data whose address is two high...

  • Page 119

    Instruction reference manual 115 description rotates to the left with the c flag the data whose address is: • the data in hl, or • the sum of the data in ix and a displacement d, or • the sum of the data in iy and a displacement d. Bits 0 through 6 move to the next highest-order bit position (bit 0 ...

  • Page 120

    116 rabbit 2000/3000 microprocessor description rotates to the left with the c flag the contents of register de. Each bit in the register moves to the next high- est-order bit position (bit 0 moves to bit 1, etc.) while the c flag moves to bit 0 and bit 15 moves to the c flag. See figure below. Figu...

  • Page 121

    Instruction reference manual 117 description rotates to the left with the c flag the contents of r (any of the register a, b, c, d, e, h, or l). Each bit in the register moves to the next highest-order bit position (bit 0 moves to bit 1, etc.) while the c flag moves to bit 0 and bit 7 moves to the c...

  • Page 122

    118 rabbit 2000/3000 microprocessor description rotates to the left with the c flag the contents of a. Each bit in the register moves to the next highest-order bit position (bit 0 moves to bit 1, etc.) while the c flag moves to bit 0 and bit 7 moves to the c flag. See figure 1 on page 115. Rla opcod...

  • Page 123

    Instruction reference manual 119 description rotates to the left the data whose address is: • the data in hl, or • the sum of the data in ix and a displacement d, or • the sum of the data in iy and a displacement d. Each bit in the register moves to the next highest-order bit position (bit 0 moves t...

  • Page 124

    120 rabbit 2000/3000 microprocessor description rotates to the left the data in r (any of the register a, b, c, d, e, h, or l). Each bit in the register moves to the next highest-order bit position (bit 0 moves to bit 1, etc.) while bit 7 moves to both bit 0 and the c flag. See figure 3 on page 119....

  • Page 125

    Instruction reference manual 121 description rotates to the left the data in a. Each bit in the register moves to the next highest-order bit position (bit 0 moves to bit 1, etc.) while bit 7 moves to both bit 0 and the c flag. See figure 3 on page 119. Rlca opcode instruction clocks operation 07 rlc...

  • Page 126

    122 rabbit 2000/3000 microprocessor description rotates to the right with the c flag the data whose address is: • the data in hl, or • the sum of the data in ix and a displacement d, or • the sum of the data in iy and a displacement d. Bit 0 moves to the c flag, bits 1 through 7 move to the next low...

  • Page 127

    Instruction reference manual 123 description rotates to the right with the c flag the data in de or hl. Bit 0 moves to the c flag, bits 1 through 15 move to the next lowest-order bit position, and the c flag moves to bit 15 (see figure below). Figure 5: the bit logic for the rr instruction. Rr de rr...

  • Page 128

    124 rabbit 2000/3000 microprocessor description rotates to the right with the c flag the data in ix or iy. Bit 0 moves to the c flag, bits 1 through 15 move to the next lowest-order bit position, and the c flag moves to bit 15. See figure 5 on page 123. Rr ix rr iy opcode instruction clocks operatio...

  • Page 129

    Instruction reference manual 125 description rotates to the right with the c flag the data in register r (any of the registers a, b, c, d, e, h, or l). Bit 0 moves to the c flag, bits 1 through 7 move to the next lowest-order bit position, and the c flag moves to bit 7. See figure 4 on page 122. Rr ...

  • Page 130

    126 rabbit 2000/3000 microprocessor description rotates to the right with the c flag the data in a. Bit 0 moves to the c flag, bits 1 through 7 move to the next lowest-order bit position, and the c flag moves to bit 7. See figure 4 on page 122. Rra opcode instruction clocks operation 1f rra 2 {a,cf}...

  • Page 131

    Instruction reference manual 127 description rotates to the right the data whose address is: • the data in hl, or • the sum of the data in ix and a displacement d, or • the sum of the data in iy and a displacement d. Each bit in the register moves to the next lowest-order bit position (bit 7 moves t...

  • Page 132

    128 rabbit 2000/3000 microprocessor description rotates to the right the data in r (any of the registers a, b, c, d, e, h, or l). Each bit in the register moves to the next lowest-order bit position (bit 7 moves to bit 6, etc.) while bit 0 moves to both bit 7 and the c flag. See figure 6 on page 127...

  • Page 133

    Instruction reference manual 129 description rotates to the right the data in a. Each bit in the register moves to the next lowest-order bit position (bit 7 moves to bit 6, etc.) while bit 0 moves to both bit 7 and the c flag. See figure 6 on page 127. Rrca opcode instruction clocks operation 0f rrc...

  • Page 134

    130 rabbit 2000/3000 microprocessor description pushes the current program counter, pc, onto the stack and then resets the pc to the interrupt vector address represented by iir:v , where iir is the address of the interrupt table and v is the offset into the table. The address of the vector table can...

  • Page 135

    Instruction reference manual 131 description subtracts the c flag and the data whose address is: • the data in hl, or • the sum of the data in ix and a displacement d, or • the sum of the data in iy and a displacement d from the data in a. The result is stored in a. These operations output an invert...

  • Page 136

    132 rabbit 2000/3000 microprocessor description • sbc a,n: subtracts the c flag and the 8-bit constant n from the data in a. • sbc a,r: subtracts the c flag and the data in r (any of the registers a, b, c, d, e, h, or l) from the data in a. The difference is stored in a. These operations output an i...

  • Page 137

    Instruction reference manual 133 description subtracts the c flag and the data in ss (any of bc, de, hl, or sp) from the data in hl. The difference is stored in hl. These operations output an inverted carry: • the c flag is set if a is less than the data being subtracted from it. • the c flag is cle...

  • Page 138

    134 rabbit 2000/3000 microprocessor description sets the c flag. Scf opcode instruction clocks operation 37 scf 2 cf = 1 flags altd i/o s z l/v c f r sp s d - - - 1 •.

  • Page 139

    Instruction reference manual 135 description sets bit b (any of the bits 0, 1, 2, 3, 4, 5, 6, or 7) of the byte whose address is • the data in hl, or • the sum of the data in ix and a displacement d, or • the sum of the data in iy and a displacement d. Set b ,(hl) set b ,(ix+ d ) set b ,(iy+ d ) opc...

  • Page 141

    Rabbit 3000a instruction instruction reference manual 137 description the system/user mode register, su, is an 8 bit register that forms a stack of the current processor mode and the previous 3 modes. Setusr shifts the contents of su 2 bits to the left, then sets bit 1 to 0 and bit 0 to 1, signifyin...

  • Page 142

    138 rabbit 2000/3000 microprocessor description arithmetically shifts to the left the bits of the data whose address is • the data in hl, or • the sum of the data in ix and a displacement d, or • the sum of the data in iy and a displacement d. Bits 0 through 6 are each shifted to the next highest-or...

  • Page 143

    Instruction reference manual 139 description arithmetically shifts to the left the bits of the data in register r (any of a, b, c, d, e, h, or l). Bits 0 through 6 are each shifted to the next highest-order bit position (bit 0 moves to bit 1, etc.). Bit 7 is shifted to the c flag. Bit 0 is reset. Se...

  • Page 144

    140 rabbit 2000/3000 microprocessor description arithmetically shifts to the right the bits in the data whose address is • the data in hl, or • the sum of the data in ix and a displacement d, or • the sum of the data in iy and a displacement d. Bits 7 through 1 are shifted to the next lowest-order b...

  • Page 145

    Instruction reference manual 141 description arithmetically shifts to the right the bits in r (any of the registers a, b, c, d, e, h, or l). Bits 7 through 1 are shifted to the next lowest-order bit position (bit 7 is shifted to bit 6, etc.). Bit 7 is also copied to itself. Bit 0 is shifted to the c...

  • Page 146

    142 rabbit 2000/3000 microprocessor description logically shifts to the right the bits of the data whose address is • the data in hl, or • the sum of the data in ix and a displacement d, or • the sum of the data in iy and a displacement d. Each bit is shifted to the next lowest-order bit position (b...

  • Page 147

    Instruction reference manual 143 description logically shifts to the right the bits in r (any of the registers a, b, c, d, e, h, or l). Each bit is shifted to the next lowest-order bit position (bit 7 shifts to bit 6, etc.) bit 0 shift to the c flag. Bit 7 is reset. See figure 9 on page 142. Srl r o...

  • Page 148

    144 rabbit 2000/3000 microprocessor description subtracts from the data in a the data whose address is • the data in hl, or • the sum of the data in ix and a displacement d, or • the sum of the data in iy and a displacement d. The result is stored in a. Sub (hl) sub (ix+ d ) sub (iy+ d ) opcode inst...

  • Page 149

    Instruction reference manual 145 description subtracts from the data in a the 8-bit constant n. The result is stored in a. Sub n opcode instruction clocks operation d6 n sub n 4 (2,2) a = a - n flags altd i/o s z l/v c f r sp s d • • v • • •.

  • Page 150

    146 rabbit 2000/3000 microprocessor description subtracts from the data in a the data in r (any of the registers a, b, c, d, e, h, or l). The result is stored in a. Sub r opcode instruction clocks operation —— 97 90 91 92 93 94 95 sub r sub a sub b sub c sub d sub e sub h sub l 2 2 2 2 2 2 2 2 a = a...

  • Page 151

    Rabbit 3000a instruction instruction reference manual 147 description the sures instruction rotates the contents of the system/user mode register su 2 bits to the right, replac- ing the current processor mode with the previous mode. This instruction is privileged and only implemented for the rabbit ...

  • Page 152

    Rabbit 3000a instruction 148 rabbit 2000/3000 microprocessor description pushes the current pc onto the stack and then resets the pc to the interrupt vector address represented by iir:0x60, where iir is the address of the interrupt table and 0x60 is the offset into the table. The address of the vect...

  • Page 153

    Rabbit 3000a instruction instruction reference manual 149 description while the data in the bc does not equal 0, then: • the data at the address in iy is multiplied by the data in de; • the data in alternate register de’ is added to that value; • the c flag is added to that value; and • this value i...

  • Page 154

    150 rabbit 2000/3000 microprocessor description performs an exclusive or operation between the data in a and the data whose address is: • the data in hl, or • the sum of the data in ix and a displacement d, or • the sum of the data in iy and a displacement d. The corresponding bits of each byte are ...

  • Page 155

    Instruction reference manual 151 description performs an exclusive or operation between the byte in a and the 8-bit constant n. The corresponding bits of each byte are compared (i.E., bit 0 of both bytes are compared, the bit 1 of both bytes are compared, etc.). The associated bit in the result byte...

  • Page 156

    152 rabbit 2000/3000 microprocessor description performs an exclusive or operation between the byte in a and r (any of the registers a, b, c, d, e, h, or l). The corresponding bits of each byte are compared (i.E., bit 0 of both bytes are compared, bit 1 of both bytes are compared, etc.). The associa...

  • Page 157: 6. Opcode Map

    Instruction reference manual 153 6. Opcode map table 1: main page lsb sb\ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 nop ld bc,mn ld (bc),a inc bc inc b dec b ld b,n rlca ex af,af' add hl,bc ld a,(bc) dec bc inc c dec c ld c,n rrca 1 djnz e ld de,mn ld (de),a inc de inc d dec d ld d,n rla jr e add hl,de ld a...

  • Page 158

    154 instruction reference manual table 2: ed page \lsb msb\ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 1 2 3 4 ld bc',de sbc hl,bc ld (mn),bc neg lret ipset 0 ld i,a ld bc',bc adc hl,bc ld bc,(mn) reti ipset 2 ld r,a 5 ld de',de sbc hl,de ld (mn),de ex (sp),hl ipset 1 ld a,i ld de',bc adc hl,de ld de,(mn) ip...

  • Page 159

    Instruction reference manual 155 table 3: dd page \lsb msb\ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 add ix,bc 1 add ix,de 2 ld ix,mn ld (mn),ix inc ix add ix,ix ld ix,(mn) dec ix 3 inc (ix+d) dec (ix+d) ld (ix+d),n add ix,sp 4 ld b,(ix+d) ld c,(ix+d) 5 ld d,(ix+d) ld e,(ix+d) 6 ldp (ix),hl ldp (mn),ix ld ...

  • Page 160

    156 instruction reference manual table 4: fd page \lsb msb\ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 add iy,bc 1 add iy,de 2 ld iy,mn ld (mn),iy inc iy add iy,iy ld iy,(mn) dec iy 3 inc (iy+d) dec (iy+d) ld (iy+d),n add ix,sp 4 ld b,(iy+d) ld c,(iy+d) 5 ld d,(iy+d) ld e,(iy+d) 6 ldp (iy),hl ldp (mn),iy ld ...

  • Page 161

    Instruction reference manual 157 table 5: cb page sb sb\ 0 1 2 3 4 5 6 7 8 9 a b c d e f 0 rlc b rlc c rlc d rlc e rlc h rlc l rlc (hl) rlc a rrc b rrc c rrc d rrc e rrc h rrc l rrc (hl) rrc a 1 rl b rl c rl d rl e rl h rl l rl (hl) rl a rr b rr c rr d rr e rr h rr l rr (hl) rr a 2 sla b sla c sla d...

  • Page 162

    158 instruction reference manual table 6: dd-cb page b b\ 0 1 2 3 4 5 6 7 8 9 a b c d e f rlc (ix+d) rrc (ix+d) rl (ix+d) rr (ix+d) sla (ix+d) sra (ix+d) srl (ix+d) bit 0,(ix+d) bit 1,(ix+d) bit 2,(ix+d) bit 3,(ix+d) bit 4,(ix+d) bit 5,(ix+d) bit 6,(ix+d) bit 7,(ix+d) res 0,(ix+d) res 1,(ix+d) res 2...

  • Page 163

    Instruction reference manual 159 table 7: fd-cb page b b\ 0 1 2 3 4 5 6 7 8 9 a b c d e f rlc (iy+d) rrc (iy+d) rl (iy+d) rr (iy+d) sla (iy+d) sra (iy+d) srl (iy+d) bit 0,(iy+d) bit 1,(iy+d) bit 2,(iy+d) bit 3,(iy+d) bit 4,(iy+d) bit 5,(iy+d) bit 6,(iy+d) bit 7,(iy+d) res 0,(iy+d) res 1,(iy+d) res 2...

  • Page 164

    160 instruction reference manual.

  • Page 165: 7. Quick Reference Table

    Instruction reference manual 161 7. Quick reference table key • instruction : the mnemonic syntax of the instruction. • opcode : the binary bytes that represent the instruction. • clock cycles : the number of clock cycles that the instruction takes to complete. The numbers in parenthesis are a break...

  • Page 166

    162 rabbit 2000/3000 microprocessor and ix,de 11011101 11011100 4 (2,2) f * * l 0 ix = ix & de n and iy,de 11111101 11011100 4 (2,2) f * * l 0 iy = iy & de n and n 11100110 ----n--- 4 (2,2) fr * * l 0 a = a & n and r 10100-r- 2 fr * * l 0 a = a & r bit b,(hl) 11001011 01-b-110 7 (2,2,1,2) f s - * - ...

  • Page 167

    Instruction reference manual 163 ipset 2 11101101 01001110 4 (2,2) - - - - ip = {ip[5:0], 10} np ipset 3 11101101 01011110 4 (2,2) - - - - ip = {ip[5:0], 11} np ipres 11101101 01011101 4 (2,2) - - - - ip = {ip[1:0], ip[7:2]} np jp (hl) 11101001 4 (2,2) - - - - pc = hl jp (ix) 11011101 11101001 6 (2,...

  • Page 168

    164 rabbit 2000/3000 microprocessor ld hl,(sp+n) 11000100 ----n--- 9 (2,2,1,2,2) r - - - - l = (sp+n); h = (sp+n+1) n ld hl,ix 11011101 01111100 4 (2,2) r - - - - hl = ix n ld hl,iy 11111101 01111100 4 (2,2) r - - - - hl = iy n ld ix,(mn) 11011101 00101010 ----n--- ----m--- 13 (2,2,2,2,1,2,2) s - - ...

  • Page 169

    Instruction reference manual 165 ldp iy,(mn) 11111101 01101101 ----n--- ----m--- 13 (2,2,2,2,1,2,2) - - - - iyl = (mn); iyh = (mn+1). (addr[19:16] = a[3:0]) n ljp x,mn 11000111 ----n--- ----m--- ---x---- 10 (2,2,2,2,2) - - - - xpc = x; pc = mn n lret 11101101 01000101 13 (2,2,1,2,2,2,2) - - - - pcl ...

  • Page 170

    166 rabbit 2000/3000 microprocessor rlc (ix+d) 11011101 11001011 ----d--- 00000110 13 (2,2,2,2,2,3) f b * * l * (ix+d) = {(ix+d)[6,0],(ix+d)[7]}; cy = (ix+d)[7] rlc (iy+d) 11111101 11001011 ----d--- 00000110 13 (2,2,2,2,2,3) f b * * l * (iy+d) = {(iy+d)[6,0],(iy+d)[7]}; cy = (iy+d)[7] rlc r 11001011...

  • Page 171

    Instruction reference manual 167 sub (hl) 10010110 5 (2,1,2) fr s * * v * a = a - (hl) sub (ix+d) 11011101 10010110 ----d--- 9 ( 2,2,2,1,2) fr s * * v * a = a - (ix+d) sub (iy+d) 11111101 10010110 ----d--- 9 ( 2,2,2,1,2) fr s * * v * a = a - (iy+d) sub n 11010110 ----n--- 4 (2,2) fr * * v * a = a - ...

  • Page 172

    168 rabbit 2000/3000 microprocessor.

  • Page 173

    Instruction reference 169 rabbit 2000/3000 microprocessor instruction reference manual part number 019–0098 f • 040114 • printed in u.S.A. ©2001 rabbit semiconductor • all rights reserved. Rabbit semiconductor reserves the right to make changes and improvements to its products without providing noti...

  • Page 174

    170 rabbit 2000/3000 microprocessor.