home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / asm / 80x0393 / masmtasm.txt < prev    next >
Encoding:
Text File  |  1993-12-02  |  2.6 KB  |  74 lines

  1. (9160)  Mon 29 Nov 93  2:26p
  2. By: Jerry Coffin
  3. To: Mathieu Bouchard
  4. Re: assembly
  5. St:                                                                       <7376
  6. ---------------------------------------------------------------------------
  7. On (27 Nov 93) Mathieu Bouchard wrote to Peter Garner...
  8.  
  9.  MB> What are the differences 'tween MASM and IDEAL modes?
  10.  
  11. There are quite a few minor differences.  The main big difference is
  12. that ideal mode allows only one way of writing indirect addressing.
  13. In MASM ( the real thing or TASM's MASM mode ) the following are legal
  14. ways of saying the same thing:
  15.  
  16.     mov ax,bx[2]
  17.  
  18.     mov ax,2[bx]
  19.  
  20.     mov ax,[bx+2]
  21.  
  22. while ideal mode, only the last of the three is legal.
  23.  
  24. Other areas involve things you typically won't run into very often.  For
  25. instance, in MASM mode, identifiers are in a different name space from
  26. reserved words, so as long as it's clear how a word is being used, you
  27. can use it for two different things at times.  For instance
  28.  
  29. %.model MODEL,c
  30.  
  31. Means that 'MODEL' is going to be defined on the command line and you're
  32. going to use that as the memory model for the code.  In ideal mode, this
  33. is considered a conflict with the .model directive and you have to
  34. invent some other name to mean model, typically 'memmodel' or something
  35. similar.
  36.  
  37. Most of the other differences will only become noticeable if you write a
  38. lot of macros.  While TASM's book makes rather a point of claiming that
  39. all of these are "cures" for "bugs in MASM", there are those who've used
  40. both and prefer MS' decisions in at least some cases.
  41.  
  42. There are at least a couple other things of note as far as differences
  43. between the two.  One particularly obvious one is in how the two figure
  44. offsets in grouped segments.  By default MASM figures offsets within the
  45. segment to which a variable belongs, even if that segment is part of a
  46. group.  This means that most times that you get an offset in MASM, you
  47. need to use a group override to get the proper offset.  By contrast,
  48. TASM normally figures offsets within the group, so you normally get the
  49. correct offset without an override.  Eg:
  50.  
  51. .data
  52. junk    dw  ?
  53.  
  54. .code
  55. ; ...
  56.     mov dx,offset junk
  57.  
  58. This will NOT normally produce the correct results with MASM.  Instead
  59. you have to:
  60.  
  61.     mov dx,offset DGROUP:junk
  62.  
  63. Note that unless you specifically ask for TASM's QUIRKS mode, that the
  64. first version will work correctly without having to enable ideal mode.
  65.     Later,
  66.     Jerry.
  67.  
  68. ... The Universe is a figment of its own imagination.
  69.  
  70. --- PPoint 1.70
  71.  * Origin: Point Pointedly Pointless (1:128/77.3)
  72.  
  73. @PATH: 128/77 58 12 1 209/209 270/101 260/1 362
  74.