home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / A86ASS.ZIP / MASM50.TXT < prev    next >
Text File  |  1990-09-11  |  3KB  |  82 lines

  1. A86 equivalents for some MASM 5.0 built-in macros
  2.  
  3. This chart was prepared in response to a couple of my users, who are trying to 
  4. work through the MASM 5.0 code in Norton's new assembly language book.  It's a 
  5. sad condition that the so-called "standard" assembler keeps changing, so that 
  6. MASM users are forced to send another $50--75 every couple of years to 
  7. Microsoft, if they wish to keep up with the literature.
  8.  
  9. Please read Chapter 12 of the A86 manual for an overview of conversion of MASM 
  10. programs to A86.  You'll find that the best method for reworking the program 
  11. in Norton's book is to eliminate all of the following "red-tape" directives 
  12. entirely, and make the program into a .COM program.  In that case, you must 
  13. also eliminate all the program instructions designed to load segment registers 
  14. (such as MOV AX,DGROUP followed by MOV DS,AX).  You can do so because a .COM 
  15. program already starts with all segments pointing to the same 64K area.  The 
  16. stack pointer is also automatically initialized, up at the top of the 64K area 
  17. where it will not interfere with program or data.  Thus you can ignore 
  18. segmentation entirely.  Instead of linking successively greater numbers of 
  19. .OBJ files, you simply assemble the corresponding source files -- A86 
  20. assembles faster than LINK links, so this is no penalty. 
  21.  
  22. By eliminating all the segmentation red tape, you are making your program 
  23. much, much simpler to code and understand.  But if you wish to slavishly mimic 
  24. the MASM macros presented, you can substitute the equivalents that follow 
  25. here.  But, again, I am utterly convinced that if you do so, you'll end up 
  26. with more headaches and less understanding than you would if you ripped out 
  27. all segmentation directives and initializations from the start. 
  28.  
  29. IMPORTANT NOTE: The leading underscores of _DATA and _TEXT, where
  30.                 presented, are significant and must be included!
  31.  
  32.  
  33.  
  34. MASM: dosseg
  35.  
  36. A86:  The only effect of this directive appears to be to add a comment
  37.       record to the object file, presumably for Microsoft's debugger's
  38.       benefit.  It can be deleted from A86 code.
  39.  
  40.  
  41.  
  42. MASM: .model small        or
  43.       .model compact      or
  44.       .model medium       or
  45.       .model large
  46.  
  47. A86:  DGROUP GROUP _DATA,STACK
  48.  
  49.  
  50.  
  51. MASM: .code
  52.  
  53. A86:  if model is small or compact:  _TEXT SEGMENT WORD PUBLIC 'CODE'
  54.       if model is medium or large:   modname_TEXT SEGMENT WORD PUBLIC 'CODE'
  55.  
  56.       ...where "modname" is the name of this module
  57.  
  58. (more on the back side of this page)
  59.  
  60.  
  61.  
  62. MASM: .data
  63.  
  64. A86:   _DATA SEGMENT WORD PUBLIC 'DATA'
  65.  
  66.  
  67.  
  68.  
  69. MASM:  .stack
  70.  
  71. A86:   STACK SEGMENT PARA STACK 'STACK'
  72.        ORG 0400H
  73.  
  74.  
  75.  
  76. MASM:  extrn MYPROC:proc
  77.  
  78. A86:   if model is small or compact:  EXTRN MYPROC:near
  79.        if model is medium or large:   EXTRN MYPROC:far
  80.  
  81.        ...where MYPROC is any name of a procedure you are declaring
  82.