home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / asmutl / rmacpat.asm < prev    next >
Encoding:
Assembly Source File  |  1994-07-13  |  3.1 KB  |  126 lines

  1. ;****************************************************************
  2. ;
  3. ;            Patches for MAC and RMAC
  4. ;            ------------------------
  5. ;
  6. ;             by George Blat
  7. ;           Blat, Research + Development Corp.
  8. ;              8016 188th SW
  9. ;            Edmonds, WA 98020
  10. ;
  11. ;
  12. ;****************************************************************
  13. ;
  14. ;
  15. ;The following changes are (c)1983 Blat R+D Corp. Permission is
  16. ;granted to use these patches only in non-commercial applications.
  17. ;MAC and RMAC are trademarks of Digital Research, Inc. which holds
  18. ;ownership and all rights to the original programs.
  19. ;
  20. ;****************************************************************
  21. ;
  22. ;
  23. ;Mac and Rmac are two reliable assemblers developed by Digital
  24. ;Research which have a good number of useful features. It seems
  25. ;natural to get the most out of them.
  26. ;
  27. ;Among the features that can be added to Mac and Rmac, are the
  28. ;ability to use the period '.' and the underscore '_' as part of
  29. ;symbol names such as labels, even as first character of the
  30. ;symbol. The underscore, for instance, makes a much better word
  31. ;separator than the dollar '$' sign when used in a multi-word
  32. ;label. In a dense program listing, it's certainly easier to find
  33. ;STAT_PORT than STAT$PORT, and @hl_to_de than @hl$to$de.
  34. ;
  35. ;By the same token, I don't agree with the decision of Digital
  36. ;Research of making the dollar sign a don't care character. It
  37. ;introduces confusion as it allows symbols that don't look the
  38. ;same to be equivalent.
  39. ;
  40. ;In addition, RMAC can be easily patched to create .REL files
  41. ;where the global (external) names have up to 7 active characters.
  42. ;This helps by allowing you to create more meaningful symbol names
  43. ;and therefore improve program legibility. This change is still
  44. ;entirely compatible with the industry standard Microsoft format.
  45. ;
  46. ;The following patches should be assembled with MAC (not RMAC)
  47. ;and the resulting hex file should be applied over the original
  48. ;programs with DDT, SID or ZSID. KEEP AN ARCHIVE COPY OF THE
  49. ;ORIGINAL MAC OR RMAC BEFORE PATCHING.
  50.  
  51.  
  52. FALSE    EQU    0
  53. TRUE    EQU    NOT FALSE
  54.  
  55. RMAC    EQU    TRUE        ;select one and only one of these
  56. MAC    EQU    FALSE        ;true
  57.  
  58.     IF    RMAC
  59. GLOBAL7        EQU    TRUE    ;set to false if you don't want
  60.                 ;7 char globals
  61. PATCHAREA    EQU    13BH
  62. DOLLARCOUNTS    EQU    1D7AH    ;set this to false if you like to 
  63.                 ;keep the dollar as a don't care char
  64. CHECKALFA    EQU    1D9CH
  65. TOUP        EQU    2844H
  66.     ENDIF
  67.  
  68.     IF    MAC
  69. COPYRITE    EQU    103H    ;shorten but keep the copyright notice
  70. DOLLARCOUNTS    EQU    1834H
  71. CHECKALFA    EQU    1853H
  72.     ENDIF
  73.  
  74.     IF    MAC
  75.  
  76.     ORG    COPYRITE
  77.     DB    '(c)1977 DRI'
  78. PATCHAREA:
  79.     ENDIF
  80.  
  81.     IF    RMAC
  82.     ORG    PATCHAREA
  83.     ENDIF
  84.  
  85.     CPI    '.'
  86.     RZ
  87.     CPI    '_'
  88.     RZ
  89.     CPI    '?'
  90.     RZ
  91.     CPI    '@'
  92.     RZ
  93.     IF    RMAC
  94.     CALL    TOUP
  95.     ENDIF
  96.     SUI    'A'
  97.     CPI    'Z'-'A'+1
  98.     CMC
  99.     RET
  100.  
  101.     IF    RMAC AND GLOBAL7
  102.  
  103. COMPARE    EQU    12D6H
  104. SETIT7    EQU    12DBH
  105.  
  106.     ORG    COMPARE
  107.     CPI    8        ;replaces cpi 7
  108.     ORG    SETIT7
  109.     MVI    A,7        ;replaces mvi a,6
  110.  
  111.     ENDIF
  112.  
  113.     IF    DOLLARCOUNTS
  114.     ORG    DOLLARCOUNTS
  115.     NOP            ;replaces mov m,a
  116.     ENDIF
  117.  
  118.     ORG    CHECKALFA
  119.     CALL    PATCHAREA    ;replaces cpi 3f
  120.     CMC            ;jz    1db1
  121.     SBB    A        ;cpi    40
  122.     RET            ;jz    1db1,    etc.
  123.  
  124.  
  125.     END
  126.