README 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. ===============================================================================
  2. == Instruction Set Summary for the core revision >= 5 microcode ==
  3. ===============================================================================
  4. ===============================================================================
  5. Mnemonics | Operands | Description | Operation
  6. ===============================================================================
  7. Arithmetic and logic instructions:
  8. add | A,B,rD | Add | rD=A+B
  9. add. | A,B,rD | Add, set Carry | rD=A+B SaveCarry
  10. addc | A,B,rD | Add with Carry | rD=A+B+Carry
  11. addc. | A,B,rD | Add with Carry, set Carry | rD=A+B+C SaveCarry
  12. sub | A,B,rD | Subtract | rD=A-B
  13. sub. | A,B,rD | Sub, set Carry | rD=A-B SaveCarry
  14. subc | A,B,rD | Sub with Carry | rD=A-B-Carry
  15. subc. | A,B,rD | Sub with Carry, set Carry | rD=A-B-C SaveCarry
  16. mul | A,B,rD | multiply (rev 11+ only) | spr06d=lsb; rD=msb
  17. Branch instructions:
  18. jmp | l | Uncond. jump (virtual instr.) | PC=l
  19. jand | A,B,l | Jump if binary AND | if(A&B) PC=l
  20. jnand | A,B,l | Jump if not binary AND | if(!(A&B)) PC=l
  21. js | A,B,l | Jump if all bits set | if((A&B)==A) PC=l
  22. jns | A,B,l | Jump if not all bits set | if((A&B)!=A) PC=l
  23. je | A,B,l | Jump if equal | if(A==B) PC=l
  24. jne | A,B,l | Jump if not equal | if(A!=B) PC=l
  25. jls | A,B,l | Jump if less (signed) | if(A<B) PC=l
  26. jges | A,B,l | Jump if greater or equal (sign.)| if(A>=B) PC=l
  27. jgs | A,B,l | Jump if greater (signed) | if(A>B) PC=l
  28. jles | A,B,l | Jump if less or equal (signed) | if(A<=B) PC=l
  29. jl | A,B,l | Jump if less | if(A<B) PC=l
  30. jge | A,B,l | Jump if greater or equal | if(A>=B) PC=l
  31. jg | A,B,l | Jump if greater | if(A>B) PC=l
  32. jle | A,B,l | Jump if less or equal | if(A<=B) PC=l
  33. jdn | A,B,l | Jump if diff is < 0, no carry | if(nc(A-B)<0) PC=l
  34. jdpz | A,B,l | Jump if diff is >= 0, no carry | if(nc(A-B)>=0) PC=l
  35. jdp | A,B,l | Jump if diff is > 0, no carry | if(nc(A-B)>0) PC=l
  36. jdnz | A,B,l | Jump if diff is <= 0, no carry | if(nc(A-B)<=0) PC=l
  37. call | lrX,l | Store PC, call function | lrX=PC; PC=l
  38. calls | l | Store PC, call function | PC->stack; PC=l
  39. ret | lrX,lrY | Store PC, ret from func | lrX=PC; PC=lrY
  40. rets | | ret from function | stack->PC
  41. jzx | M,S,A,B,l | Jump if zero after shift + mask |
  42. jnzx | M,S,A,B,l | Jump if nonzero after shift+msk |
  43. jext | E,A,B,l | Jump if External Condition true | if(E) PC=l
  44. jnext | E,A,B,l | Jump if External Condition false| if(!E) PC=l
  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. Bitwise instructions:
  52. sra | A,B,rD | Arithmetic rightshift | rD=A>>B fillup sign
  53. or | A,B,rD | Bitwise OR | rD=A|B
  54. and | A,B,rD | Bitwise AND | rD=A&B
  55. xor | A,B,rD | Bitwise XOR | rD=A^B
  56. sr | A,B,rD | Rightshift | rD=A>>B
  57. sl | A,B,rD | Leftshift | rD=A<<B
  58. srx | M,S,A,B,rD | Shift right over two registers | See detailed docs
  59. rl | A,B,rD | Rotate left | rD=lrot(A, B bits)
  60. rr | A,B,rD | Rotate right | rD=rrot(A, B bits)
  61. nand | A,B,rD | Clear bits (notmask+and) | rD=A&(~B)
  62. orx | M,S,A,B,rD | OR with shift and select | See detailed docs
  63. Other instructions:
  64. nap | none | Sleep until event | See detailed docs
  65. Description of Operands:
  66. rD = Destination Register (GPR or SPR)
  67. A = Source Register (GPR or SPR) or Immediate
  68. B = Source Register (GPR or SPR) or Immediate
  69. M = Mask
  70. S = Shift
  71. E = External Condition
  72. l = Branch label or address
  73. lrX = Link Register (lr0 - lr3)
  74. lrY = Link Register (lr0 - lr3)
  75. Raw instruction format:
  76. @bitcode_in_hexadecimal
  77. Example: @1C0 @C11,@C22,r3
  78. Virtual instructions are translated by the assembler to other
  79. lowlevel instructions.
  80. Please also see the detailed microcode documentation at:
  81. http://bcm-v4.sipsolutions.net/802.11/Microcode