asm_tabl.txt 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. +-----------+------------+-------------+-------------+-------------+-------------+-------------------+
  2. | Component | Technology | Amnt of ROM | Type of ROM | Amnt of RAM | No. of SFRs | Serial I/O Type |
  3. |-----------|------------|-------------|-------------|-------------|-------------|-------------------|
  4. | 8031 | HMOS | 0 | -- | 128 bytes | 21 | Start/Stop Async |
  5. | 8051 | HMOS | 4Kbytes | Masked | 128 bytes | 21 | Start/Stop Async |
  6. | 8751 | HMOS | 4Kbytes | EPROM | 128 bytes | 21 | Start/Stop Async |
  7. | 8053 | HMOS | 8Kbytes | Masked | 128 bytes | 21 | Start/Stop Async |
  8. | 9761 | HMOS | 8Kbytes | EPROM | 128 bytes | 21 | Start/Stop Async |
  9. | 8751 | HMOS | 8Kbytes | EPROM | 128 bytes | 21 | Start/Stop Async |
  10. | | | | | | | |
  11. | 80C31 | CMOS | 0 | -- | 128 bytes | 21 | Start/Stop Async |
  12. | 80C51 | CMOS | 4Kbytes | Masked | 128 bytes | 21 | Start/Stop Async |
  13. | 87C51 | CMOS | 4Kbytes | EPROM | 128 bytes | 21 | Start/Stop Async |
  14. | | | | | | | |
  15. | 8032 | HMOS | 0 | -- | 256 bytes | 26 | Start/Stop Async |
  16. | 8052 | HMOS | 8Kbytes | Masked | 256 bytes | 26 | Start/Stop Async |
  17. | 8752 | HMOS | 8Kbytes | EPROM | 256 bytes | 26 | Start/Stop Async |
  18. | | | | | | | |
  19. | 80C32 | CMOS | 0 | -- | 256 bytes | 26 | Start/Stop Async |
  20. | 80C52 | CMOS | 8Kbytes | Masked | 256 bytes | 26 | Start/Stop Async |
  21. | 87C52 | CMOS | 8Kbytes | EPROM | 256 bytes | 26 | Start/Stop Async |
  22. | | | | | | | |
  23. | 8044 | HMOS | 4Kbytes | Masked | 192 bytes | 34 | HDLC/SDLC |
  24. | 8344 | HMOS | 0 | -- | 192 bytes | 34 | HDLC/SDLC |
  25. | 8744 | HMOS | 4Kbytes | EPROM | 192 bytes | 34 | HDLC/SDLC |
  26. | | | | | | | |
  27. | 80535 | HMOS | 0 | -- | 256 bytes | 41 | Start/Stop Async |
  28. | 80515 | HMOS | 8Kbytes | Masked | 256 bytes | 41 | Start/Stop Async |
  29. | | | | | | | |
  30. | 80C535 | CHMOS | 0 | -- | 256 bytes | 41 | Start/Stop Async |
  31. | 80C515 | CHMOS | 8Kbytes | Masked | 256 bytes | 41 | Start/Stop Async |
  32. | | | | | | | |
  33. | 80532 | HMOS | 0 | -- | 128 bytes | 28 | Start/Stop Async |
  34. | 80512 | HMOS | 4Kbytes | Masked | 128 bytes | 28 | Start/Stop Async |
  35. | | | | | | | |
  36. | 80C152 | CHMOS | 0 | -- | 256 bytes | 56 | CSMA/CD |
  37. | 83C152 | CHMOS | 8Kbytes | Masked | 256 bytes | 56 | CSMA/CD |
  38. | | | | | | | |
  39. | 80C154 | CMOS | 0 | -- | 256 bytes | 27 | Start/Stop Async |
  40. | 83C154 | CMOS | 16Kbytes | Masked | 256 bytes | 27 | Start/Stop Async |
  41. | 85C154 | CMOS | 16Kbytes | EPROM | 256 bytes | 27 | Start/Stop Async |
  42. | | | | | | | |
  43. +-----------+------------+-------------+-------------+-------------+-------------+-------------------+
  44. +-----------+------------+-------------+-------------+-------------+-------------+-------------------+
  45. | Component | Technology | Amnt of ROM | Type of ROM | Amnt of RAM | No. of SFRs | Serial I/O Type |
  46. |-----------|------------|-------------|-------------|-------------|-------------|-------------------|
  47. | 80C51FA | CHMOS | 0 | -- | 256 bytes | 47 | Start/Stop Async |
  48. | 83C51FA | CHMOS | 8Kbytes | Masked | 256 bytes | 47 | Start/Stop Async |
  49. | 87C51FA | CHMOS | 8Kbytes | EPROM | 256 bytes | 47 | Start/Stop Async |
  50. | | | | | | | |
  51. | 83C51FB | CHMOS | 16Kbytes | Masked | 256 bytes | 47 | Start/Stop Async |
  52. | 87C51FB | CHMOS | 16Kbytes | EPROM | 256 bytes | 47 | Start/Stop Async |
  53. | | | | | | | |
  54. | 83C51FB | CHMOS | 32Kbytes | Masked | 256 bytes | 47 | Start/Stop Async |
  55. | 87C51FB | CHMOS | 32Kbytes | EPROM | 256 bytes | 47 | Start/Stop Async |
  56. | | | | | | | |
  57. | 80C537 | CHMOS | 0 | -- | 256 bytes | 41 | Start/Stop Async |
  58. | 80C517 | CHMOS | 8Kbytes | Masked | 256 bytes | 82 | Start/Stop Async |
  59. | | | | | | | |
  60. | 80C451 | CMOS | 0 | -- | 128 bytes | 24 | Parallel I/F |
  61. | 83C451 | CMOS | 4Kbytes | Masked | 128 bytes | 24 | Parallel I/F |
  62. | 87C451 | CMOS | 4Kbytes | EPROM | 128 bytes | 24 | Parallel I/F |
  63. | | | | | | | |
  64. | 80C452 | CHMOS | 0 | -- | 256 bytes | 55 | U.P.I. |
  65. | 83C452 | CHMOS | 8Kbytes | -- | 256 bytes | 55 | U.P.I. |
  66. | 87C452 | CHMOS | 8Kbytes | -- | 256 bytes | 55 | U.P.I. |
  67. | | | | | | | |
  68. | 80C552 | CMOS | 0 | -- | 256 bytes | 54 | Start/Stop Async |
  69. | 83C552 | CMOS | 8Kbytes | Masked | 256 bytes | 54 | Start/Stop Async |
  70. | 87C552 | CMOS | 8Kbytes | EPROM | 256 bytes | 54 | Start/Stop Async |
  71. | | | | | | | |
  72. | 80C652 | CMOS | 0 | -- | 256 bytes | 24 | Start/Stop Async |
  73. | 83C652 | CMOS | 8Kbytes | Masked | 256 bytes | 24 | Start/Stop Async |
  74. | 87C652 | CMOS | 8Kbytes | EPROM | 256 bytes | 24 | Start/Stop Async |
  75. | 83C654 | CMOS | 16Kbytes | Masked | 256 bytes | 24 | Start/Stop Async |
  76. | 87C654 | CMOS | 16Kbytes | EPROM | 256 bytes | 24 | Start/Stop Async |
  77. | | | | | | | |
  78. | 83C752 | CMOS | 2Kbytes | Masked | 64 bytes | 25 | I2C |
  79. | 87C752 | CMOS | 2Kbytes | EPROM | 64 bytes | 25 | I2C |
  80. | | | | | | | |
  81. | 83C751 | CMOS | 2Kbytes | Masked | 64 bytes | 20 | I2C |
  82. | 87C751 | CMOS | 2Kbytes | EPROM | 64 bytes | 20 | I2C |
  83. | | | | | | | |
  84. | 80C521 | CMOS | 0 | -- | 256 bytes | 26 | Start/Stop Async |
  85. | 80C321 | CMOS | 8Kbytes | Masked | 256 bytes | 26 | Start/Stop Async |
  86. | 87C521 | CMOS | 8Kbytes | EPROM | 256 bytes | 26 | Start/Stop Async |
  87. | 80C541 | CMOS | 16Kbytes | Masked | 256 bytes | 26 | Start/Stop Async |
  88. | 87C541 | CMOS | 16Kbytes | EPROM | 256 bytes | 26 | Start/Stop Async |
  89. | | | | | | | |
  90. | 80C851 | CMOS | 0 | -- | 128 bytes | 21 | Start/Stop Async |
  91. | 83C851 | CMOS | 4Kbytes | Masked | 128 bytes | 21 | Start/Stop Async |
  92. | | | | | | | |
  93. +-----------+------------+-------------+-------------+-------------+-------------+-------------------+
  94. $DATE(date) Places date in page header $EJECT Places a form feed in listing
  95. $INCLUDE(file) Inserts file in source program $LIST Allows listing to be output
  96. $NOLIST Stops outputting the listing $MOD51 Uses 8051 predefined symbols
  97. $MOD52 Uses 8052 predefined symbols $MOD44 Uses 8044 predefined symbols
  98. $NOMOD No predefined symbols used $OBJECT(file) Places object output in file
  99. $NOOBJECT No object file is generated $PAGING Break output listing into pages
  100. $NOPAGING Print listing w/o page breaks $PAGELENGTH(n) No. of lines on a listing page
  101. $PAGEWIDTH(n) No. of columns on a listing page $PRINT(file) Places listing output in file
  102. $NOPRINT Listing will not be output $SYMBOLS Append symbol table to listing
  103. $NOSYMBOLS Symbol table will not be output $TITLE(string) Places string in page header
  104. EQU Define symbol DATA Define internal memory symbol
  105. IDATA Define indirectly addressed internal XDATA Define external memory symbol
  106. memory symbol BIT Define internal bit memory symbol
  107. CODE Define program memory symbol DS Reserve bytes of data memory
  108. DBIT Reserve bits of bit memory DB Store byte values in program memory
  109. DW Store word values in program memory ORG Set segment location counter
  110. END End of assembly language source file CSEG Select program memory space
  111. DSEG Select internal memory data space XSEG Select external memory data space
  112. ISEG Select indirectly addressed internal BSEG Select bit addressable memory space
  113. memory space USING Select register bank
  114. IF Begin conditional assembly block ELSE Alternative conditional assembly block
  115. ENDIF End conditional assembly block
  116. ACALL Absolute call ADD Add ADDC Add with carry
  117. AJMP Absolute jump ANL Logical and CJNE Compare & jump if not equal
  118. CLR Clear CPL Complement DA Decimal adjust
  119. DEC Decrement DIV Divide DJNZ Decrement & jump if not zero
  120. INC Increment JB Jump if bit set JBC Jump & clear bit if bit set
  121. JC Jump if carry set JMP Jump JNB Jump if bit not set
  122. JNC Jump if carry not set JNZ Jump if accum. not zero JZ Jump if accumulator zero
  123. LCALL Long call LJMP Long jump MOV Move
  124. MOVC Move code MOVX Move external MUL Multiply
  125. NOP No operation ORL Inclusive or POP Pop stack
  126. PUSH Push stack RET Return RETI Return from interrupt
  127. RL Rotate left RLC Rotate left thru carry RR Rotate right
  128. RRC Rotate right thru carry SETB Set bit SJMP Short jump
  129. SUBB Subtract with borrow SWAP Swap nibbles XCH Exchange bytes
  130. XCHD Exchange digits XRL Exclusive or CALL Generic call
  131. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  132. | | | DEST | SOURCE | ASSEMBLY |HEX |B |C | PSW |
  133. | MNEMONIC | OPERATION | ADDR | ADDR | LANGUAGE |OP- |Y |Y |C A O |
  134. | | | MODE | MODE | FORM |CODE |T |C |F C V |
  135. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  136. | ACALL | | | | | | | | |
  137. | 2K in Page (11 bits) | PC + 2 -> STACK | Prog Direct | | ACALL Paddr | see | 2 | 2 | - - - |
  138. | Absolute Call | SP + 2 -> SP | | | | note | | | |
  139. | | Paddr<10:0> -> PC<10:0> | | | | 1 | | | |
  140. | | PC<15:11> -> PC<15:11> | | | | | | | |
  141. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  142. | ADD | | | | | | | | |
  143. | Add Operand to | A + SOper -> A | Accumulator | Immediate | ADD A,#data | 24 | 2 | 1 | * * * |
  144. | Accumulator | | " | Direct | ADD A,Daddr | 25 | 2 | 1 | |
  145. | | | " | Indirect | ADD A,@Ri | 26,27 | 1 | 1 | |
  146. | | | " | Register | ADD A,Rn | 28-2F | 1 | 1 | |
  147. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  148. | ADDC | | | | | | | | |
  149. | Add Operand with | A + SOper + C -> A | Accumulator | Immediate | ADDC A,#data | 34 | 2 | 1 | * * * |
  150. | Carry to Accumulator | | " | Direct | ADDC A,Daddr | 35 | 2 | 1 | |
  151. | | | " | Indirect | ADDC A,@Ri | 36,37 | 1 | 1 | |
  152. | | | " | Register | ADDC A,Rn | 38-3F | 1 | 1 | |
  153. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  154. | AJMP | | | | | see | | | |
  155. | 2K in Page (11 bits) | Paddr<10:0> -> PC<10:0> | Prog Direct | | AJMP Paddr | note | 2 | 2 | - - - |
  156. | Absolute Jump | PC<15:11> -> PC<15:11> | | | | 2 | | | |
  157. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  158. | ANL | | | | | | | | |
  159. | Logical AND of Source | SOper ^ DOper -> DOper | Direct | Accumulator | ANL Daddr,A | 52 | 2 | 1 | - - - |
  160. | Operand with | | " | Immediate | ANL Daddr,#data | 53 | 3 | 2 | |
  161. | Destination Operand | | Accumulator | Immediate | ANL A,#data | 54 | 2 | 1 | |
  162. | | | " | Direct | ANL A,Daddr | 55 | 2 | 1 | |
  163. | | | " | Indirect | ANL A,@Ri | 56,57 | 1 | 1 | |
  164. | | | " | Register | ANL A,Rn | 58-5F | 1 | 1 | |
  165. | |-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  166. | Logical AND of Source | SOper ^ CF -> CF | Carry Flag | Bit Direct | ANL C,Baddr | 82 | 2 | 2 | * - - |
  167. | Operand with | | | | | | | | |
  168. | Carry Flag (Continued)| | | | | | | | |
  169. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  170. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  171. | | | DEST | SOURCE | ASSEMBLY |HEX |B |C | PSW |
  172. | MNEMONIC | OPERATION | ADDR | ADDR | LANGUAGE |OP- |Y |Y |C A O |
  173. | | | MODE | MODE | FORM |CODE |T |C |F C V |
  174. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  175. | ANL (Continued) | | | | | | | | |
  176. | Logical AND of Source | ~SOper ^ CF -> CF | Carry Flag | Bit Direct | ANL C,/Baddr | B0 | 2 | 2 | * - - |
  177. | Operand Complemented | | | | | | | | |
  178. | with Carry Flag | | | | | | | | |
  179. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  180. | CJNE | | | | | | | | |
  181. | Compare Operands and | Jump Relative to PC if | Accumulator | Immediate | CJNE A,#data,Roff | B4 | 3 | 2 | * - - |
  182. | Jump Relative if not | DOper <> SOper | " | Direct | CJNE A,Daddr,Roff | B5 | 3 | 2 | see |
  183. | Equal | | Indirect | Immediate | CJNE @Ri,#data,Roff | B6,B7 | 3 | 2 | note |
  184. | | | Register | " | CJNE Rn,#data,Roff | B8-BF | 3 | 2 | 3 |
  185. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  186. | CLR | | | | | | | | |
  187. | Clear Accumulator | 0 -> A | Accumulator | | CLR A | E4 | 1 | 1 | - - - |
  188. | |-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  189. | Clear Carry Flag | 0 -> CF | Carry Flag | | CLR C | C3 | 1 | 1 | 0 - - |
  190. | |-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  191. | Clear Bit Operand | 0 -> DOper | Bit Direct | | CLR Baddr | C2 | 2 | 1 | - - - |
  192. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  193. | CPL | | | | | | | | |
  194. | Complement Accumulator| ~A -> A | Accumulator | | CPL A | F4 | 1 | 1 | - - - |
  195. | |-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  196. | Complement Carry Flag | ~CF -> CF | Carry Flag | | CPL C | B3 | 1 | 1 | * - - |
  197. | |-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  198. | Complement Bit Operand| ~DOper -> DOper | Bit Direct | | CPL Baddr | B2 | 2 | 1 | - - - |
  199. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  200. | DA | | | | | | | | |
  201. | Decimal Adjust | If (A<3:0> > 9) v AC | Accumulator | | DA A | D4 | 1 | 1 | * - - |
  202. | Accumulator for | then A<3:0>+6 -> A<3:0>| | | | | | | see |
  203. | Addition | If (A<7:4> > 9) v CF | | | | | | | note |
  204. | | then A<7:4>+6 -> A<7:4>| | | | | | | 4 |
  205. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  206. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  207. | | | DEST | SOURCE | ASSEMBLY |HEX |B |C | PSW |
  208. | MNEMONIC | OPERATION | ADDR | ADDR | LANGUAGE |OP- |Y |Y |C A O |
  209. | | | MODE | MODE | FORM |CODE |T |C |F C V |
  210. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  211. | DEC | | | | | | | | |
  212. | Decrement Operand | DOper - 1 -> DOper | Accumulator | | DEC A | 14 | 1 | 1 | - - - |
  213. | | | Direct | | DEC Daddr | 15 | 2 | 1 | |
  214. | | | Indirect | | DEC @Ri | 16,17 | 1 | 1 | |
  215. | | | Register | | DEC Rn | 18-1F | 1 | 1 | |
  216. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  217. | DIV | | | | | | | | |
  218. | Divide Accumulator by | A / B -> A | AB | | DIV AB | 84 | 1 | 4 | 0 - * |
  219. | B Register | Remainder -> B | | | | | | | see |
  220. | | | | | | | | | note 5|
  221. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  222. | DJNZ | | | | | | | | |
  223. | Decrement Operand and | DOper - 1 -> DOper | Direct | | DJNZ Daddr,Roff | D5 | 3 | 2 | - - - |
  224. | Jump Relative if Not | If DOper <> 0 then Jump | Register | | DJNZ Rn,Roff | D8-DF | 2 | 2 | |
  225. | Zero | Relative to PC | | | | | | | |
  226. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  227. | INC | | | | | | | | |
  228. | Increment Operand | DOper + 1 -> DOper | Accumulator | | INC A | 04 | 1 | 1 | - - - |
  229. | | | Direct | | INC Daddr | 05 | 2 | 1 | |
  230. | | | Indirect | | INC @Ri | 06,07 | 1 | 1 | |
  231. | | | Register | | INC Rn | 08-0F | 1 | 1 | |
  232. | | | Data Pointer| | INC DPTR | A3 | 1 | 2 | |
  233. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  234. | JB | | | | | | | | |
  235. | Jump Relative if Bit | If DOper = 1 then Jump | Bit Direct | | JB Baddr,Roff | 20 | 3 | 2 | - - - |
  236. | Operand is Set | Relative to PC | | | | | | | |
  237. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  238. | JBC | | | | | | | | |
  239. | Jump Relative if Bit | If DOper = 1 then | Bit Direct | | JBC Baddr,Roff | 10 | 3 | 2 | * * * |
  240. | Operand is Set and | 0 -> DOper and Jump | | | | | | | see |
  241. | Clear Bit Operand | Relative to PC | | | | | | | note 6|
  242. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  243. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  244. | | | DEST | SOURCE | ASSEMBLY |HEX |B |C | PSW |
  245. | MNEMONIC | OPERATION | ADDR | ADDR | LANGUAGE |OP- |Y |Y |C A O |
  246. | | | MODE | MODE | FORM |CODE |T |C |F C V |
  247. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  248. | JC | | | | | | | | |
  249. | Jump Relative if | If CF = 1 then Jump | Carry Flag | | JC Roff | 40 | 2 | 2 | - - - |
  250. | Carry Flag is Set | Relative to PC | | | | | | | |
  251. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  252. | JMP | | | | | | | | |
  253. | Jump Indirect | DPTR<15:0> + A<7:0> | Prog Indir | | JMP @A+DPTR | 73 | 1 | 2 | - - - |
  254. | | -> PC<15:0> | | | | | | | |
  255. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  256. | JNB | | | | | | | | |
  257. | Jump Relative if Bit | If DOper = 0 then Jump | Bit Direct | | JNB Baddr,Roff | 30 | 3 | 2 | - - - |
  258. | Operand is Clear | Relative to PC | | | | | | | |
  259. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  260. | JNC | | | | | | | | |
  261. | Jump Relative if | If CF = 0 then Jump | Carry Flag | | JNC Roff | 50 | 2 | 2 | - - - |
  262. | Carry Flag is Clear | Relative to PC | | | | | | | |
  263. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  264. | JNZ | | | | | | | | |
  265. | Jump Relative if the | If A<7:0> <> 0 then | Accumulator | | JNZ Roff | 70 | 2 | 2 | - - - |
  266. | Accumulator is Not | Jump Relative to PC | | | | | | | |
  267. | Zero | | | | | | | | |
  268. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  269. | JZ | | | | | | | | |
  270. | Jump Relative if the | If A<7:0> = 0 then | Accumulator | | JZ Roff | 60 | 2 | 2 | - - - |
  271. | Accumulator is Zero | Jump Relative to PC | | | | | | | |
  272. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  273. | LCALL | | | | | | | | |
  274. | Long (16 bits) Call | PC + 3 -> STACK | Prog Direct | | LCALL Paddr | 12 | 3 | 2 | - - - |
  275. | | SP + 2 -> SP | | | | | | | |
  276. | | Paddr<15:0> -> PC<15:0> | | | | | | | |
  277. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  278. | LJMP | | | | | | | | |
  279. | Long (16 bits) | Paddr<15:0> -> PC<15:0> | Prog Direct | | LJMP Paddr | 02 | 3 | 2 | - - - |
  280. | Absolute Jump | | | | | | | | |
  281. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  282. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  283. | | | DEST | SOURCE | ASSEMBLY |HEX |B |C | PSW |
  284. | MNEMONIC | OPERATION | ADDR | ADDR | LANGUAGE |OP- |Y |Y |C A O |
  285. | | | MODE | MODE | FORM |CODE |T |C |F C V |
  286. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  287. | MOV | | | | | | | | |
  288. | Move Source Operand | SOper -> DOper | Accumulator | Immediate | MOV A,#data | 74 | 2 | 1 | - - - |
  289. | to Destination | | " | Direct | MOV A,Daddr | E5 | 2 | 1 | |
  290. | Operand | | " | Indirect | MOV A,@Ri | E6,E7 | 1 | 1 | |
  291. | | | " | Register | MOV A,Rn | E8-EF | 1 | 1 | |
  292. | | | Direct | Accumulator | MOV Daddr,A | F5 | 2 | 1 | |
  293. | | | " | Immediate | MOV Daddr,#data | 75 | 3 | 2 | |
  294. | | | " | Direct | MOV Daddr,Daddr | 85 | 3 | 2 | |
  295. | | | " | Indirect | MOV Daddr,@Ri | 86,87 | 2 | 2 | |
  296. | | | " | Register | MOV Daddr,Rn | 88-8F | 2 | 2 | |
  297. | | | Indirect | Accumulator | MOV @Ri,A | F6,F7 | 1 | 1 | |
  298. | | SOper -> DOper | " | Immediate | MOV @Ri,#data | 76,77 | 2 | 1 | |
  299. | | | " | Direct | MOV @Ri,Daddr | A6,A7 | 2 | 2 | |
  300. | | | Register | Accumulator | MOV Rn,A | F8-FF | 1 | 1 | |
  301. | | | " | Immediate | MOV Rn,#data | 78-7F | 2 | 1 | |
  302. | | | " | Direct | MOV Rn,Daddr | A8-AF | 2 | 2 | |
  303. | | | Data Pointer| Immediate | MOV DPTR,#data16 | 90 | 3 | 2 | |
  304. | |-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  305. | Move Carry Flag to Bit| CF -> DOper | Bit Direct | Carry Flag | MOV Baddr,C | 92 | 2 | 2 | - - - |
  306. | Destination Operand | | | | | | | | |
  307. | |-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  308. | Move Bit Destination | DOper -> CF | Carry Flag | Bit Direct | MOV C,Baddr | A2 | 2 | 1 | * - - |
  309. | Operand to Carry Flag | | | | | | | | |
  310. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  311. | MOVC | | | | | | | | |
  312. | Move byte from | PM(DPTR<15:0> + A<7:0>) | Accumulator | Prog Ind | MOVC A,@A+DPTR | 93 | 1 | 2 | - - - |
  313. | Program Memory to | -> A<7:0> | | | | | | | |
  314. | |-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  315. | | PM(PC<15:0> + A<7:0>) | Accumulator | Prog Ind | MOVC A,@A+PC | 83 | 1 | 2 | - - - |
  316. | | -> A<7:0> | | | | | | | |
  317. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  318. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  319. | | | DEST | SOURCE | ASSEMBLY |HEX |B |C | PSW |
  320. | MNEMONIC | OPERATION | ADDR | ADDR | LANGUAGE |OP- |Y |Y |C A O |
  321. | | | MODE | MODE | FORM |CODE |T |C |F C V |
  322. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  323. | MOVX | | | | | | | | |
  324. | Move byte from | SOper -> A | Accumulator | Indirect | MOVX A,@Ri | E2,E3 | 1 | 2 | - - - |
  325. | External Data Memory | | " | " | MOVX A,@DPTR | E0 | 1 | 2 | |
  326. | to the Accumulator | | | | | | | | |
  327. | |-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  328. | Move byte in the | A -> DOper | Indirect | Accumulator | MOVX @Ri,A | F2,F3 | 1 | 2 | - - - |
  329. | Accumulator to | | " | " | MOVX @DPTR,A | F0 | 1 | 2 | |
  330. | External Data Memory | | | | | | | | |
  331. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  332. | MUL | | | | | | | | |
  333. | Multiply Accumulator | A X B -> B,A | AB | | MUL AB | A4 | 1 | 4 | 0 - * |
  334. | by B Register | (see note 7) | | | | | | | |
  335. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  336. | NOP | | | | | | | | |
  337. | No Operation | | | | NOP | 00 | 1 | 1 | - - - |
  338. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  339. | ORL | | | | | | | | |
  340. | Logical Inclusive OR | SOper v DOper -> DOper | Direct | Accumulator | ORL Daddr,A | 42 | 2 | 1 | - - - |
  341. | of Source Operand | | " | Immediate | ORL Daddr,#data | 43 | 3 | 2 | |
  342. | with Destination | | Accumulator | Immediate | ORL A,#data | 44 | 2 | 1 | |
  343. | Operand | | " | Direct | ORL A,Daddr | 45 | 2 | 1 | |
  344. | | | " | Indirect | ORL A,@Ri | 46,47 | 1 | 1 | |
  345. | | | " | Register | ORL A,Rn | 48-4F | 1 | 1 | |
  346. | |-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  347. | Logical Inclusive OR | SOper v CF -> CF | Carry Flag | Bit Direct | ORL C,Baddr | 72 | 2 | 2 | * - - |
  348. | of Source Operand | | | | | | | | |
  349. | with Carry Flag | | | | | | | | |
  350. | (continued) | | | | | | | | |
  351. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  352. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  353. | | | DEST | SOURCE | ASSEMBLY |HEX |B |C | PSW |
  354. | MNEMONIC | OPERATION | ADDR | ADDR | LANGUAGE |OP- |Y |Y |C A O |
  355. | | | MODE | MODE | FORM |CODE |T |C |F C V |
  356. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  357. | ORL(continued) | | | | | | | | |
  358. | Logical Inclusive OR | ~SOper v CF -> CF | Carry Flag | Bit Direct | ORL C,/Baddr | A0 | 2 | 2 | * - - |
  359. | of Source Operand | | | | | | | | |
  360. | Complemented with | | | | | | | | |
  361. | Carry Flag | | | | | | | | |
  362. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  363. | POP | | | | | | | | |
  364. | Pop Stack and Place | STACK -> DOper | Direct | Stack | POP Daddr | D0 | 2 | 2 | - - - |
  365. | in Destination Operand| SP - 1 -> SP | | | | | | | |
  366. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  367. | PUSH | | | | | | | | |
  368. | Push Source Operand | SP + 1 -> SP | Stack | Direct | PUSH Daddr | C0 | 2 | 2 | - - - |
  369. | onto Stack | SOper -> STACK | | | | | | | |
  370. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  371. | RET | | | | | | | | |
  372. | Return from | STACK -> PC<15:8> | | | RET | 22 | 1 | 2 | - - - |
  373. | Subroutine | SP - 1 -> SP | | | | | | | |
  374. | | STACK -> PC<7:0> | | | | | | | |
  375. | | SP - 1 -> SP | | | | | | | |
  376. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  377. | RETI | | | | | | | | |
  378. | Return from | STACK -> PC<15:8> | | | RETI | 32 | 1 | 2 | - - - |
  379. | Interrupt Routine | SP - 1 -> SP | | | | | | | |
  380. | | STACK -> PC<7:0> | | | | | | | |
  381. | | SP - 1 -> SP | | | | | | | |
  382. | | 0 -> Intrupt Active Flag| | | | | | | |
  383. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  384. | RL | | | | | | | | |
  385. | Rotate Accumulator | A<6:0> -> A<7:1> | Accumulator | | RL A | 23 | 1 | 1 | - - - |
  386. | Left One Bit | A<7> -> A<0> | | | | | | | |
  387. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  388. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  389. | | | DEST | SOURCE | ASSEMBLY |HEX |B |C | PSW |
  390. | MNEMONIC | OPERATION | ADDR | ADDR | LANGUAGE |OP- |Y |Y |C A O |
  391. | | | MODE | MODE | FORM |CODE |T |C |F C V |
  392. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  393. | RLC | | | | | | | | |
  394. | Rotate Accumulator | A<6:0> -> A<7:1> | Accumulator | | RLC A | 33 | 1 | 1 | * - - |
  395. | Left One Bit Thru | CF -> A<0> | | | | | | | |
  396. | the Carry Flag | A<7> -> CF | | | | | | | |
  397. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  398. | RR | | | | | | | | |
  399. | Rotate Accumulator | A<7:1> -> A<6:0> | Accumulator | | RR A | 03 | 1 | 1 | - - - |
  400. | Right One Bit | A<0> -> A<7> | | | | | | | |
  401. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  402. | RRC | | | | | | | | |
  403. | Rotate Accumulator | A<7:1> -> A<6:0> | Accumulator | | RRC A | 13 | 1 | 1 | * - - |
  404. | Right One Bit Thru | CF -> A<7> | | | | | | | |
  405. | the Carry Flag | A<0> -> CF | | | | | | | |
  406. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  407. | SETB | | | | | | | | |
  408. | Set Bit Operand | 1 -> CF | Carry Flag | | SETB C | D3 | 1 | 1 | 1 - - |
  409. | |-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  410. | | 1 -> DOper | Bit Direct | | SETB Baddr | D2 | 2 | 1 | - - - |
  411. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  412. | SJMP | | | | | | | | |
  413. | Short (8 bits) | Jump Relative to PC | | | SJMP Roff | 80 | 2 | 2 | - - - |
  414. | Relative Jump | | | | | | | | |
  415. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  416. | SUBB | | | | | | | | |
  417. | Subtract Operand with | A - SOper - CF -> A | Accumulator | Immediate | SUBB A,#data | 94 | 2 | 1 | * * * |
  418. | Borrow from the | | " | Direct | SUBB A,Daddr | 95 | 2 | 1 | |
  419. | Accumulator | | " | Indirect | SUBB A,@Ri | 96,97 | 1 | 1 | |
  420. | | | " | Register | SUBB A,Rn | 98-9F | 1 | 1 | |
  421. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  422. | SWAP | | | | | | | | |
  423. | Swap Nibbles within | A<7:4> -> A<3:0> | Accumulator | | SWAP A | C4 | 1 | 1 | - - - |
  424. | the Accumulator | A<3:0> -> A<7:4> | | | | | | | |
  425. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  426. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  427. | | | DEST | SOURCE | ASSEMBLY |HEX |B |C | PSW |
  428. | MNEMONIC | OPERATION | ADDR | ADDR | LANGUAGE |OP- |Y |Y |C A O |
  429. | | | MODE | MODE | FORM |CODE |T |C |F C V |
  430. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  431. | XCH | | | | | | | | |
  432. | Exchange bytes of the | SOper<7:0> -> A<7:0> | Accumulator | Direct | XCH A,Daddr | C5 | 2 | 1 | - - - |
  433. | Accumulator and the | A<7:0> -> SOper<7:0> | " | Indirect | XCH A,@Ri | C6,C7 | 1 | 1 | |
  434. | Source Operand | | " | Register | XCH A,Rn | C8-CF | 1 | 1 | |
  435. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  436. | XCHD | | | | | | | | |
  437. | Exchange the Least | SOper<3:0> -> A<3:0> | Accumulator | Indirect | XCHD A,@Ri | D6,D7 | 1 | 1 | - - - |
  438. | Significant Nibble of | A<3:0> -> SOper<3:0> | | | | | | | |
  439. | the Accumulator and | | | | | | | | |
  440. | the Source Operand | | | | | | | | |
  441. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  442. | XRL | | | | | | | | |
  443. | Logical Exclusive OR | SOper v DOper -> DOper | Direct | Accumulator | XRL Daddr,A | 62 | 2 | 1 | - - - |
  444. | of Source Operand | | " | Immediate | XRL Daddr,#data | 63 | 3 | 2 | |
  445. | with Destination | | Accumulator | Immediate | XRL A,#data | 64 | 2 | 1 | |
  446. | Operand | | " | Direct | XRL A,Daddr | 65 | 2 | 1 | |
  447. | | | " | Indirect | XRL A,@Ri | 66,67 | 1 | 1 | |
  448. | | | " | Register | XRL A,Rn | 68-6F | 1 | 1 | |
  449. |------------------------|-------------------------|-------------|-------------|------------------------|-------|---|---|-------|
  450. BMULB BYTE SIGNED MULTIPLY JUL-30-84 PAGE 1
  451. 1 ;
  452. 2 ; 8-bit by 8-bit signed multiply--byte signed multiply
  453. 3 ;
  454. 4 ; This routine takes the signed byte in multiplicand and
  455. 5 ; multiplies it by the signed byte in multiplier and places
  456. 6 ; the signed 16-bit product in product_high and product_low.
  457. 7 ;
  458. 8 ; This routine assumes 2s complement representation of signed
  459. 9 ; numbers. The maximum numbers possible is then -128 and +127.
  460. 10 ; Multiplying the possible maximum numbers together easily fits
  461. 11 ; in a 16-bit product, so no overflow test is done on the answer.
  462. 12 ;
  463. 13 ; Registers altered by routine: A, B, PSW.
  464. 14 ;
  465. 15 ;
  466. 16 ; Primary controls
  467. 17 $MOD51
  468. 18 $TITLE(BYTE SIGNED MULTIPLY)
  469. 19 $DATE(JUL-30-84)
  470. 20 $PAGEWIDTH(132)
  471. 21 $OBJECT(B:BMULB.OBJ)
  472. 22 ;
  473. 23 ;
  474. 24 ; Variable declarations
  475. 25 ;
  476. 00F0 26 sign_flag BIT 0F0H ;sign of product
  477. 0030 27 multiplier DATA 030H ;8-bit multiplier
  478. 0031 28 multiplicand DATA 031H ;8-bit multiplicand
  479. 0032 29 product_high DATA 032H ;high byte of 16-bit answer
  480. 0033 30 product_low DATA 033H ;low byte of answer
  481. 31 ;
  482. 32 ;
  483. 33 ;
  484. 0100 34 ORG 100H ;arbitrary start
  485. 35 ;
  486. 0100 36 byte_signed_multiply:
  487. 0100 C2F0 37 CLR sign_flag ;reset sign
  488. 0102 E530 38 MOV A,multiplier ;put multiplier in accumulator
  489. 0104 30E704 39 JNB ACC.7,positive ;test sign bit of multiplier
  490. 0107 F4 40 CPL A ;negative--complement and
  491. BMULB BYTE SIGNED MULTIPLY JUL-30-84 PAGE 2
  492. 0108 04 41 INC A ;add 1 to convert to positive
  493. 0109 D2F0 42 SETB sign_flag ;and set sign flag
  494. 43 ;
  495. 010B 8531F0 44 positive: MOV B,multiplicand ;put multiplicand in B register
  496. 010E 30F707 45 JNB B.7,multiply ;test sign bit of multiplicand
  497. 0111 63F0FF 46 XRL B,#0FFh ;negative--complement and
  498. 0114 05F0 47 INC B ;add 1 to convert to positive
  499. 0116 B2F0 48 CPL sign_flag ;complement sign flag
  500. 49 ;
  501. 0118 A4 50 multiply: MUL AB ;do unsigned multiplication
  502. 51 ;
  503. 0119 30F00A 52 sign_test: JNB sign_flag,byte_signed_exit ;if positive,done
  504. 011C 63F0FF 53 XRL B,#0FFh ;else have to complement both
  505. 011F F4 54 CPL A ;bytes of the product and inc
  506. 0120 2401 55 ADD A,#1 ;need add here because inc doesn't set
  507. 0122 5002 56 JNC byte_signed_exit ;the carry flag
  508. 0124 05F0 57 INC B ;if add overflowed A, inc the high byte
  509. 58 ;
  510. 0126 59 byte_signed_exit:
  511. 0126 85F032 60 MOV product_high,B ;save the answer
  512. 0129 F533 61 MOV product_low,A
  513. 62 ;
  514. 012B 22 63 RET ;and return
  515. 64 END
  516. ASSEMBLY COMPLETE, 0 ERRORS FOUND
  517. BMULB BYTE SIGNED MULTIPLY JUL-30-84 PAGE 3
  518. ACC D ADDR 00E0H PREDEFINED
  519. B D ADDR 00F0H PREDEFINED
  520. BYTE_SIGNED_EXIT C ADDR 0126H
  521. BYTE_SIGNED_MULTIPLY C ADDR 0100H NOT USED
  522. MULTIPLICAND D ADDR 0031H
  523. MULTIPLIER D ADDR 0030H
  524. MULTIPLY C ADDR 0118H
  525. POSITIVE C ADDR 010BH
  526. PRODUCT_HIGH D ADDR 0032H
  527. PRODUCT_LOW D ADDR 0033H
  528. SIGN_FLAG B ADDR 00F0H
  529. SIGN_TEST C ADDR 0119H NOT USED