asm/dasm: Improve cflags
[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 calls     | l          | Store PC, call function         | PC->stack; PC=l
38 ret       | lrX,lrY    | Store PC, ret from func         | lrX=PC; PC=lrY
39 rets      |            | ret from function               | stack->PC
40 jzx       | M,S,A,B,l  | Jump if zero after shift + mask |
41 jnzx      | M,S,A,B,l  | Jump if nonzero after shift+msk |
42 jext      | E,A,B,l    | Jump if External Condition true | if(E) PC=l
43 jnext     | E,A,B,l    | Jump if External Condition false| if(!E) PC=l
44
45 Data transfer instructions:
46 mov       | A,rD       | Copy data (virtual instruction) | rD=A
47 tkiph     | A,rD       | TKIP S-Box lookup high          | rD=SBOX[hi8(A)]
48 tkiphs    | A,rD       | TKIP S-Box lkup hi swap'd       | rD=byteswap(tkiph)
49 tkipl     | A,rD       | TKIP S-Box lookup low           | rD=SBOX[lo8(A)]
50 tkipls    | A,rD       | TKIP S-Box lkup lo swap'd       | rD=byteswap(tkipl)
51
52 Bitwise instructions:
53 sra       | A,B,rD     | Arithmetic rightshift           | rD=A>>B fillup sign
54 or        | A,B,rD     | Bitwise OR                      | rD=A|B
55 and       | A,B,rD     | Bitwise AND                     | rD=A&B
56 xor       | A,B,rD     | Bitwise XOR                     | rD=A^B
57 sr        | A,B,rD     | Rightshift                      | rD=A>>B
58 sl        | A,B,rD     | Leftshift                       | rD=A<<B
59 srx       | M,S,A,B,rD | Shift right over two registers  | See detailed docs
60 rl        | A,B,rD     | Rotate left                     | rD=lrot(A, B bits)
61 rr        | A,B,rD     | Rotate right                    | rD=rrot(A, B bits)
62 nand      | A,B,rD     | Clear bits (notmask+and)        | rD=A&(~B)
63 orx       | M,S,A,B,rD | OR with shift and select        | See detailed docs
64
65 Other instructions:
66 nap       | none       | Sleep until event               | See detailed docs
67
68
69
70 Description of Operands:
71
72 rD      = Destination Register (GPR or SPR)
73 A       = Source Register (GPR or SPR) or Immediate
74 B       = Source Register (GPR or SPR) or Immediate
75 M       = Mask
76 S       = Shift
77 E       = External Condition
78 l       = Branch label or address
79 lrX     = Link Register (lr0 - lr3)
80 lrY     = Link Register (lr0 - lr3)
81
82
83 Raw instruction format:
84 @bitcode_in_hexadecimal
85 Example: @1C0 @C11,@C22,r3
86
87
88 Virtual instructions are translated by the assembler to other
89 lowlevel instructions.
90
91
92 Please also see the detailed microcode documentation at:
93 http://bcm-v4.sipsolutions.net/802.11/Microcode
94