home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / ASSEMBLE.ZIP / ASSEMBLE.DOC < prev   
Encoding:
Text File  |  1985-09-15  |  25.6 KB  |  727 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.                                 TABLE OF CONTENTS
  23.  
  24.                  Description ..................2
  25.  
  26.                  Syntax .......................2
  27.  
  28.                    Labels .....................3
  29.  
  30.                    Opcodes ....................3
  31.  
  32.                    Operands ...................4
  33.  
  34.                    Pseudo ops .................5
  35.  
  36.                 Error Messages ................6
  37.  
  38.                 Source code ...................6
  39.  
  40.                 Disclamer .....................7
  41.  
  42.                 Op code table .................8
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                 1
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.                            DESCRIPTION
  74.       ASSEMBLE.COM is a two pass assembler written in Turbo
  75. Pascal. It was written because I was a new owner of an IBM PCjr
  76. with little software and I was not aware of any public domain
  77. assemblers that had reasonable performance. Additionaly I had
  78. reciently purchased Turbo Pascal from Borland International and
  79. wanted a project to help me learn Pascal.
  80.  
  81.      ASSEMBLE.COM  is  a  simple assembler  for  Intel  8088/8086
  82. instruction set. It closely follows the syntax of the instruction
  83. set described in THE 8806 BOOK by Russel Rector and George Alexy.
  84. It is also patterened after CHASM.BAS version 1.9 written in
  85. basic by David Whitman of Whitman Software (there have been
  86. numerious changes to avoid copywrite violations). It is not a
  87. macro assembler and therefore recognizes only a few pseudo op
  88. codes. Listed later in this documemtation is a complete list of
  89. op codes and pseudo ops recognized by ASSEMBLE.COM.
  90.  
  91.      The input requirememts to ASSEMBLE.COM are ordinary DOS
  92. files which can be created with most text editors. The output
  93. will be a listing sent to the screen, printer or a disk file and
  94. a .COM file. This assembler was designed to creat executeable
  95. code or subroutines used in BASIC or Turbo Pascal programs. It
  96. will not generate code that can be linked to other other
  97. programs. See your BASIC or TURBO instruction manuals for
  98. includeing executable code in your programs. Since this assembler
  99. is intended for small projects you will probably find bypassing
  100. the Link and conversion from .EXE to .COM files is a convience.
  101. If you intend to write large software projects, I recomend you
  102. get a macro assembler such as IBM's or CHASM version 4.0 (also
  103. written in Turbo Pascal). Speaking of size, since both the input
  104. file and output file(s) are on the disc the only limitations to
  105. the size of your program is the disk space, number of labels you
  106. use and your endurance. Labels and their memory address are
  107. stored on the first pass in ASSEMBLE.COM's area for dynamic
  108. variables. This area uses all avaliable memory above the program
  109. area therefore even on a 64K byte system you should have plenty
  110. room for several hundred labels. My goal is to keep this program
  111. under 35K bytes so it can be run on small systems.
  112.  
  113.                              SYNTAX
  114.      Each line of source code begins with a label or blank space
  115. followed by the op code (8088 instruction or pseudo op) and then
  116. the operand(s) (if required by the opcode). The source code may be
  117. followed with a semi colon (;) and any commemts for that line.
  118. Optionaly a line may be only comments if it starts with a semi
  119. colon. A blank space must preceed and follow the op code field.
  120. For readability I recomemd one or more spaces between the label
  121. and the op code and between the op code and the operand. A comma
  122. must be used to seperate operands.
  123.  
  124.  
  125.  
  126.  
  127.                                 2
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. EXAMPLE:
  137.  
  138. 1stLabel mov  ax,90H    ;format example
  139.  
  140. Labels:
  141.      Although labels may be longer only the first 7 letters of
  142. the label are stored for future reference therefore any labels
  143. with the first seven characters the same will cause a duplicate
  144. label error. Also since the line parsing routine converts all
  145. source code not in single quotes to upper case prior to decodeing
  146. the line, you can not use upper and lower case to distinguish
  147. labels. For example LongLabel1 and longlabel2 are both stored as
  148. LONGLAB therefore would cause an duplicate label error. If you
  149. are going to use numbers to distinguish labels I suggest you use
  150. them at the beginning of a label such as 2LongLabel.
  151.  
  152. Op Codes:
  153.      All of the op codes specified in THE 8086 BOOK are supported
  154. however in order to resolve some ambiguous op codes the syntax
  155. was modified. The first ambiguous opcode is JMP which can be
  156. either a 8 or 16 bit displacement jump. Eight bit displacement
  157. jumps are resolved by specifying JMPS for short jump. Jumps
  158. useing mem/reg (indirect) addressing for their destination must
  159. specify Near or Far to indicate a jump within the current CS or
  160. an intersegment jump. These jumps are coded as JMPN or JMPF. This
  161. same logic is used for CALLN and CALLF when useing the mem/reg
  162. addressing mode. The other major area of ambiguity comes from
  163. useing op codes that do not specify a register as either the
  164. destination or source. This assembler requires you to append the
  165. op code with a B or W to distinguish between bytes and words ie.
  166. MOVSB for move a string of bytes or MOVW [bx],8 to load 8 into
  167. the word address pointed to by BX.
  168.  
  169.      Normally all data moves are assumed to be relative to the DS
  170. (data segment) register. This default can be over ridden one
  171. instruction at a time by useing the SEG op code in the line prior
  172. to the desired over ride.
  173. EXAMPLE:
  174.            SEG   ES
  175.            MOV   AX,[BX]
  176. This moves a word into the accumulator from the address in the
  177. extra segment offset by the bx register. This is a little used
  178. function since ASSEMBL assumes all of the segment registers are
  179. set to the same location as is required for the start of a .COM
  180. program. Access of system resources should be done with BIO or
  181. DOS calls when possible rather than going directly to a hardware
  182. memory location outside your program.
  183.  
  184.      The opcode table lists the avaliable opcodes and pseudo ops
  185. and the various addressing modes associated with each. Please
  186. note that the mem/reg addressing mode includes several sub modes
  187. such as base relative (useing BX as an offset), stack relative
  188. (useing BP as an offset), and indexed (useing the SI or DI). See
  189. the 8086 BOOK for an explination of each mode.
  190.  
  191.  
  192.  
  193.                                 3
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203. Operands:
  204.      The operands describe to the assembler the destination and
  205. source of the data to be operated on. The 8088 uses a number of
  206. addressing modes to determine where that data is and should go.
  207. You will discover by looking at the op code table, not all modes
  208. can be used with an individual op code. Addressing modes are :
  209.  
  210.   Accumulator - data is transfered to/from the accumulator.
  211.   Displacement - the displacement value is added to the present IP.
  212.   Immediate - data is assembled into the instruction.
  213.   Memory/Reg - data is transfered to/from address pointed to
  214.                by [mem] or [reg].
  215.   Register - data is transfered to/from the register.
  216.  
  217. Accumulator: The accumulator(s) are AX or AL and AH where AX is a
  218. 16 bit accumulator, AL is the lower 8 bits of AX and AH is the
  219. higher 8 bits.
  220.  
  221. Displacement: A displacement value to be added to the instruction
  222. pointer (IP) is included as immediate data in the opcode. The
  223. assembler calculates the amount of displacement based on the
  224. location of the opcode and then location of the address in the
  225. operand. The address in the operand can be expressed as a number
  226. (binary,hex or decimal) but is most commonly expressed as a
  227. label. EXAMPLE:
  228.  
  229. LABEL MOV AX,[BX]
  230.       CMP AX,10H
  231.       JLE LABEL
  232.  
  233. With this example the assembler calculates a negative
  234. displacement to jump back to LABEL when then value in AX is less
  235. than or equal 10H.
  236.  
  237. Immediate: All immediate data is assembled into the instruction
  238. code. This data can be represented in two ways. First immediate
  239. data can be presented in binary, decimal or hexidecimal format in
  240. a signed range of -32768 to 32767 (8000H to 7FFFH) or if the sign
  241. bit is not used, 0 to 65535 (0000H to FFFFH). As in these
  242. examples a 'H' is appended to the number to indicate hexidecimal.
  243. Binary numbers are expressed as a series of up to 16 ones and
  244. zeros followed by a B, ie 11010B represents 26. The other method
  245. of representing immediate data is with labels. The value of the
  246. label is the address at which the label was used or the value
  247. assigned to the label in an EQU pseudo op. When useing labels in
  248. the operand for data access the assembler assumes you are
  249. reffering to the data in the refferenced address. If you want to
  250. load the value of the address itself then the modifier OFFSET(..)
  251. must be used.
  252. EXAMPLE:
  253.  
  254.      MOV BX,LABEL         ;Load BX with the value at address Label
  255.      MOV BX,OFFSET(LABEL) ;Load BX with the address of Label
  256.  
  257.  
  258.  
  259.                                 4
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. Some math is supported when useing immediate data however the
  269. number parser is very simple therefore the format is restricted.
  270. Only one math operator is  permited between numbers (-3*4 is ok
  271. but 4*-3 gives an error). Parseing is done from left to right
  272. with no presience set for the math operator (+ or * are
  273. interpeted when recieved in the input string verses the usual of
  274. interperting multiplication and division before addition and
  275. subtraction).
  276.  
  277. Memory/register: This addressing mode is also called indirect
  278. addressing. The operand is used to point to a memory location
  279. that contains the data rather than the instruction containing the
  280. data as in the immediate addressing mode. The operand can be a
  281. memory location expressed as a label, decimal number or a
  282. hexidecimal number or it can be a memory location pointed to by a
  283. register. The following indirect modes are allowed:
  284.       MOV Reg,[BP]
  285.       MOV [BX],Reg
  286.       MOV [BX+SI],Reg  ;BX plus SI displacement equal location
  287.       MOV Reg,[BX+DI]  ;BX plus DI       "        "      "
  288.       MOV Reg,[BP+SI]  ;BP plus SI       "        "      "
  289.       MOV [BP+DI],Reg  ;BP plus SI       "        "      "
  290.       MOV [DI],Reg
  291.       MOV Reg,[SI]
  292.       MOV LABEL,Reg
  293. Any of the general purpose registers can be used in place of Reg
  294. in these examples. Immediate data may also be substituted for a
  295. register however then the opcode most be appended with W or B so
  296. the assembler knows if you are pointing to a word or byte
  297. address. In addition to the above when an indirect address useing
  298. a register is chosen a displacement may also be used.
  299. EXAMPLE:
  300.  
  301.       MOV Reg,10H[BP]     ;Source address equal BP+10H
  302.       MOV Reg,-5[BP+SI]   ;Source address equal BP+SI-5
  303. DEMO  EQU FFH
  304.       MOV DEMO[BX+DI],Reg ;Destination address equal BX+DI+255
  305.  
  306. Register: In this addressing mode the data is contained in or is
  307. to be stored in one of the 8088 registers. The  registers are AX
  308. (AL+AH), BX (BL+BH), CX (CL+CH), DX (DL+DH), BP, DI, SI  and the
  309. four segment registers CS, DS, ES, SS. All math operations use
  310. the accumulator (AX, AL or AH) plus the MUL and DIV use the DX
  311. register when 32 bit numbers are involved. The BX and BP
  312. registers can be used as base pointers in the Data or Stack
  313. segments respectively. The CX register can be used for a
  314. automatic counter for some instructions. As demonstrated in
  315. earlier examples the SI and DI registers can be used as indexing
  316. registers. Any of the numerious assembly language books for the
  317. IBM PC or PCjr will give you an explination of each of the
  318. processor registers and their uses.
  319.  
  320.                          PSEUDO OPCODES
  321.      Pseudo opcodes are assembler directives that control the
  322. generation of the object code. The avaliable pseudo ops are DB,
  323.  
  324.  
  325.                                 5
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. DS, DW, ENDP, EQU, ORG and PROC.
  335.   DB = define byte and has operands of one or more bytes and/or
  336.        a string ( DB 20H,'Demo' ). Strings are set off by single
  337.        quotes. Numbers are less than 256 and expressed in binary,
  338.        decimal or hexidecimal.
  339.   DS = define segment and initializes a string of memory
  340.        locations. The first operand defines the number of bytes to
  341.        be initialized. If included the second operand defines the
  342.        value the memory is to be initialized to. The default value
  343.        is zero. ( DS 20,FFH ;initialize 20 bytes to 255).
  344.   DW = define word and its operand(s) must be numeric or a
  345.        label. With DW the low order byte is stored first in memory
  346.        as this is the format used by the 8088 for integer storage
  347.        (ie: dw 1020H = db 20H,10H).
  348.   EQU= define the value of a label. All label definitions must
  349.        occur at the beginning of your program or errors may occur
  350.        in the assembly process. The most common error message
  351.        recieved from defining a label late in the program is 'PHASE
  352.        ERROR'. A phase error indicates the assembler generated a
  353.        address for a label on the second pass different from that
  354.        of the  first pass.
  355.   ORG= reset the location counter to new orgin. Since all .COM
  356.        programs start at 100H the default setting for ASSEMBLE.COM
  357.        is 100H however you may have a need to start at 00H for a
  358.        driver routine or a machine language routine for BASIC.
  359.   PROC and ENDP are used together to define a program or procedure
  360.        as Near or Far. This information is used to determine the
  361.        type of return to be generated when a RET is encountered.
  362.        If no procedure is defined a Near procedure is assumed. The
  363.        syntax is:
  364.        PROC NEAR ;Proc must be followed by Near or Far
  365.        ....
  366.        ....
  367.        ENDP
  368.        If PROC is used an ENDP must be used.
  369.  
  370.  
  371.                          ERROR MESSAGES
  372.      All error messages and diagnostics are printed immediately
  373. before the line in which the error occurs. The total number of
  374. error and diagnostic messages will be displayed at the end of the
  375. source code print out immediately prior to the symbol table dump.
  376.      I have made an attempt to make error messages as user
  377. friendly as possible. The most criptic of the error messages is
  378. the series you recieve when there is a syntax error. This message
  379. will be the opcode and ASSEMBLE.COM's interpetation of the type
  380. of data included in the operands.
  381. EXAMPLE:
  382. *** Syntax Error: MOV (16 bit immediate or 8 bit immediate), (none)
  383.  
  384. This message would appear immediate before a line of code
  385. containing the instruction MOV 45H. By reviewing the type of data
  386. and the allowable operands for each instruction you should be
  387. able to locate the error.
  388.      'Phase Error' is most commonly caused by referenceing an
  389.  
  390.  
  391.                                 6
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. equate before defineing it. I strongly recomend you only use the
  401. EQU pseudo op at the beginning of your source code. This pratice
  402. should prevent this error and will make your source code more
  403. easier to read.
  404.      'Error: EQU without symbol' is recieved when you use the equate
  405. pseudo-op without a label.
  406.      'Error: EQU with forward refference' is recieved if you
  407. attempt to use a forward refference when equating a label.
  408.      'Error: ENDP without PROC'. You must specify where the
  409. procedure begins.
  410.      'Error: Missing ENDP'. You must specify where the procedure
  411. ends if PROC is used.
  412.      'Error: Procedures nested too deeply'. Only 10 levels of
  413. nesting are allowed.
  414.      'Error: Duplicate label'. See section on labels.
  415.      'Error: Data too long' indicates use of a byte operand where
  416. the data is out of the range of 0 to 255.
  417.      'Error: Too far for short jump' indicates an attempt to jump
  418. further than +or- 127 bytes.
  419.      'Error: Undefined Symbol' plus the operand being interpeted
  420. is displayed when no match is found in the symbol table.
  421. Frequently caused by bad syntax in the operand.
  422.      'Error: Illegal or undefined argument for OFFSET' is simular
  423. to 'Undefined Symbol'
  424.  
  425.      Two diagnostic messages may be given. The first follows a
  426. syntax error and is 'Specify word or byte operand' if the
  427. assembler could not determine which to use. The opcode must be
  428. corrected by appending a B or W to it. The other message is just
  429. a notice that you used a long jump where you could have used a
  430. short jump and saved a byte of object code.
  431.  
  432.                            SOURCE CODE
  433.      Turbo Pascal source code for this assembler is avaliable for
  434. those who wish to customize it for their own needs (or those who
  435. would like to see what makes it tick). If you would like a copy
  436. of the source code send a formated disk and $10 to
  437.                          George Fulford
  438.                          RR 1 Box 163c
  439.                          Shellsburg Ia 52332
  440. Although I have no intentions of entering the software market at
  441. this time I do plan to make corrections to this program as the
  442. bugs are found. If you obtain a copy of the source code from me
  443. it will be the most up to date version.
  444.  
  445.                        WARRENTY/GUARANTEE
  446.      There is NONE.
  447.      This assembler runs on my PCjr and since I used all standard
  448. Turbo Pascal it should run on any PC DOS machine. If it does not
  449. I probably won't be able to help you.
  450.  
  451. I have spent quite a bit of time debuging but I am sure there are
  452. still a few bugs lurking in the code. I will attempt to stamp out
  453. any reported.
  454.  
  455.  
  456.  
  457.                                 7
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.                           OP CODE TABLE
  468.      addressing modes supported  (b/w = must specify byte or word)
  469.      A = acumulator reg(ax, ah, al)
  470.      b/w = must add B or W to opcode for this addressing mode
  471.      D = displacememt (8 or 16 bit as required by the instruction)
  472.      I = immediate (byte for 8 bit registers, word for 16 bit reg)
  473.      M/R = memory or register (indirect addressing)
  474.      N = none
  475.      R = register(bx, cx, dx, bp, si, di)
  476.      S = segment register (cs, ds, es, ss)
  477.  Op                   Operand
  478. types
  479.   dest.  N | A |  A  | R | R | M/R |  R  | M/R | I | I | D | M/R
  480.   source N | I | M/R | I | N |  R  | M/R |  I  | I | N | N |  N
  481. AAA      x |   |     |   |   |     |     |     |   |   |   |
  482. AAD      x |   |     |   |   |     |     |     |   |   |   |
  483. AAM      x |   |     |   |   |     |     |     |   |   |   |
  484. AAS      x |   |     |   |   |     |     |     |   |   |   |
  485. ADC        | x |     | x |   |  x  |  x  | b/w |   |   |   |
  486.  
  487. AND        | x |     | x |   |  x  |  x  | b/w |   |   |   |
  488. CALL       |   |     |   |   |     |     |     | x |   | x |
  489. CALLF      |   |     |   |   |     |     |     |   |   |   |  x
  490. CALLN      |   |     |   |   |     |     |     |   |   |   |  x
  491. CBW      x |   |     |   |   |     |     |     |   |   |   |
  492.  
  493. CLC      x |   |     |   |   |     |     |     |   |   |   |
  494. CLD      x |   |     |   |   |     |     |     |   |   |   |
  495. CLI      x |   |     |   |   |     |     |     |   |   |   |
  496. CMC      x |   |     |   |   |     |     |     |   |   |   |
  497. CMP        | x |     | x |   |  x  |  x  | b/w |   |   |   |
  498.  
  499. CMPS   b/w |   |     |   |   |     |     |     |   |   |   |
  500. CWD      x |   |     |   |   |     |     |     |   |   |   |
  501. DAA      x |   |     |   |   |     |     |     |   |   |   |
  502. DAS      x |   |     |   |   |     |     |     |   |   |   |
  503. DB         |   |     |   |   |     |     |     | x | x |   |
  504.  
  505. DEC        |   |     |   | x |     |     |     |   |   |   | b/w
  506. DIV        |   |  x  |   |   |     |     |     |   |   |   |
  507. DS         |   |     |   |   |     |     |     | x | x |   |
  508. DW         |   |     |   |   |     |     |     | x | x |   |
  509. ENDP     x |   |     |   |   |     |     |     |   |   |   |
  510.  
  511. EQU        |   |     |   |   |     |     |     |   | x |   | memory
  512. HLT      x |   |     |   |   |     |     |     |   |   |   |
  513. IDIV       |   |  x  |   |   |     |     |     |   |   |   |
  514. IMUL       |   |  x  |   |   |     |     |     |   |   |   |
  515. IN         | x |note1|   |   |     |     |     |   |   |   |
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.                                 8
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  Op                   Operand
  533. types
  534.   dest.  N | A |  A  | R | R | M/R |  R  | M/R | I | I | D | M/R
  535.   source N | I | M/R | I | N |  R  | M/R |  I  | I | N | N |  N
  536. INC        |   |     |   | x |     |     |     |   |   |   | b/w
  537. INT      x |   |     |   |   |     |     |     |   | x |   |
  538. INTO     x |   |     |   |   |     |     |     |   |   |   |
  539. IRET     x |   |     |   |   |     |     |     |   |   |   |
  540. JA         |   |     |   |   |     |     |     |   |   | x |
  541.  
  542. JAE        |   |     |   |   |     |     |     |   |   | x |
  543. JB         |   |     |   |   |     |     |     |   |   | x |
  544. JBE        |   |     |   |   |     |     |     |   |   | x |
  545. JCXZ       |   |     |   |   |     |     |     |   |   | x |
  546. JE         |   |     |   |   |     |     |     |   |   | x |
  547.  
  548. JG         |   |     |   |   |     |     |     |   |   | x |
  549. JGE        |   |     |   |   |     |     |     |   |   | x |
  550. JL         |   |     |   |   |     |     |     |   |   | x |
  551. JLE        |   |     |   |   |     |     |     |   |   | x |
  552. JMP        |   |     |   |   |     |     |     |   |   | x |
  553.  
  554. JMPF       |   |     |   |   |     |     |     |   |   | x |
  555. JMPN       |   |     |   |   |     |     |     |   |   | x |
  556. JMPS       |   |     |   |   |     |     |     |   |   | x |
  557. JNE        |   |     |   |   |     |     |     |   |   | x |
  558. JNO        |   |     |   |   |     |     |     |   |   | x |
  559.  
  560. JNP        |   |     |   |   |     |     |     |   |   | x |
  561. JNS        |   |     |   |   |     |     |     |   |   | x |
  562. JNZ        |   |     |   |   |     |     |     |   |   | x |
  563. JO         |   |     |   |   |     |     |     |   |   | x |
  564. JP         |   |     |   |   |     |     |     |   |   | x |
  565.  
  566. JPE        |   |     |   |   |     |     |     |   |   | x |
  567. JPO        |   |     |   |   |     |     |     |   |   | x |
  568. JS         |   |     |   |   |     |     |     |   |   | x |
  569. JZ         |   |     |   |   |     |     |     |   |   | x |
  570. LAHF     x |   |     |   |   |     |     |     |   |   |   |
  571.  
  572. LDS        |   |     |   |   |     |note2|     |   |   |   |
  573. LEA        |   |     |   |   |     |note2|     |   |   |   |
  574. LES        |   |     |   |   |     |note2|     |   |   |   |
  575. LOCK     x |   |     |   |   |     |     |     |   |   |   |
  576. LODS   b/w |   |     |   |   |     |     |     |   |   |   |
  577.  
  578. LOOP       |   |     |   |   |     |     |     |   |   | x |
  579. LOOPE      |   |     |   |   |     |     |     |   |   | x |
  580. LOOPNE     |   |     |   |   |     |     |     |   |   | x |
  581. LOOPNZ     |   |     |   |   |     |     |     |   |   | x |
  582. LOOPZ      |   |     |   |   |     |     |     |   |   | x |
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.                                 9
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  Op                   Operand
  599. types
  600.   dest.  N | A |  A  | R | R | M/R |  R  | M/R | I | I | D | M/R
  601.   source N | I | M/R | I | N |  R  | M/R |  I  | I | N | N |  N
  602. MOV   note3|   |  x  |   |   |  x  |  x  | b/w |   |   |   |
  603. MOVS   b/w |   |     |   |   |     |     |     |   |   |   |
  604. MUL        |   |  x  |   |   |     |     |     |   |   |   |
  605. NEG        |   |     |   | x |     |     |     |   |   |   |
  606. NOP      x |   |     |   |   |     |     |     |   |   |   |
  607.  
  608. NOT        |   |     |   | x |     |     |     |   |   |   | b/w
  609. OR         | x |     | x |   |  x  |  x  | b/w |   |   |   |
  610. ORG        |   |     |   |   |     |     |     |   | x |   |
  611. OUT        |   |note1|   |   |     |     |     |   |   |   |
  612. POP        |   |     |   | x |     |     |     |   |   |   |x or seg
  613.  
  614. POPF     x |   |     |   |   |     |     |     |   |   |   |
  615. PROC  note4|   |     |   |   |     |     |     |   |   |   |
  616. PUSH       |   |     |   | x |     |     |     |   |   |   |x or seg
  617. PUSHF    x |   |     |   |   |     |     |     |   |   |   |
  618. RCL        |   |     |   | x |     |     |     |   |   |   | b/w
  619.  
  620. RCR        |   |     |   | x |     |     |     |   |   |   | b/w
  621. REP      x |   |     |   |   |     |     |     |   |   |   |
  622. REPE     x |   |     |   |   |     |     |     |   |   |   |
  623. REPNE    x |   |     |   |   |     |     |     |   |   |   |
  624. REPNZ    x |   |     |   |   |     |     |     |   |   |   |
  625.  
  626. REPZ     x |   |     |   |   |     |     |     |   |   |   |
  627. RET      x |   |     |   |   |     |     |     |   |   | x |
  628. ROL        |   |     |   | x |     |     |     |   |   |   | b/w
  629. ROR        |   |     |   | x |     |     |     |   |   |   | b/w
  630. SAHF     x |   |     |   |   |     |     |     |   |   |   |
  631.  
  632. SAR        |   |     |   | x |     |     |     |   |   |   | b/w
  633. SBB        | x |     | x |   |  x  |  x  | b/w |   |   |   |
  634. SCAS   b/w |   |     |   |   |     |     |     |   |   |   |
  635. SEG        |   |     |   |   |     |     |     |   | x |   |
  636. SHL        |   |     |   | x |     |     | b/w |   |   |   |
  637.  
  638. SHR        |   |     |   | x |     |     | b/w |   |   |   |
  639. STC      x |   |     |   |   |     |     |     |   |   |   |
  640. STD      x |   |     |   |   |     |     |     |   |   |   |
  641. STI      x |   |     |   |   |     |     |     |   |   |   |
  642. STOS   b/w |   |     |   |   |     |     |     |   |   |   |
  643.  
  644. SUB        | x |     | x |   |  x  |  x  | b/w |   |   |   |
  645. TEST       | x |     | x |   |  x  |  x  | b/w |   |   |   |
  646. WAIT     x |   |     |   |   |     |     |     |   |   |   |
  647. XCHG       |   |note5|   |   |  x  |  x  |     |   |   |   |
  648. XLAT     x |   |     |   |   |     |     |     |   |   |   |
  649.  
  650. XOR        | x |     | x |   |  x  |  x  | b/w |   |   |   |
  651.  
  652. note 1 IN/OUT supports  DX<-acum(8 or 16) and  port<-acum(8 or 16).
  653.  
  654.  
  655.                                10
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. note 2 These instructions can use only memory refference
  665.        in the source operand.
  666. note 3 MOV also supports mem<-acum  seg<-M/R  and  M/R<-seg(or CS).
  667. note 4 Must specify near or far PROCedure.
  668. note 5 The accumulator can be exchanged with any of the registers
  669.        using the form XCHG AX,BX or XCHG BX
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.                                11
  722.  
  723.  
  724.  
  725.  
  726.  
  727.