home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / tptools.zip / FIRSTED.ZIP / MSMESG.ASM < prev    next >
Assembly Source File  |  1987-12-21  |  14KB  |  331 lines

  1. ;
  2. ;       MSMESG.ASM
  3. ;       ED 4.0
  4. ;       Copyright (c) 1985, 87 by Borland International, Inc.
  5. ;
  6. ;       Message area and access routine
  7. ;
  8.  
  9. DATA    SEGMENT BYTE PUBLIC
  10.  
  11. DATA    ENDS
  12.  
  13. CODE    SEGMENT BYTE PUBLIC
  14.  
  15.         ASSUME  CS:CODE,DS:DATA
  16.  
  17.         PUBLIC  EdMessagePtr
  18.  
  19. ;CS-relative data:
  20. ;Be sure to terminate list with a pair of 0 bytes
  21.  
  22. Messages LABEL BYTE
  23. ;first two bytes are message number
  24. ;next byte is string length
  25.       db   2,  0, 15, ' File not found'
  26.       db   3,  0, 15, ' Path not found'
  27.       db   5,  0, 19, ' File access denied'
  28.       db  21,  0, 26, ' Typeahead buffer overflow'
  29.       db  22,  0, 22, ' Window size too small'
  30.       db  25,  0, 34, ' Word too long for current margins'
  31.       db  26,  0, 20, ' No block is defined'
  32.       db  28,  0, 22, ' Invalid marker number'
  33.       db  29,  0, 24, ' Marker has not been set'
  34.       db  30,  0, 17, ' Marker not found'
  35.       db  31,  0,  9, ' No files'
  36.       db  32,  0, 12, ' Press <Esc>'
  37.       db  33,  0, 12, ' to continue'
  38.       db  34,  0, 26, ' Cannot read from a device'
  39.       db  35,  0, 20, ' Insufficient memory'
  40.       db  36,  0, 16, ' Invalid integer'
  41.       db  37,  0, 16, ' Command aborted'
  42.       db  38,  0, 10, ' Not found'
  43.       db  39,  0, 28, ' Main program file not found'
  44.       db  40,  0, 25, ' Pagination not activated'
  45.       db  41,  0, 14, ' Line too long'
  46.       db  42,  0, 39, ' Cannot play back macro while recording'
  47.       db  45,  0, 27, ' Problem closing print file'
  48.       db  46,  0, 34, ' Problem closing print output file'
  49.       db  47,  0, 31, ' Valid page numbers are 1..4095'
  50.       db  48,  0, 35, ' Temporary margin not available now'
  51.       db  49,  0, 44, ' Default extension may not contain wildcards'
  52.       db  50,  0, 23, ' Not a valid macro file'
  53.       db  51,  0, 25, ' Error reading help index'
  54.       db  52,  0, 33, ' No help available for this topic'
  55.       db  53,  0, 24, ' Error reading help text'
  56.       db  54,  0, 33, ' Help section exceeds buffer size'
  57.       db  55,  0, 39, ' Select lower level menu to access help'
  58.       db  56,  0, 31, ' You only have one window open!'
  59.       db  57,  0, 34, ' Turbo Lightning must be installed'
  60.       db  58,  0, 40, ' Set path to AUXI.DIC in Lightning Setup'
  61.       db  59,  0, 31, ' Cursor must be in marked block'
  62.       db  60,  0, 28, ' Word wrap must be activated'
  63.       db  61,  0, 36, ' Not a valid printer definition file'
  64.       db  62,  0, 50, ' Open Window command must have keystrokes assigned'
  65.       db  63,  0, 46, ' Temporary margin must be left of right margin'
  66.       db  64,  0, 27, ' Help file MS.HLP not found'
  67.       db  65,  0, 39, ' Save modified document before printing'
  68.       db  66,  0, 36, ' Start page is larger than stop page'
  69.       db  67,  0, 21, ' Print file not found'
  70.       db  68,  0, 26, ' Output file not specified'
  71.       db  71,  0, 44, ' Enhanced graphics adapter must be installed'
  72.       db  72,  0, 36, ' Integer outside of acceptable range'
  73.       db  73,  0, 41, ' Cannot apply macro within Find-and-Macro'
  74.       db  74,  0, 26, ' Unable to reload AUXI.DIC'
  75.       db 100,  0, 16, ' Disk read error'
  76.       db 101,  0, 17, ' Disk write error'
  77.       db 104,  0, 27, ' Unable to create .BAK file'
  78.       db 106,  0, 52, ' Root menu must be specified first in menu data file'
  79.       db 107,  0, 46, ' Too many submenus specified in menu data file'
  80.       db 108,  0, 40, ' Error in level number in menu data file'
  81.       db 111,  0, 21, ' Turn on font display'
  82.       db 120,  0, 30, ' Window is too small to divide'
  83.       db 122,  0, 23, ' Invalid directory path'
  84.       db 124,  0, 21, ' Unable to invoke DOS'
  85.       db 125,  0, 31, ' Insufficient contiguous memory'
  86.       db 126,  0, 32, ' Insufficient stack buffer space'
  87.       db 127,  0, 33, ' Cannot create another window now'
  88.       db 128,  0, 38, ' DOS critical error - Device not ready'
  89.       db 153,  0, 23, ' Unexpected end of file'
  90.       db 240,  0, 26, ' Disk write error occurred'
  91.       db 241,  0, 38, ' File creation error or directory full'
  92.       db 246,  0, 25, ' Done with spelling check'
  93.       db 247,  0, 22, ' MicroStar Help System'
  94.       db 248,  0, 15, ' Initialization'
  95.       db 249,  0,  6, ' Reset'
  96.       db 250,  0,  5, ' Page'
  97.       db 251,  0,  5, ' Byte'
  98.       db 252,  0,  5, ' Line'
  99.       db 253,  0,  5, ' Word'
  100.       db 254,  0,  6, ' Words'
  101.       db 255,  0, 47, ' Updating file statistics, press a key to abort'
  102.       db   0,  1, 41, ' Enter empty string to use current column'
  103.       db   1,  1, 41, ' Select from menu, <Esc> to quit checking'
  104.       db   2,  1, 29, ' Initializing for spell check'
  105.       db   3,  1, 11, ' Lower case'
  106.       db   4,  1, 25, ' First letter capitalized'
  107.       db   5,  1, 11, ' Upper case'
  108.       db   6,  1, 17, ' Exactly as shown'
  109.       db   7,  1, 12, '    for more'
  110.       db   8,  1, 10, ' Skip once'
  111.       db   9,  1, 25, ' Ignore for this document'
  112.       db  10,  1, 28, ' List Lightning sound-alikes'
  113.       db  11,  1, 19, ' Edit from keyboard'
  114.       db  12,  1, 14, ' Mark with "~"'
  115.       db  13,  1, 18, ' Add to dictionary'
  116.       db  14,  1, 28, ' Batch mark rest of document'
  117.       db  15,  1, 47, ' Select from menu, <Esc> to exit without adding'
  118.       db  16,  1, 21, ' Edit word as desired'
  119.       db  17,  1, 60, ' Keypad to edit, <Enter> to accept, <Esc> to leave unchanged'
  120.       db  18,  1, 27, ' Marking unrecognized words'
  121.       db  19,  1, 27, ' Stop spelling check? (Y/N)'
  122.       db  20,  1, 18, ' Add to dictionary'
  123.       db  21,  1, 20, ' Word not recognized'
  124.       db  22,  1, 18, ' Checking spelling'
  125.       db  23,  1, 13, ' Alternatives'
  126.       db  24,  1, 29, ' No likely alternatives found'
  127.       db  25,  1, 25, ' Scanning for soundalikes'
  128.       db  26,  1, 16, ' Help and status'
  129.       db  27,  1, 16, ' Cursor movement'
  130.       db  28,  1, 15, ' Quick movement'
  131.       db  29,  1, 18, ' Insert and delete'
  132.       db  30,  1, 19, ' Search and replace'
  133.       db  31,  1,  6, ' Files'
  134.       db  32,  1,  8, ' Windows'
  135.       db  33,  1,  7, ' Blocks'
  136.       db  34,  1, 14, ' Text commands'
  137.       db  35,  1,  5, ' Tabs'
  138.       db  36,  1, 10, ' Utilities'
  139.       db  37,  1, 21, ' Settings and toggles'
  140.       db  38,  1, 15, ' Spell checking'
  141.       db  39,  1,  7, ' Macros'
  142.       db  40,  1,  9, ' Printing'
  143.       db  41,  1, 14, ' Function keys'
  144.       db  42,  1, 33, ' Press <Esc> to leave help system'
  145.       db  43,  1, 21, ' <PgDn> for next page'
  146.       db  44,  1, 22, ' <PgUp> for prior page'
  147.       db  45,  1,  9, ' New File'
  148.       db  46,  1, 63, ' Use keypad to edit, wildcards for directory, <Enter> to accept'
  149.       db  47,  1, 15, ' Directory mask'
  150.       db  48,  1, 53, ' Use  to browse, <Enter> to select, <Esc> to ignore'
  151.       db  49,  1, 24, ' Press <Esc> to continue'
  152.       db  50,  1, 23, ' not saved. Save? (Y/N)'
  153.       db  51,  1, 30, ' Enter Macro File name to load'
  154.       db  52,  1, 31, ' Enter Macro File name to store'
  155.       db  53,  1, 13, ' File exists!'
  156.       db  54,  1, 21, ' Filename to Write to'
  157.       db  55,  1, 20, ' Go to Column number'
  158.       db  56,  1, 18, ' Go to Line number'
  159.       db  57,  1,  8, ' Windows'
  160.       db  58,  1, 32, ' Insert Macro (Number of Times<='
  161.       db  59,  1, 22, ' Choose macro to apply'
  162.       db  60,  1, 22, ' Choose macro to store'
  163.       db  61,  1, 22, ' New Drive or Pathname'
  164.       db  62,  1, 16, ' Options (UBGWL)'
  165.       db  63,  1, 22, ' Overwrite file? (Y/N)'
  166.       db  64,  1, 17, ' Pathname of file'
  167.       db  65,  1, 10, ' Read file'
  168.       db  66,  1, 10, ' Save file'
  169.       db  67,  1, 11, ' Search for'
  170.       db  68,  1, 14, ' Help Sections'
  171.       db  69,  1,  8, ' Reading'
  172.       db  70,  1, 10, ' Searching'
  173.       db  71,  1,  8, ' Working'
  174.       db  72,  1, 15, ' RAM bytes free'
  175.       db  73,  1, 11, ' (Y/N/A/Q):'
  176.       db  74,  1, 13, ' Apply Macro?'
  177.       db  75,  1, 30, ' Approximate memory available:'
  178.       db  77,  1, 32, ' DOS command (<Enter> for shell)'
  179.       db  78,  1, 24, ' Printer Definition File'
  180.       db  79,  1, 19, ' Current Directory:'
  181.       db  80,  1, 16, ' Disk bytes free'
  182.       db  81,  1, 17, ' Options (UBGWLN)'
  183.       db  82,  1, 13, ' Replace with'
  184.       db  83,  1,  9, ' Replace?'
  185.       db  84,  1, 13, ' Right Margin'
  186.       db  85,  1, 36, ' Type EXIT to return to MicroStar...'
  187.       db  86,  1, 29, ' -- Press any key to continue'
  188.       db  87,  1, 18, ' MicroStar Version'
  189.       db  88,  1, 12, ' Left Margin'
  190.       db  89,  1, 49, ' Insert paper, press <Enter> to continue printing'
  191.       db  90,  1, 14, ' File to print'
  192.       db  91,  1, 13, ' MicroStar...'
  193.       db  96,  1, 13, ' DOS Version:'
  194.       db  98,  1,  6, ' Bytes'
  195.       db  99,  1, 43, ' Use  to resize window, <Enter> to accept'
  196.       db 100,  1, 17, ' Default Tab Size'
  197.       db 101,  1, 18, ' Go to Page Number'
  198.       db 102,  1, 11, ' Top Margin'
  199.       db 103,  1, 14, ' Bottom Margin'
  200.       db 104,  1, 12, ' Page Length'
  201.       db 105,  1, 11, ' Undo limit'
  202.       db 106,  1,  7, ' Colors'
  203.       db 107,  1, 25, ' Error reading print file'
  204.       db 108,  1, 21, ' Printer out of paper'
  205.       db 109,  1, 17, ' Printer off line'
  206.       db 110,  1, 23, ' Printer not responding'
  207.       db 111,  1, 32, ' Error writing print output file'
  208.       db 112,  1, 31, ' Printer command stack overflow'
  209.       db 113,  1, 22, ' Unknown printer error'
  210.       db 114,  1, 35, ' - <Esc> to abort, <Enter> to retry'
  211.       db 115,  1,  7, ' Append'
  212.       db 116,  1, 10, ' Overwrite'
  213.       db 117,  1, 16, ' Printer Strings'
  214.       db 118,  1,  8, ' Choices'
  215.       db 119,  1, 52, '  to select item, <Enter> to change, <Esc> to quit'
  216.       db 120,  1, 56, '  to select color, <Enter> to change, <Esc> to ignore'
  217.       db 121,  1, 22, ' 3 Character Extension'
  218.       db 122,  1, 12, ' Print Setup'
  219.       db 123,  1, 10, ' Available'
  220.       db 124,  1, 12, ' Not Visible'
  221.       db 125,  1,  8, ' Markers'
  222.       db 126,  1,  8, ' Not Set'
  223.       db 127,  1,  7, ' Macros'
  224.       db 128,  1,  8, ' No Name'
  225.       db 129,  1, 11, ' Macro Name'
  226.       db 130,  1, 22, ' File Name to Write to'
  227.       db 131,  1, 62, '  to select, <Ins> to add, <Del> to delete, <Enter> to accept'
  228.       db 132,  1, 22, ' Abort printing? (Y/N)'
  229.       db 133,  1, 20, ' Press <Esc> to exit'
  230.       db 134,  1,  7, ' Device'
  231.       db 135,  1, 18, ' Print Output File'
  232.       db 136,  1, 11, ' First Page'
  233.       db 137,  1, 10, ' Last Page'
  234.       db 138,  1, 10, ' for menus'
  235.       db 141,  1,  6, ' Pages'
  236.       db 142,  1,  9, ' Modified'
  237.       db 143,  1, 13, ' Not Modified'
  238.       db 144,  1,  6, ' Lines'
  239.       db 145,  1, 19, ' Stored defaults in'
  240.       db 146,  1, 14, ' Current File:'
  241.       db 148,  1, 21, ' Choose macro to edit'
  242.       db 149,  1, 61, ' <ScrollLock> for literal, <CtrlBkSp> clears, <Enter> accepts'
  243.       db 150,  1, 12, ' Normal Text'
  244.       db 151,  1, 13, ' Marked Block'
  245.       db 152,  1, 14, ' Window Status'
  246.       db 153,  1, 12, ' Prompt Line'
  247.       db 154,  1, 13, ' Block Cursor'
  248.       db 155,  1, 10, ' Menu Text'
  249.       db 156,  1, 11, ' Menu Frame'
  250.       db 157,  1, 12, ' Menu Select'
  251.       db 158,  1, 12, ' Menu Hilite'
  252.       db 159,  1, 10, ' Bold text'
  253.       db 160,  1, 13, ' Doublestrike'
  254.       db 161,  1, 11, ' Underscore'
  255.       db 162,  1, 12, ' Superscript'
  256.       db 163,  1, 10, ' Subscript'
  257.       db 164,  1, 11, ' Compressed'
  258.       db 165,  1,  7, ' Italic'
  259.       db 166,  1, 13, ' Snow Control'
  260.       db 167,  1, 13, ' Block Cursor'
  261.       db 168,  1, 13, ' 43 Line Mode'
  262.       db 169,  1,  6, ' Fonts'
  263.       db 170,  1, 14, 'Print file now'
  264.       db 172,  1, 12, 'Name of file'
  265.       db 173,  1, 15, 'Auto formatting'
  266.       db 174,  1, 10, 'First page'
  267.       db 175,  1,  9, 'Last page'
  268.       db 177,  1, 13, 'Which printer'
  269.       db 178,  1,  6, 'Device'
  270.       db 179,  1, 17, 'Manual paper feed'
  271.       db 180,  1, 13, 'Use formfeeds'
  272.       db 181,  1, 18, 'Edit printer codes'
  273.       db 182,  1, 18, 'Save printer setup'
  274.       db   0,  0                             ;Terminate with pair of zeros
  275.  
  276. ;****************************************************** EdMessagePtr
  277.  
  278. ;  function EdMessagePtr(msgno:word) : Pointer; external;
  279.  
  280. ;    {-Return a pointer to the message string, nil if not available}
  281.  
  282. MsgNo           EQU       WORD PTR [BP+4]
  283.  
  284. EdMessagePtr    PROC NEAR
  285.  
  286.         PUSH    BP                      ;Save BP
  287.         MOV     BP,SP                   ;Set up stack frame
  288.         PUSH    DS                      ;Save DS
  289.  
  290.         MOV     BX,MsgNo                ;Get message number to seek
  291.  
  292.         MOV     AX,CS
  293.         MOV     DS,AX                   ;Put CS into DS
  294.         ASSUME  DS:CODE
  295.         LEA     SI,Messages             ;Now DS:SI points to Messages
  296.         CLD                             ;Forward direction
  297.  
  298. EMPNext:
  299.         LODSW                           ;Next message number into AX
  300.         OR      AX,AX                   ;Last message?
  301.         JZ      EMPNotFound
  302.         CMP     AX,BX                   ;The message we seek?
  303.         JZ      EMPFound
  304.         LODSB                           ;Get length byte of string
  305.         XOR     AH,AH                   ;Clear upper byte
  306.         ADD     SI,AX                   ;Skip over string
  307.         JMP     Short EMPNext           ;Try again
  308.  
  309. EMPNotFound:
  310.         XOR     DX,DX                   ;Clear pointer if Message not found
  311.                                         ;AX is already zero is we get here
  312.         JMP     Short EMPDone
  313.  
  314. EMPFound:
  315.                                         ;Return pointer in DX:AX
  316.         MOV     DX,CS                   ;Pointer Segment is current CS
  317.         MOV     AX,SI                   ;SI points to length byte of string
  318.  
  319. EMPDone:
  320.         POP     DS                      ;Restore DS
  321.         ASSUME  DS:DATA
  322.         MOV     SP,BP                   ;Restore SP
  323.         POP     BP                      ;Restore BP
  324.         RET     2                       ;Remove parameter from stack
  325.  
  326. EdMessagePtr    ENDP
  327.  
  328. CODE    ENDS
  329.  
  330.         END
  331.