assembler: Some r15 fixes
[b43-tools.git] / assembler / README
1 ===============================================================================
2 ==        Instruction Set Summary for the core revision >= 5 microcode       ==
3 ===============================================================================
4
5
6 ===============================================================================
7 Mnemonics | Operands   | Description                     | Operation
8 ===============================================================================
9
10 Arithmetic and logic instructions:
11 add       | A,B,rD     | Add                             | rD=A+B
12 add.      | A,B,rD     | Add, set Carry                  | rD=A+B SaveCarry
13 addc      | A,B,rD     | Add with Carry                  | rD=A+B+Carry
14 addc.     | A,B,rD     | Add with Carry, set Carry       | rD=A+B+C SaveCarry
15 sub       | A,B,rD     | Subtract                        | rD=A-B
16 sub.      | A,B,rD     | Sub, set Carry                  | rD=A-B SaveCarry
17 subc      | A,B,rD     | Sub with Carry                  | rD=A-B-Carry
18 subc.     | A,B,rD     | Sub with Carry, set Carry       | rD=A-B-C SaveCarry
19
20 Branch instructions:
21 jmp       | l          | Uncond. jump (virtual instr.)   | PC=l
22 jand      | A,B,l      | Jump if binary AND              | if(A&B) PC=l
23 jnand     | A,B,l      | Jump if not binary AND          | if(!(A&B)) PC=l
24 js        | A,B,l      | Jump if all bits set            | if((A&B)==A) PC=l
25 jns       | A,B,l      | Jump if not all bits set        | if((A&B)!=A) PC=l
26 je        | A,B,l      | Jump if equal                   | if(A==B) PC=l
27 jne       | A,B,l      | Jump if not equal               | if(A!=B) PC=l
28 jls       | A,B,l      | Jump if less (signed)           | if(A<B) PC=l
29 jges      | A,B,l      | Jump if greater or equal (sign.)| if(A>=B) PC=l
30 jgs       | A,B,l      | Jump if greater (signed)        | if(A>B) PC=l
31 jles      | A,B,l      | Jump if less or equal (signed)  | if(A<=B) PC=l
32 jl        | A,B,l      | Jump if less                    | if(A<B) PC=l
33 jge       | A,B,l      | Jump if greater or equal        | if(A>=B) PC=l
34 jg        | A,B,l      | Jump if greater                 | if(A>B) PC=l
35 jle       | A,B,l      | Jump if less or equal           | if(A<=B) PC=l
36 call      | lrX,l      | Store PC, call function         | lrX=PC; PC=l
37 ret       | lrX,lrY    | Store PC, ret from func         | lrX=PC; PC=lrY
38 jzx       | M,S,A,B,l  | Jump if zero after shift + mask |
39 jnzx      | M,S,A,B,l  | Jump if nonzero after shift+msk |
40 jext      | E,A,B,l    | Jump if External Condition true | if(E) PC=l
41 jnext     | E,A,B,l    | Jump if External Condition false| if(!E) PC=l
42
43 Data transfer instructions:
44 mov       | A,rD       | Copy data (virtual instruction) | rD=A
45 tkiph     | A,rD       | TKIP S-Box lookup high          | rD=SBOX[hi8(A)]
46 tkiphs    | A,rD       | TKIP S-Box lkup hi swap'd       | rD=byteswap(tkiph)
47 tkipl     | A,rD       | TKIP S-Box lookup low           | rD=SBOX[lo8(A)]
48 tkipls    | A,rD       | TKIP S-Box lkup lo swap'd       | rD=byteswap(tkipl)
49
50 Bitwise instructions:
51 sra       | A,B,rD     | Arithmetic rightshift           | rD=A>>B fillup sign
52 or        | A,B,rD     | Bitwise OR                      | rD=A|B
53 and       | A,B,rD     | Bitwise AND                     | rD=A&B
54 xor       | A,B,rD     | Bitwise XOR                     | rD=A^B
55 sr        | A,B,rD     | Rightshift                      | rD=A>>B
56 sl        | A,B,rD     | Leftshift                       | rD=A<<B
57 srx       | M,S,A,B,rD | Shift right over two registers  | See detailed docs
58 rl        | A,B,rD     | Rotate left                     | rD=lrot(A, B bits)
59 rr        | A,B,rD     | Rotate right                    | rD=rrot(A, B bits)
60 nand      | A,B,rD     | Clear bits (notmask+and)        | rD=A&(~B)
61 orx       | M,S,A,B,rD | OR with shift and select        | See detailed docs
62
63 Other instructions:
64 nap       | none       | Sleep until event               | See detailed docs
65
66
67
68 Description of Operands:
69
70 rD      = Destination Register (GPR or SPR)
71 A       = Source Register (GPR or SPR) or Immediate
72 B       = Source Register (GPR or SPR) or Immediate
73 M       = Mask
74 S       = Shift
75 E       = External Condition
76 l       = Branch label or address
77 lrX     = Link Register (lr0 - lr3)
78 lrY     = Link Register (lr0 - lr3)
79
80
81 Raw instruction format:
82 @bitcode_in_hexadecimal
83 Example: @1C0 @C11,@C22,r3
84
85
86 Virtual instructions are translated by the assembler to other
87 lowlevel instructions.
88
89
90 Please also see the detailed microcode documentation at:
91 http://bcm-v4.sipsolutions.net/802.11/Microcode
92