home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / beehive / program / xasm.arc / XASM86.HLP < prev   
Encoding:
Text File  |  1990-08-26  |  22.0 KB  |  592 lines

  1. Introductioε t∩ thσ 808╢ architecture.
  2. Addessinτ modes.
  3. The instruction set.
  4. Assembler Syntax of intructions and directives.
  5. Assembler Directives.
  6. Assembler Operators
  7. Invocation of XASM86.COM
  8. Example listing with comments
  9. :Thσ 808╢ ha≤ ß 2░ bi⌠ addres≤ bus¼ bu⌠ onl∙ 1╢ bi⌠ registers« T∩ ì
  10. accommodatσ this¼á thσ SEGMEN╘ registers¼á (CS,DS,SS,ES⌐ arσ useΣ ì
  11. t∩á suppl∙ thσ mos⌠ significan⌠ 1╢ oµ thσ 2░ bi⌠ physica∞ addres≤ ì
  12. lines«á Thσ lowe≥ 1╢ bit≤ arσ supplieΣ froφ thσ registe≥ useΣá iε ì
  13. thσ operation« Thσ segmen⌠ register≤ iε detai∞ are:
  14.  
  15. ááááááááá CS-The code segment register.
  16.  
  17. áááááááá Al∞ executablσ codσ mus⌠ residσ iε thσ codσ segment¼ anΣ ì
  18. áááááááái⌠á use≤ thσ intructioε pointer(IP⌐ t∩ providσ thσ 1╢ bi⌠ ì
  19. ááááááááoffset within the segment.
  20.  
  21. áááááááá  DS-The data segment register.
  22.  
  23. ááááááááThσá datßá useΣá b∙á ß prograφá i≤á accessed(b∙á default⌐ ì
  24. ááááááááusinτ thσ D╙ registe≥ witΦ thσ offse⌠ addres≤ withiεá thσ ì
  25. áááááááásegmen⌠á provideΣ b∙ thσ addressinτ mode (seσá addressinτ ì
  26. áááááááámodes)«á Iµá anothe≥ segmen⌠ hold≤ thσ datß t∩ bσ useΣ b∙ ì
  27. ááááááááthσá program¼á thσá segmen⌠ ma∙ bσ specifieΣá withiεá thσ ì
  28. ááááááááinstructioεá b∙á usinτá ß SEGMEN╘á OVER-RID┼á PREFIX.(seσ ì
  29.         later)
  30. áááááááá  SS-The stack segment register.
  31.  
  32. ááááááááThσá datßá iεá ßá prograφá PUSHE─á anΣá POPPE─á ont∩á thσ ì
  33. áááááááástack(usinτ thσ S╨ a≤ thσ offse⌠ withiε thσ segmen⌠) mus⌠ ì
  34. ááááááááliσ withiε thσ stacδ segment« Othe≥ register≤ ma∙ usσ thσ ì
  35. áááááááástacδ segmen⌠ b∙ usinτ thσ appropriatσ SEGMEN╘á OVER-RID┼ ì
  36. ááááááááPREFIX.
  37.  
  38. áááááááá  ES-The extra segment register.
  39.  
  40. ááááááááAl∞á strinτ operation≤ usσ thσ extrß segmen⌠ registe≥á a≤ ì
  41.    áááááthe destination segment.
  42. REGISTERS
  43.  
  44. Thσá 808╢ ha≤ ┤ 1╢ bi⌠ register≤ tha⌠ caε bσ useΣ a≤ accumulator≤ ì
  45. fo≥ mos⌠ purposes«á The∙ arσ AX,BX,C╪ AN─ DX« Thesσ register≤ caε ì
  46. bσ operateΣ oε a≤ 1╢ bi⌠ registers¼á a≤ specifieΣ above,(e.g« AX⌐ ì
  47. o≥ a≤ independen⌠ ╕ bi⌠ registers¼ b∙ specifyinτ thσ registe≥ anΣ ì
  48. thσ uppe≥ o≥ lowe≥ ╕ bits«á Fo≥ example¼á thσ 1╢ bi⌠ registe≥á A╪ ì
  49. caεá bσ specifieΣ a≤ thσ concatenatioε oµ thσ lowe≥ ╕á bits¼á thσ ì
  50. registe≥ A╠ anΣ thσ uppe≥ ╕ bits¼ thσ registe≥ AH« Apar⌠ froφ thσ ì
  51. genera∞á arthimetiπ functions¼á eacΦ oµ thesσ ┤á  register≤á havσ ì
  52. somσ implieΣ specia∞ function.
  53. ááááááááA╪á    Thi≤á registe≥á mus⌠ bσ useΣ fo≥ al∞á I╬á anΣá OU╘ ì
  54. ááááááááinstructions¼á anΣá fo≥ al∞ multiplicatioεá anΣá divisioε ì
  55. ááááááááinstructions«á Also¼á specifyinτá thi≤á registe≥á a≤á thσ ì
  56. áááááááásourcσá o≥á destinatioεá fo≥á direc⌠á offse⌠á storinτá o≥ ì
  57. ááááááááretrieving of data, uses one less instruction byte.
  58.  
  59. ááááááááB╪á    Thi≤ registe≥ caε bσ useΣ a≤ aε inde° registe≥á t∩ ì
  60. áááááááápoin⌠á int∩á thσá datßá segment¼á togethe≥á witΦá anothe≥ ì
  61. ááááááááregister or offset.(see addressing modes)
  62.  
  63. ááááááááC╪á    Thi≤á i≤á ß genera∞ coun⌠ registe≥á fo≥á usσá witΦ ì
  64. ááááááááinstruction≤á sucΦá a≤á decremen⌠á C╪á anΣá jum≡á iµá no⌠ ì
  65. áááááááázero(LOOP⌐á o≥á fo≥ variablσ shif⌠ instruction≤á sucΦá a≤ ì
  66. ááááááááshif⌠ registe≥ ε times¼ wherσ ε i≤ helΣ iε CL¿ SH╠ AX,CL)
  67.  
  68. ááááááááD╪    Thi≤ registe≥ i≤ useΣ fo≥ variablσ por⌠ addressing¼ ì
  69. ááááááááwherσá thσ por⌠ addres≤ i≤ froφ ░ t∩ FFF╞ h«á I⌠ i≤á als∩ ì
  70. ááááááááuseΣ a≤ aε extensioε registe≥ t∩ A╪ fo≥ 3▓ bi⌠ operation≤ ì
  71.    áááááinvolved with multiplication and division.
  72. ááááááááB╨á anΣ S╨ Thesσ arσ 1╢ bi⌠ pointe≥á registers¼á anΣá arσ ì
  73. ááááááááuseΣ t∩ poin⌠ int∩ thσ stacδ segment« Al∞ PUSHe≤ anΣ POP≤ ì
  74. ááááááááusσá S╨á anΣ B╨ i≤ useΣ t∩ acces≤ datß oε thσá stacδá no⌠ ì
  75. áááááááápointeΣ t∩ b∙ SP.
  76.  
  77. ááááááááS╔ anΣ D╔ Thesσ arσ 1╢ bi⌠ inde° registers¼ useΣ t∩ poin⌠ ì
  78. ááááááááint∩ thσ datß anΣ extrß segments.
  79.  
  80. ááááááááI╨ Thi≤ i≤ thσ instructioε pointer¼á ß 1╢ bi⌠ registe≥ t∩ ì
  81. áááááááápoin⌠á int∩á thσá codσ segmen⌠ thσá thσá nex⌠á executablσ ì
  82. ááááááááinstruction.
  83. ááááááááFLA╟ register«á Thi≤ 1╢ bi⌠ registe≥ hold≤ thσ condition≤ ì
  84. ááááááááof the last applicable operation as follows:-
  85.  
  86. áááááááá      bit 15 [x x x x.OF DF IF TF.SF ZF x AF.x PF x CF]
  87. ááááááááwhere x is undefined, and the following are:-
  88. áááááááá  OF Set if result caused an overflow (2's complement)
  89. áááááááá  D╞ Se⌠ b∙ softwarσ t∩ causσ aut∩ IN├ o≥ DE├ 
  90. áááááááá  IF Set by software for interrupt enable
  91. áááááááá  TF TRAP-When set causes interrupt after one instruction
  92. áááááááá  SF Set if instruction caused msb to be set.(sign)
  93. áááááááá  ZF Set if instruction resulted in zero
  94. áááááááá  AF Set if a carry occurred between nibbles
  95. áááááááá  PF Parity flag,set if parity even
  96.    ááááá  CF Set if carry occurred from msb(or borrow)
  97. :Addressinτ modes
  98. Thσá followinτá tablσá give≤ thσ ful∞ se⌠á oµá possiblσá registe≥ ì
  99. to/froφ memor∙ addressinτ modes¼ anΣ thσ defaul⌠ segmen⌠ tha⌠ thσ ì
  100. offse⌠á i≤á placeΣ in«á BX,S╔ anΣ D╔ implicitl∙ addres≤ thσá datß ì
  101. segment¼á whilσá an∙á combinatioε witΦ B╨ wil∞ acces≤á thσá stacδ ì
  102. segment« Over-ridσ prefixe≤ arσ allowed.
  103. áááááááá       offset              default segment register
  104. áááááááá       (BX)                DS
  105. áááááááá       DISP16              DS
  106. áááááááá       (DI)                DS
  107. áááááááá       (SI)                DS
  108. áááááááá       (BP)+(DI)           SS
  109. áááááááá       (BP)+(SI)           SS
  110. áááááááá       (BX)+(DI)           DS
  111. áááááááá       (BX)+(SI)           DS
  112.  
  113. áááááááá       (BX)+DISP8-16       DS
  114. áááááááá       (BP)+DISP8-16       SS
  115. áááááááá       (DI)+DISP8-16       DS
  116. áááááááá       (SI)+DISP8-16       DS
  117. áááááááá       (BP)+(DI)+DISP8-16  SS
  118. áááááááá       (BP)+(SI)+DISP8-16  SS
  119. áááááááá       (BX)+(DI)+DISP8-16  DS
  120. áááááááá       (BX)+(SI)+DISP8-16  DS
  121. String operations
  122. Variou≤ onσ bytσ instruction≤ perforφ primitivσ strinτ operation≤ ì
  123. fo≥ thσ manipulatioε oµ continuou≤ datß strings« Thesσ operation≤ ì
  124. ma∙á bσá performeΣ repeatedl∙ b∙ precedinτ thσ instructioεá b∙á ß ì
  125. repeat prefix.( see REP).
  126. Al∞á thσ strinτ operation≤ usσ S╔ a≤ thσ source¿ defaul⌠á t∩á thσ ì
  127. datß segment¼á anΣ ma∙ usσ segmen⌠ over-ride)¼á anΣ usσ D╔ a≤ thσ ì
  128. destination(mus⌠áá bσá iεá extrßá segment)«áá Aut∩á incremen⌠á o≥ ì
  129. decrement of the registers is specified by the diection flag(DF).
  130. :Thσáá 808╢áá instructioεá set«áá Iεá al∞á cases,wherσáá meφáá i≤ ì
  131. specified, reg may be used
  132.  
  133. Data Transfer
  134.  
  135. MOV         MOVE
  136. PUSH        PUSH ONTO STACK
  137. POP         POP FROM STACK
  138. XCHG        EXCHANGE
  139. IN          IN FROM PORT
  140. OUT         OUT TO PORT
  141. XLAT        TRANSLATE BYTE TO AL
  142. LEA         LOAD EFFECTIVE ADDRESS
  143. LDS         LOAD DOUBLE WORD TO DS (AND ANOTHER REGISTER)
  144. LES         LOAD DOUBLE WORD TO ES (AND ANOTHER)
  145. LAHF        LOAD AH WITH FLAGS
  146. SAHF        STORE AH INTO FLAGS
  147. PUSHF       PUSH FLAGS ONTO STACK
  148. POPF        POP FLAGS FROM STACK
  149. Arithmetic
  150.  
  151. ADD         ADD
  152. ADC         ADD WITH CARRY
  153. INC         INCREMENT
  154. SUB         SUBTRACT
  155. SBB         SUBRACT WITH BORROW(CARRY FLAG)
  156. DEC         DECREMENT
  157. AAA         ASCII ADJUST FOR ADD
  158. DAA         DECIMAL ADJUST FOR ADD
  159. AAS         ASCII ADJUST FOR SUBRACT
  160. DAS         DECIMAL ADJUST FOR SUBTRACT
  161. NEG         CHANGE SIGN( 2's complement)
  162. CMP         COMPARE
  163. MUL         MULTIPLY (unsigned)
  164. IMUL        MULTIPLY (signed)
  165. AAM         ASCII ADJUST FOR MULTIPLY
  166. DIV         DIVIDE (unsigned)
  167. IDIV        DIVIDE (signed)
  168. AAD         ASCII ADJUST FOR DIVIDE
  169. CBW         CONVERT BYTE TO WORD
  170. CWD         CONVERT WORD TO DOUBLE WORD
  171. Logic
  172.  
  173. NOT         LOGICAL INVERSION
  174. SHL(SAL)    SHIFT LOGICAL(ARITHMETIC) LEFT
  175. SHR         SHIFT LOGICAL RIGHT
  176. SAR         SHIFT ARITHMETIC RIGHT
  177. ROL         ROTATE LEFT
  178. ROR         ROTATE RIGHT
  179. RCL         ROTATE THRU' CARRY LEFT
  180. RCR         ROTATE THRU' CARRY RIGHT
  181. AND         LOGICAL AND
  182. TEST        AND TO FLAGS, NO RESULT
  183. OR          LOGICAL OR
  184. XOR         EXCLUSIVE OR
  185. Strings
  186.  
  187. REP
  188. REPNZ
  189. REPZ        REPEAT PREFIX
  190. MOVS        MOVE STRING
  191. CMPS        COMPARE STRINGS
  192. SCAS        SCAN STRING
  193. LODS        LOAD STRING
  194. STOS        STORE STRING
  195. Control transfer
  196.  
  197. CALL        CALL (direct or indirect,with in a segment)
  198. CALLF       CALL (direct or indirect,to another segment)
  199. JMP         JUMP (disp16,direct or indirect)
  200. JMPF        JUMP (direct or indirect,to another segment)
  201. JMPS        JUMP (direct,disp8,-128,+127 bytes)
  202. RET         RETURN FROM CALL WITHIN SEGMENT(optional adding to SP)
  203. RETF        RETURN FROM CALL FROM ANOTHER SEG(optional add to SP)
  204. JE(JZ)      JMP IF EQUAL(ZERO)
  205. JL(JNGE)    JMP ON LESS THAN
  206. JLE(JNG)    JMP ON LESS THAN OR EQUAL
  207. JB(JNAE)    JMP ON BELOW( NOT ABOVE)
  208. JBE(JNA)    JMP ON BELOW OR EQUAL
  209. JP(JPE)     JMP ON PARITY EVEN
  210. JO          JMP ON OVERFLOW
  211. JS          JMP ON SIGN
  212. JNE(JNZ)    JMP ON NOT EQUAL
  213. JNL(JGE)    JMP ON GREATER THAN OR EQUAL
  214. JNLE(JG)    JMP ON GREATER THAN
  215. JNB(JAE)    JMP ON ABOVE OR EQUAL
  216. JNBE(JA)    JMP ON ABOVE
  217. JNP(JPO)    JMP ON NOT PARITY(PARITY ODD)
  218. JNO         JMP ON NOT OVERFLOW
  219. JNS         JMP ON NOT SIGN
  220. JC          JMP ON CARRY(Same as JB)
  221. JNC         JMP ON NOT CARRY(Same as JNB)
  222. LOOP        LOOP CX TIMES
  223. LOOPZ
  224. LOOPE       LOOP CX TIMES WHILE ZERO(EQUAL)
  225. LOOPNZ
  226. LOOPNE      LOOP CX TIMES WHILE NOT ZERO
  227. JCXZ        JUMP IF CX NOT ZERO( no flags used)
  228.  
  229. *¬ Abovσ anΣ belo≈ refe≥ t∩ thσ reletionshi≡ betweeε tw∩ unsigneΣ ì
  230. values, while greater and less refer to signed values **
  231. Interrupts
  232.  
  233. INT         INTERRUPT
  234. INTO        INTERRUPT ON OVERFLOW
  235. IRET        INTERRUPT RETURN
  236.  
  237. Processor Control
  238.  
  239. CLC         CLEAR CARRY FLAG
  240. CMC         COMPLEMENT CARRY FLAG
  241. STC         SET CARRY FLAG
  242. NOP         NO OPERATION (ACTUALLY XCHG AX,AX)
  243. CLD         CLEAR DIRECTION FLAG
  244. STD         SET DIRECTION FLAG
  245. CLI         CLEAR INTERRUPT ENABLE FLAG
  246. STI         SET INTERRUPT ENABLE FLAG
  247. HLT         PROCCESSOR HALT
  248. WAIT        WAIT UNTIL TEST PIN IS ASSERTED
  249. LOCK        LOCK BUS FROM OTHER USERS
  250. ESC         ESCAPE TO EXTERNAL DEVICE ON BUS
  251. Use of segment over-ride prefixes
  252.  
  253. Operand  register     default             with over-ride
  254. IP( code address)     CS                  NEVER
  255. SP( stack address)    SS                  NEVER
  256. BP( stack marker)     SS                  DS or ES or CS
  257. SI or DI( not strings)DS                  SS or ES or CS
  258. SI (source strings)   DS                  SS or ES or CS
  259. DI (dest. strings)    ES                  NEVER
  260. :Assembler syntax of intructions and directives.
  261.  
  262. The following is the syntax for an instuction statement.
  263.  
  264. {label:}   {prefix}  Mnemonic   {Operand(s)}   {;comment}
  265.  
  266. where the fields are as follows
  267.  
  268. label║á         ┴ásymbo∞á followeΣ b∙ ":ó define≤ ß labe∞ a⌠á thσ                                 ì
  269.                curren⌠á valuσá oµá thσ locatioεá counte≥á iεá thσ                  ì
  270.                curren⌠ segment.(optional)
  271.  
  272. prefi°á         Certaiεá machinσ instruction≤ sucΦá a≤á LOC╦á anΣ ì
  273.                segmen⌠á over-ride≤ ma∙ prefi° othe≥ instructions« ì
  274.                (optional)
  275.      
  276. mnemoniπá       ┴ symbo∞ defineΣ a≤ ß machinσá instruction«á Thi≤ ì
  277.                fielΣá i≤á optiona∞ unles≤ precedeΣá b∙á ßá prefi° ì
  278.                instruction.
  279. operand(s)      Instructions may have 0,1,2 operands.
  280.  
  281. ;commen⌠        An∙ ╗ appearinτ outsidσ ß characte≥ strinτ begin≤ ì
  282.                ß comment¼ whicΦ i≤ endeΣ by<CR>.(optional)
  283.  
  284. The following is the syntax for a directive statement.
  285.  
  286. {name}     directive       operand(s)        {;comment}
  287.  
  288.  where the fields are defined as follows.
  289.  
  290. name           Unlike the label field of an instruction,the name
  291.                field is NEVER terminated with a colon. Directive
  292.                names are legal only for DB,DW,DD,RS and EQU.
  293.  
  294. directive      A keyword described under Assembler Directives.
  295.  
  296. operands       Analogous to operands for instruction mnemonics.
  297.  
  298. ;comment       Exactly as instructions
  299. :Assembler directives.
  300.  
  301. Segment start directives.
  302.  
  303. Al∞á 808╢ statement≤ mus⌠ bσ assigneΣ t∩ onσ oµ thσ fou≥ segment≤ ì
  304. s∩á the∙á caεá bσ accesseΣ b∙á thσá CPU«á ┴á statemen⌠á directivσ ì
  305. statement¼á CSE╟á DSEG,SSE╟ o≥ ESE╟ specifie≤ tha⌠ thσ statement≤ ì
  306. followinτá i⌠ belonτ t∩ tha⌠ segment«á Thi≤ i≤ neccessr∙ s∩á tha⌠ ì
  307. thσá assemble≥ caε providσ ß segmen⌠ over-ridσ prefi° iµá needed« ì
  308. The statements are as follows.
  309.  
  310. CSEG      numeric exp.
  311. CSEG
  312. CSEG      $
  313. Specifie≤á tha⌠á thσá followinτ statement≤á belonτá t∩á thσá Codσ ì
  314. Segment« Thσ numeriπ expressioε fixe≤ thσ physica∞ addres≤ oµ thσ ì
  315. segment¼á anΣá thσá codσá i≤ no⌠á relocatable«á Thσá seconΣá forφ ì
  316. generate≤á relocatablσ code,anΣ i≤ useΣ wherσ thσ segmen⌠ addres≤ ì
  317. i≤ no⌠ knowε a⌠ assembl∙ time« Thσ thirΣ forφ i≤ useΣ t∩ continuσ ì
  318. a segment where it has been interrupted by another SEG directive.
  319. DSEG      numeric exp.
  320. DSEG
  321. DSEG      $
  322. Specifies that the following is assigned to the Data Segment.
  323.  
  324. SSEG      numeric exp.
  325. SSEG
  326. SSEG      $
  327. Specifies that the following is assigned to the Stack Segment.
  328.  
  329. ESEG      numeric exp.
  330. ESEG
  331. ESEG      $
  332. Specifies that the following is assigned to the Extra Segment.
  333. ORG       numeric exp.
  334. Set≤ thσ offse⌠ oµ thσ locatioε counte≥ iε thσ curren⌠ segmen⌠ t∩ ì
  335. value of (numeric exp.)
  336.  
  337. IF and END IF
  338.  
  339. IF        numeric expression
  340.           source line 1
  341.           .
  342.           .
  343.           source line n
  344.           ENDIF
  345. Cause≤ conditiona∞ assembly.Iµ numeriπ expressioε i≤ non-zero,thσ ì
  346. line≤á arσ assembled,iµ zer∩ the∙ arσ excluded.NesteΣ I╞á i≤á no⌠ ì
  347. allowed.
  348. INCLUDE        filename
  349. Thi≤á include≤á anothe≥ 808╢ filσ iε thσ sourcσ text.Ma∙á no⌠á bσ ì
  350. nested.File type defaults to .A86 .
  351.  
  352. END
  353. Marks the end of the source file.(optional)
  354.  
  355. EQU
  356. symbol    EQU       numeric exp.
  357.                     address exp.
  358.                     register
  359.                     instruction nmemonic
  360. The required symbol must not be terminated with a ":".
  361. eg M EQU MOV
  362.      M   AX,BX   ;assembles as MOV AX,BX
  363. DB
  364. Assign≤ storagσ areß iε bytσ format.Thi≤ i≤ thσ onl∙ storagσ typσ ì
  365. to allow more than 2 bytes of a string.
  366.  
  367. DW
  368. Assign≤á ▓á Bytσ word≤ oµ storage(lowes⌠ ╕ bit≤ storeΣ a⌠á lowes⌠ ì
  369. address).
  370.  
  371. DD
  372. Assign≤á ┤ byte≤ oµ storage(A≤ aε addres≤ storage,thσá offse⌠á i≤ ì
  373. stored at the lowest word, the segment is stored at the highest).
  374.  
  375. RS   
  376. Reserves storage, but does not initialize it.
  377. eg  BUFFER    RS     80h
  378.  
  379. RB(,RW)      numeric exp.
  380. Reserves a number of bytes(,words),but does not initialize it.
  381. TITLE       string const.
  382. Prints up to 30 chars at top of each printout page in listing.
  383.  
  384. PAGESIZE     numeric exp.
  385. Number of lines to a listing page( default 66)
  386.  
  387. PAGEWIDTH    numeric exp
  388. Number of colomns in listing (default 120,unless direct,=79)
  389.  
  390. EJECT
  391. Eject a page during printout.EJECT is printed on next page.
  392.  
  393. SIMFORM
  394. Replace≤á ßá forφá feeΣ characte≥ b∙ thσ correc⌠ numbe≥á oµá linσ ì
  395. feeds.
  396.  
  397. NOLIST and LIST
  398. As usual
  399. :Assembler Operators
  400. THE 8086 Assembler operators falls into the following types.
  401.  
  402. arithmetic
  403. logical
  404. relational
  405. segment over-ride
  406. variable manipulators and creators
  407.  
  408. The following is the syntax of these operators.
  409.  
  410. SYNTAX              RESULT
  411.           logical
  412.  
  413. a XOR b
  414. a OR b
  415. a AND b
  416. NOT a               a=16 bit
  417.           relational
  418. a EQ b              FFFFh if a=b,0 otherwise
  419. a LT b
  420. a LE b
  421. a GT b
  422. a GE b
  423. a NE b
  424.  
  425.           arithmetic
  426. $                   current location,current segment.
  427. a+b
  428. a-b
  429. a*b                 unsigned
  430. a/b                 unsigned
  431. a MOD b
  432. a SHL b
  433. a SHR b
  434. +a
  435. -a
  436.           segment over-ride
  437. ES:
  438. SS:
  439. CS:
  440. DS:                 over-rides assembler choice
  441.  
  442.           variable manipulators,creators
  443. SEG a               creates no.=segment value
  444. OFFSET a            creates no.=offset within segment
  445. TYPE a              creates no.=1,2 or 4 if type
  446.                     is byte,word or dword
  447. LENGTH a            creates no.=length of bytes
  448. LAST a              creates no.=LENGTH-1,otherwise 0
  449. a PTR b             creates type of a,attributes of b
  450. .a                  creates variable with offset of a,
  451.                     segment=current segment.
  452.  
  453. :Invocation of XASM86.COM
  454.  
  455. The cross assembler is run by the following.
  456.  
  457. XASM86 filename {$optional parameters}
  458.  
  459. where the filename is {D:}filename{.filetype}
  460. D:,if specified is the drive name.
  461. filetype is standard type,default to .A86
  462. eg XASM86 B:TEST
  463. would assemble a file B:TEST.A86
  464.  
  465. The assembler produces 3 output files, as follows.
  466. filename.LST   contains listing of source
  467. filename.SYM   contains all user defined symbols
  468. filename.H86   contains HEX format listing
  469.  
  470. Thσá HE╪á forma⌠ listinτ i≤ eithe≥ DIGITA╠ RESEARC╚ (default⌐á o≥ ì
  471. INTEL format(see below).
  472. Optional Parameters:
  473.  
  474. Iε thσ following¼á A,B,C,─ specif∙ valiΣ filedrives¼á ╪ specifie≤ ì
  475. CO╬ ,┘ specifie≤ LST¼ ┌ specifie≤ NUL(suppres≤ output)
  476.  
  477. A         source file device,followed by A,B,C,D,X,Y,Z
  478.  
  479. H         hex output file device,followed by A,B,C,D,X,Y,Z
  480.  
  481. P         list file device,followed by A,B,C,D,X,Y,Z
  482.  
  483. S         symbol file device,followed by A,B,C,D,X,Y,Z
  484.  
  485. F         format of hex file,followed by I(INTEL),D(DIGITAL)
  486. eg XASM86 TEST $AD SZ
  487.  
  488. Assemblσ TEST.A8╢ oε drivσ D║á ¼ producσ TEST.LST anΣ TEST.H8╢ oε 
  489. the same drive, no output of TEST.SYM
  490.  
  491. eg XASM86 TEST $AD SZ FI
  492. Same as above, but format of hex file is INTEL.
  493.  
  494. :Example listing ( with comments)
  495.  
  496. ASM86 VER 1.0   SOURCE: EXAMPLE.A86                                    PAGE   1
  497.  
  498.  
  499.                          ; ASSEMBLED BY THE INSTRUCTIONS:
  500.                          ;
  501.                          ;XASM86 EXAMPLE $FI
  502.                          ;
  503.                          ;The following is an example of an 8086 
  504.                          ;assembly listing produced by the XASM86 
  505.                          ;cross-assembler.Where possible the listing 
  506.                          ;is provided with suitable comments to 
  507.                          ;highlight certain actions of the assembler 
  508.                          ;or the 8086 software.
  509.                          ;
  510.                          ;
  511.     0010                         SSEG    10H     ;ACTUAL ADDRESS=100H
  512.   0000                   BOTTOM  RW      40H     ;40 WORDS
  513.   0080                   TOP     RW      0H      ;JUST A LABEL
  514.     0020                         DSEG    20H     ;ADDRESS AT 200H
  515.   0000 12                FRED    DB      12H     ;1 BYTE
  516.   0001 34                TONY    DB      34H     ;ANOTHER BYTE
  517.   0002 34 12             GEORGE  DW      1234H   ;1 WORD,STORED AS 3412H
  518.   0004 80 00 10 00       LABEL   DD      TOP     ;ASSEMBLER PICKS SEG,OFFSET
  519.   0008 45 58 41 4D 50 4C SOURCE  DB      'EXAMPLE STRING NUMBER 1'       ;TEXT
  520.        45 20 53 54 52 49 
  521.        4E 47 20 4E 55 4D 
  522.        42 45 52 20 31 
  523.                          ;
  524.     0030                         ESEG    30H     ;ADDRESS AT 300H
  525.   0000                   DESTB   RB      40H     ;DESTINATION BYTES
  526.   0040                   DESTW   RW      20H     ;DESTINATION WORDS
  527.                          ;
  528.     0040                         CSEG    40H             ;ADDRESS AT 400H
  529.   0000 B8 10 00          START:  MOV     AX,SEG BOTTOM   ;SEGMENT ADDRESS
  530.   0003 8E D0                     MOV     SS,AX           ;TO SEGMENT REGISTER
  531.   0005 B8 80 00                  MOV     AX,OFFSET TOP   ;OFFSET IN SEGMENT
  532.   0008 B8 80 00                  MOV     AX,LENGTH BOTTOM*TYPE BOTTOM
  533.   000B 8B E0                     MOV     SP,AX           ;TO STACK POINTER
  534.                          ;
  535.                          ;The above section of code extracts the segment address of
  536.                          ;the stack for SS .The offset of the top of stack is loaded 
  537.                          ;to the stack pointer,using two operators,giving the same result
  538.                          ;(offset and length*type).The same procedure for the other
  539.                          ;segment registers used should be done as follows.
  540.                          ;Note that the values loaded are immediate values,and not
  541.                          ;labels,and thus segment over-ride is not applicable.
  542.                          ;
  543.   000D B8 20 00                  MOV     AX,SEG LABEL
  544.   0010 8E D8                     MOV     DS,AX
  545.   0012 B8 30 00                  MOV     AX,SEG DESTB
  546.   0015 8E C0                     MOV     ES,AX
  547.                          ;
  548.                          ;Now to test the type operands,byte/word mixture
  549.                          ;
  550.   0017 A1 02 00                  MOV     AX,GEORGE
  551.                          ;
  552.                          ;This is valid,since AX and GEORGE are words
  553. ** ERROR NO:  8"   OPERAND(S) MISMATCH INSTRUCTION
  554. ASM86 VER 1.0   SOURCE: EXAMPLE.A86                                                                          PAGE   2
  555.  
  556.  
  557.   001A 90 90 90 90 90 90         MOV     AX,FRED
  558.                          ;
  559.                          ;Invalid,since FRED is byte
  560.                          ;
  561.   0020 A1 00 00                  MOV     AX,WORD PTR FRED
  562.                          ;
  563.                          ;Valid,since WORD PTR over-rides byte description
  564.                          ;for this case.
  565.                          ;
  566.                          ;Now we try string operations
  567.                          ;
  568.   0023 B9 17 00                  MOV     CX,LENGTH SOURCE/TYPE DESTB
  569.   0026 BE 08 00                  MOV     SI,OFFSET SOURCE
  570.   0029 BF 00 00                  MOV     DI,OFFSET DESTB
  571.   002C F3 A4                REP  MOVS    DESTB,SOURCE
  572.                          ;The operands must be used for the MOVS instruction
  573.                          ;to allow the assembler to chose the byte or word
  574.                          ;code,and to allow for segment over-ride where valid
  575.                          ;
  576.   002E B9 0C 00                  MOV     CX,LENGTH SOURCE/TYPE DESTW+1
  577.   0031 BE 08 00                  MOV     SI,OFFSET SOURCE
  578.   0034 BF 40 00                  MOV     DI,OFFSET DESTW
  579.   0037 F3 A5               REP   MOVS    DESTW,WORD PTR SOURCE
  580.                          ;
  581.                          ;The word type of string move.
  582.                          ;
  583.   0039 26 8B 1E 40 00            MOV     BX,DESTW
  584.                          ;
  585.                          ;Assembler will generate segment over-ride prefix
  586.                          ;to segment ES(=26H),or can generate yourself,
  587.                          ;(usually error) as follows.
  588.                          ;
  589.   003E 36 8B 1E 40 00            MOV     BX,SS:DESTW
  590.  
  591.   END OF ASSEMBLY. NUMBER OF ERRORS:   1
  592.