home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / os968ka / k6opsf.asm < prev    next >
Assembly Source File  |  2020-01-01  |  29KB  |  495 lines

  1.           nam       Kermit68K
  2.           ttl       Parser subroutines module
  3.  
  4. *         Kermit68K: source file K68PSF
  5. *
  6. * Author: Roberto Bagnara (Bagnara@Iboinfn.Bitnet),
  7. * Bologna University, Physics Department, July 1987.
  8. *
  9. * All rights reserved to Bologna University, Italy.
  10. *
  11. * Permission is granted to any individual or institution
  12. * to use, copy, or redistribute this software so long as
  13. * it  is not  sold for  profit, provided  this copyright
  14. * notice is retained.
  15. *
  16. * Modification History:
  17. *
  18. * Version  Date    Who              Comments
  19. *
  20. * 1.0.00   870701  Roberto Bagnara  First official release
  21.  
  22.           use       DefsFile
  23.  
  24. Edition   equ       0
  25.           psect     K68ParserSubs,0,0,Edition,0,0
  26.  
  27. ******************************** ParsWrd ******************************ok
  28. *                                                                     *
  29. *  Parse a word string.                                               *
  30. *                                                                     *
  31. *         Entry conditions : A0.L points to the target string         *
  32. *                            A5.L points to the current position      *
  33. *                                 in the source line                  *
  34. *                                                                     *
  35. *         Exit  conditions : A0.L points to the last byte of          *
  36. *                                 the target string                   *
  37. *                            A5.L points to the current position      *
  38. *                                 in the source line                  *
  39. *                            D0.B completion code                     *
  40. *                                                                     *
  41. *                            -3 nothing to look up (source was null)  *
  42. *                             0 all ok                                *
  43. *                                                                     *
  44. ***********************************************************************
  45. ParsWrd:  BSR      SkipSpr             Skip leading separators
  46.           TST.B    (A5)                Null source ?
  47.           BEQ.S    ParsWrd4            Yes, return this
  48. ParsWrd1  MOVE.B   (A5)+,D0            No, get the first character
  49.           BEQ.S    ParsWrd2            End of line, exit loop
  50.           CMPI.B   #' ',D0             Blank ?
  51.           BEQ.S    ParsWrd3            Yes, exit loop
  52.           CMPI.B   #Asc_HT,D0          Tab ?
  53.           BEQ.S    ParsWrd3            Yes, exit loop
  54.           MOVE.B   D0,(A0)+            No, store the character
  55.           BRA.S    ParsWrd1            Loop until end of word
  56. ParsWrd2  SUBQ.L   #1,A5               Backup line pointer
  57. ParsWrd3  CLR.B    (A0)                Terminate target
  58.           MOVEQ    #0,D0               Return positive completion code
  59.           RTS
  60. ParsWrd4  CLR.B    (A0)                Terminate target
  61.           MOVEQ    #-3,D0              Return null source completion code
  62.           RTS
  63.  
  64. ******************************** ParsTxt ******************************ok
  65. *                                                                     *
  66. *  Parse a text string, quoted or unquoted, this is to allow the      *
  67. *  specification of trailing delimiters.                              *
  68. *                                                                     *
  69. *         Entry conditions : A0.L points to the target string         *
  70. *                            A5.L points to the current position      *
  71. *                                 in the source line                  *
  72. *                                                                     *
  73. *         Exit  conditions : A0.L points to the last byte of          *
  74. *                                 the target string                   *
  75. *                            A5.L points to the current position      *
  76. *                                 in the source line                  *
  77. *                            D0.B completion code                     *
  78. *                            D1.B destroyed                           *
  79. *                                                                     *
  80. *                            -3 nothing to look up (source was null)  *
  81. *                             0 all ok                                *
  82. *                                                                     *
  83. ***********************************************************************
  84. ParsTxt:  BSR      SkipSpr             Skip leading separators
  85.           MOVE.B   (A5)+,D0            Get the first character, null source ?
  86.           BEQ.S    ParsTxt7            Yes, return null target cc
  87.           CMPI.B   #$22,D0             Look for a quote character (")
  88.           BEQ.S    ParsTxt1
  89.           CMPI.B   #$27,D0             Look for a quote character (')
  90.           BEQ.S    ParsTxt1
  91.           CMPI.B   #$60,D0             Look for a quote character (`)
  92.           BNE.S    ParsTxt2
  93. ParsTxt1  MOVE.B   D0,D1               Save the quote character
  94.           BRA.S    ParsTxt4
  95. ParsTxt2  CLR.B    D1                  Clear the quote register
  96. ParsTxt3  MOVE.B   D0,(A0)+            Write character to target string
  97. ParsTxt4  MOVE.B   (A5)+,D0            Get a character
  98.           BEQ.S    ParsTxt6            If end of line exit loop
  99.           CMP.B    D0,D1               Quote character again ?
  100.           BNE.S    ParsTxt3            No, write char to target, stay in loop
  101.           CLR.B    (A0)                Yes, terminate target
  102. ParsTxt5  MOVEQ    #0,D0               Return positive completion code
  103.           RTS
  104. ParsTxt6  MOVE.B   -(A5),(A0)          Backup line pointer and terminate target
  105.           BRA.S    ParsTxt5            Return positive completion code
  106. ParsTxt7  MOVE.B   -(A5),(A0)          Backup line pointer and terminate target
  107.           MOVEQ    #-3,D0              Return null source completion code
  108.           RTS
  109.  
  110. ******************************** ParsNm *******************************ok
  111. *                                                                     *
  112. *  Parse a number.                                                    *
  113. *                                                                     *
  114. *         Entry conditions : D1.L range specification, lower bound    *
  115. *                            D2.L range specification, upper bound    *
  116. *                            A5.L points to the current position      *
  117. *                                 in the source line                  *
  118. *                                                                     *
  119. *         Exit  conditions : D0.L parsed number (if any)              *
  120. *                            D1.B completion code                     *
  121. *                            A0.L destroyed                           *
  122. *                            A1.L destroyed                           *
  123. *                            A5.L points to the current position      *
  124. *                                 in the source line                  *
  125. *                                                                     *
  126. *                            -3 nothing to parse (source was null)    *
  127. *                            -2 number out of range                   *
  128. *                            -1 illegal number specification          *
  129. *                             0 all ok, number in D0.L                *
  130. *                                                                     *
  131. ***********************************************************************
  132. ParsNm:   MOVEM.L   D3-D6,-(A7)        Save working registers
  133.           LEA       DataBuf(A6),A1     Pointer to temporary buffer
  134.           MOVEA.L   A1,A0              Put here the parsed word
  135.           BSR       ParsWrd            Get a word from the source line
  136.           TST.B     D0                 Null source ?
  137.           BLT       ParsNm12           Yes, return this condition code
  138.           MOVEA.L   A1,A0              Set up for addressing
  139.           CLR.L     D0                 Clear the number register
  140.           CLR.L     D3                 Clear the character register
  141.           MOVE.B    (A0)+,D3           Get the first character
  142.           CMPI.B    #'$',D3            Hexadecimal ?
  143.           BEQ.S     ParsNm1            Yes, set base register
  144.           CMPI.B    #'\',D3            Octal ?
  145.           BEQ.S     ParsNm2            Yes, set base register
  146.           CMPI.B    #'%',D3            Binary ?
  147.           BEQ.S     ParsNm3            Yes, set base register to binary
  148.           MOVEQ     #10,D4             No, set base register to decimal
  149.           BRA.S     ParsNm5
  150. ParsNm1   MOVEQ     #16,D4             Set base register to hexadecimal
  151.           BRA.S     ParsNm4
  152. ParsNm2   MOVEQ     #8,D4              Set base register to octal
  153.           BRA.S     ParsNm4
  154. ParsNm3   MOVEQ     #2,D4              Set base register to binary
  155. ParsNm4   MOVE.B    (A0)+,D3           Got a base specification, get next
  156.           BEQ.S     ParsNm10           End of word, invalid number
  157. ParsNm5   CMPI.B    #'-',D3            Look for a minus sign
  158.           SEQ       D5                 Set a flag accordingly
  159.           BNE.S     ParsNm6            Enter the conversion loop
  160.           MOVE.B    (A0)+,D3           Got a minus sign, get next
  161.           BEQ.S     ParsNm10           End of word, invalid number
  162. ParsNm6   BSR       UppCase
  163.           SUBI.B    #'0',D3            First offset
  164.           BLT.S     ParsNm10           Less than '0', invalid number
  165.           CMPI.B    #9,D3              Above 9 ?
  166.           BLE.S     ParsNm7            No
  167.           SUBQ.B    #7,D3              Yes, second offset
  168. ParsNm7   CMP.B     D4,D3              Above the base value ?
  169.           BGE.S     ParsNm10           Yes, invalid number specification
  170.           MOVE.L    D0,D6              Make some computation
  171.           MULU      D4,D0
  172.           SWAP      D6
  173.           MULU      D4,D6
  174.           SWAP      D6
  175.           CLR.W     D6
  176.           ADD.L     D6,D0
  177.           ADD.L     D3,D0
  178.           MOVE.B    (A0)+,D3           Get the next character, if any
  179.           BNE.S     ParsNm6            Repeat until end of word
  180.           TST.B     D5                 Negative number ?
  181.           BEQ.S     ParsNm8            No
  182.           NEG.L     D0                 Yes, negate it
  183. ParsNm8   CMP.L     D1,D0              Less than lower bound ?
  184.           BLT.S     ParsNm11           Yes, return the proper cc
  185.           CMP.L     D2,D0              Greater than upper bound ?
  186.           BGT.S     ParsNm11           Yes, return the proper cc
  187.           MOVEQ     #0,D1              Provide positive completion code
  188. ParsNm9   MOVEM.L   (A7)+,D3-D6        Restore working registers
  189.           RTS
  190. ParsNm10  MOVEA.L   A1,A0              Pointer to the guilty word
  191.           LEA       PrNmStr1(PC),A1    Pointer to the error message string
  192.           BSR       ParsErr            Give the appropriate message
  193.           MOVEQ     #-1,D1             Return invalid number cc
  194.           BRA.S     ParsNm9
  195. ParsNm11  MOVEA.L   A1,A0              Pointer to the guilty word
  196.           LEA       PrNmStr2(PC),A1    Pointer to the error message string
  197.           BSR       ParsErr            Give the appropriate message
  198.           MOVEQ     #-2,D1             Return number out of range cc
  199.           BRA.S     ParsNm9
  200. ParsNm12  SUBA.L    A0,A0              No guilty word in this case
  201.           LEA       PrNmStr3(PC),A1    Pointer to the error message string
  202.           BSR       ParsErr            Give the appropriate message
  203.           MOVEQ     #-3,D1             Return missing number specification cc
  204.           BRA.S     ParsNm9
  205.  
  206. ******************************** ParsKyW ******************************ok
  207. *                                                                     *
  208. *  Parse a keyword, giving, on error, appropriate messages.           *
  209. *                                                                     *
  210. *         Entry conditions : D1.B flag for mandatory keywords         *
  211. *                            A1.L points to keywords table            *
  212. *                            A5.L points to the current position      *
  213. *                                 in the source line                  *
  214. *                                                                     *
  215. *         Exit  conditions : D0.B completion code                     *
  216. *                                                                     *
  217. *                            -3 nothing to look up (source was null)  *
  218. *                            -2 ambiguous keyword                     *
  219. *                            -1 keyword not found                     *
  220. *                            n >= 0 value associated with keyword     *
  221. *                                                                     *
  222. *                            D2.B destroyed                           *
  223. *                            A0.L destroyed                           *
  224. *                            A1.L destroyed                           *
  225. *                            A2.L destroyed                           *
  226. *                                                                     *
  227. ***********************************************************************
  228. ParsKyW:  LEA       DataBuf(A6),A2     Pointer to temporary buffer
  229.           MOVEA.L   A2,A0              Put here the parsed word
  230.           BSR       ParsWrd            Get a word from the source line
  231.           MOVEA.L   A2,A0              Set up for addressing
  232.           BSR       Lookup             Search the keyword in the given table
  233.           TST.B     D0                 Some error condition reported ?
  234.           BGE.S     ParsKyW5           No, return value in D0.B
  235.           MOVE.B    D0,D2              Yes, save the completion code
  236.           ADDQ.B    #1,D0              Unrecognized keyword ?
  237.           BEQ.S     ParsKyW1           Yes, give error message
  238.           ADDQ.B    #1,D0              Ambiguous keyword ?
  239.           BEQ.S     ParsKyW2           Yes, give error message
  240.           TST.B     D1                 No, missing keyword, was it mandatory ?
  241.           BEQ.S     ParsKyW4           No, no message, return bad cc
  242.           LEA       PrKyStr3(PC),A0    Yes, give missing keyword error message
  243.           BSR       ConWrite           Write the message
  244.           MOVEA.L   A1,A0              Write the requested object name
  245.           BSR       ConWrite
  246.           BSR       NewLine            Start a new line
  247.           BRA.S     ParsKyW4           Newline and return
  248. ParsKyW1  LEA       PrKyStr1(PC),A0    Give unrecognized keyword error message
  249.           BRA.S     ParsKyW3           Join common part
  250. ParsKyW2  LEA       PrKyStr2(PC),A0    Give ambiguous keyword error message
  251. ParsKyW3  BSR       ConWrite           Write the error type string
  252.           MOVEA.L   A1,A0              Write the requested object name
  253.           BSR       ConWrite
  254.           MOVEA.L   A2,A0              Write the guilty word
  255.           SUBA.L    A1,A1              Error message already given
  256.           BSR       ParsErr
  257. ParsKyW4  MOVE.B    D2,D0              Restore the completion code from LookUp
  258. ParsKyW5  RTS
  259.  
  260. ******************************* ParsInF *******************************ok
  261. *                                                                     *
  262. *  Parse an input file name specification.                            *
  263. *                                                                     *
  264. *         Entry conditions : A0.L point to the target string          *
  265. *                            A5.L points to the current position      *
  266. *                                 in the source line                  *
  267. *                                                                     *
  268. *         Exit  conditions : D0.B completion code                     *
  269. *                                                                     *
  270. *                            -3 nothing to parse (source was null)    *
  271. *                            -2 illegal file name specification       *
  272. *                             0 all ok                                *
  273. *                                                                     *
  274. *                            A1.L destroyed                           *
  275. *                            A5.L points to the current position      *
  276. *                                 in the source line                  *
  277. *                                                                     *
  278. ***********************************************************************
  279. ParsInF:  MOVEA.L   A0,A1              Save the target pointer
  280.           BSR       ParsWrd            Get a word from the command line
  281.           TST.B     D0                 Null source ?
  282.           BLT.S     ParsInF2           Yes, return this
  283.           MOVEA.L   A1,A0              Reload target pointer
  284.           BSR       ChkWild            Check for wild characters
  285.           TST.B     D0                 Wild filename ?
  286.           BNE.S     ParsInF3           Yes, try to expand it
  287.           BSR       ChkInpF            Check if file exists and is readable
  288.           TST.B     D0                 Inexistent or unreadable file ?
  289.           BLT.S     ParsInF5           Yes, give error message
  290. ParsInF1  MOVEQ     #0,D0              No, all ok, return positive cc
  291. ParsInF2  RTS
  292. ParsInF3  BSR       ExpandFN           Try to expand the wild file name
  293.           TST.L     D0                 Check the result
  294.           BGT.S     ParsInF1           All ok, at least one match
  295.           BLT.S     ParsInF4           Too many matches, give error message
  296.           LEA       PrIFStr4(PC),A0    No matches, error
  297.           BRA.S     ParsInF8           Join common part
  298. ParsInF4  LEA       PrIFStr5(PC),A0    Notify overflow during name expansion
  299.           BRA.S     ParsInF8           Join common part
  300. ParsInF5  ADDQ.B    #1,D0              File not found ?
  301.           BEQ.S     ParsInF6           Yes
  302.           ADDQ.B    #1,D0              File not readable ?
  303.           BEQ.S     ParsInF7           Yes
  304.           LEA       PrIFStr3(PC),A0    No, read permission denied
  305.           BRA.S     ParsInF8           Join common part
  306. ParsInF6  LEA       PrIFStr1(PC),A0    File not found error message
  307.           BRA.S     ParsInF8           Join common part
  308. ParsInF7  LEA       PrIFStr2(PC),A0    File not readable error message
  309. ParsInF8  EXG       A0,A1              Setup pointers
  310.           BSR       ParsErr            Call the error messages routine
  311.           MOVEQ     #-2,D0             Return a negative completion code
  312.           RTS
  313.  
  314. ******************************* ParsOuF *******************************ok
  315. *                                                                     *
  316. *  Parse an output file name specification.                           *
  317. *                                                                     *
  318. *         Entry conditions : A0.L point to the target string          *
  319. *                            A5.L points to the current position      *
  320. *                                 in the source line                  *
  321. *                                                                     *
  322. *         Exit  conditions : A5.L points to the current position      *
  323. *                                 in the source line                  *
  324. *                            D0.B completion code                     *
  325. *                                                                     *
  326. *                            -3 nothing to parse (source was null)    *
  327. *                            -2 illegal output file name              *
  328. *                             0 all ok                                *
  329. *                                                                     *
  330. ***********************************************************************
  331. ParsOuF:  MOVEA.L   A0,A1              Save the target pointer
  332.           BSR       ParsWrd            Get a word from the command line
  333.           TST.B     D0                 Null source ?
  334.           BLT.S     ParsOuF1           Yes, return this
  335.           MOVEA.L   A1,A0              Reload target pointer
  336.           BSR       ChkWild            Check for wild characters
  337.           TST.B     D0                 Wild filename ?
  338.           BNE.S     ParsOuF2           Yes, give error message
  339.           BSR       ChkOutF            Check if file can be created
  340.           TST.B     D0                 Permission denied ?
  341.           BLT.S     ParsOuF3           Yes, give error message
  342.           MOVEQ     #0,D0              No, all ok, return positive cc
  343. ParsOuF1  RTS
  344. ParsOuF2  LEA       POuFStr1(PC),A0    Give wildcard not allowed error message
  345.           BRA.S     ParsOuF4           Join common part
  346. ParsOuF3  LEA       POuFStr2(PC),A0    Give permission denied error message
  347. ParsOuF4  EXG       A0,A1              Setup pointers
  348.           BSR       ParsErr            Call the error messages routine
  349.           MOVEQ     #-2,D0             Return negative completion code
  350.           RTS
  351.  
  352. ******************************* ChkWild *******************************ok
  353. *                                                                     *
  354. *  Check a string for wildcard character presence.                    *
  355. *                                                                     *
  356. *         Entry conditions : A0.L points to the string to check       *
  357. *                                                                     *
  358. *         Exit  conditions : D0.B completion code                     *
  359. *                            A0.L points to the checked string        *
  360. *                                                                     *
  361. ***********************************************************************
  362. ChkWild:  MOVE.L    A0,-(A7)           Save the string pointer
  363. ChkWild1  MOVE.B    (A0)+,D0           Get a character
  364.           BEQ.S     ChkWild3           End of string, exit loop, return false
  365.           CMPI.B    #'*',D0            Match-all wildcard character ?
  366.           BEQ.S     ChkWild2           Yes, the file name is wild
  367.           CMPI.B    #'?',D0            Match-one wildcard character ?
  368.           BNE.S     ChkWild1           No, loop until end of string
  369. ChkWild2  ST        D0                 Yes, exit loop, return true
  370. ChkWild3  MOVE.L    (A7)+,A0           Restore the string pointer
  371.           RTS
  372.  
  373. ********************************* Lookup ******************************ok
  374. *                                                                     *
  375. *  Lookup a keyword in the given array of keywords.                   *
  376. *                                                                     *
  377. *         Entry conditions : A0.L points to the source string         *
  378. *                                 null terminated                     *
  379. *                            A1.L points to the keywords table        *
  380. *                                                                     *
  381. *         Exit  conditions : D0.B completion code                     *
  382. *                                                                     *
  383. *                            -3 nothing to look up (target was null)  *
  384. *                            -2 ambiguous keyword                     *
  385. *                            -1 keyword not found                     *
  386. *                            n >= 0 value associated with keyword     *
  387. *                                                                     *
  388. *                            A0.L points to the source string         *
  389. *                                 null terminated                     *
  390. *                            A1.L points to the object name           *
  391. *                                                                     *
  392. ***********************************************************************
  393. Lookup    MOVEM.L   A2/D1-D4,-(A7)     Save working registers
  394.           CLR.B     D1                 Clear matchs counter
  395.           TST.B     (A0)               Null keyword ?
  396.           BNE.S     Lookup2            No, continue
  397. Lookup1   MOVE.B    (A1)+,D4           Yes, skip to end of table
  398.           CMPI.B    #-1,D4             End of table ?
  399.           BNE.S     Lookup1            No, loop
  400.           MOVEQ     #-3,D0             Return nothing to look up cc
  401.           BRA.S     Lookup8
  402.  
  403. Lookup2   MOVE.B    (A1)+,D4           Get the value associated to this word
  404.           CMPI.B    #-1,D4             End of table ?
  405.           BEQ.S     Lookup7            Yes, check if match(s) occurred
  406.           MOVEA.L   A0,A2
  407.  
  408. Lookup3   MOVE.B    (A2)+,D3           Get next character from command line
  409.           BEQ.S     Lookup4            End of word, match !
  410.           BSR       UppCase            Upper case it for compare
  411.           MOVE.B    (A1)+,D2           Get a character from table
  412.           BEQ.S     Lookup2            End of word, no match, try the next
  413.           CMP.B     D3,D2              Match ?
  414.           BNE.S     Lookup5            No, skip to the next table element
  415.           BRA.S     Lookup3            Yes, look to the next character
  416.  
  417. Lookup4   TST.B     (A1)               Match found, is a supermatch ?
  418.           BEQ.S     Lookup6            Yes, stop searching
  419.           ADDQ.B    #1,D1              No, increment matchs counter
  420.           MOVE.B    D4,D0              Load the return value
  421. Lookup5   MOVE.B    (A1)+,D2           Skip to next table element
  422.           BNE.S     Lookup5            Skip characters until end of word
  423.           BRA.S     Lookup2            Scan all the table elements
  424.  
  425. Lookup6   MOVE.B    D4,D0              Supermatch found, load the return value
  426.           BRA.S     Lookup8
  427.  
  428. Lookup7   CMPI.B    #1,D1              Check matchs counter
  429.           BLT.S     Lookup9            If no match return keyword not found cc
  430.           BGT.S     Lookup10           More than 1, ambiguous keyword cc
  431. Lookup8   MOVEM.L   (A7)+,A2/D1-D4     Restore working registers
  432.           RTS
  433. Lookup9   MOVEQ     #-1,D0             Return the keyword not found cc
  434.           BRA.S     Lookup8
  435. Lookup10  MOVEQ     #-2,D0             Return the ambiguous keyword cc
  436.           BRA.S     Lookup8
  437.  
  438. ********************************* ParsErr *****************************ok
  439. *                                                                     *
  440. *  Give a parsing error message.                                      *
  441. *                                                                     *
  442. *         Entry conditions : A0.L point to the guilty word            *
  443. *                                 null terminated, no guilty word     *
  444. *                                 to print if null pointer passed     *
  445. *                            A1.L point to the error message, no      *
  446. *                                 message to print if null pointer    *
  447. *                                 passed                              *
  448. *                                                                     *
  449. *         Exit  conditions : D0.L destroyed                           *
  450. *                            D1.L destroyed                           *
  451. *                                                                     *
  452. ***********************************************************************
  453. ParsErr:  EXG       A0,A1              Write the error string first, if any
  454.           MOVE.L    A0,D1              Null pointer passed ?
  455.           BEQ.S     ParsErr1           Yes, no error message
  456.           BSR       ConWrite           No, write it
  457. ParsErr1  MOVE.L    A1,D1              Null pointer passed ?
  458.           BEQ.S     ParsErr4           Yes, no guilty word
  459.           LEA       PrErStr1(PC),A0    No, point to separator string
  460.           BSR       ConWrite           Write it to terminal
  461.           MOVEQ     #'"',D0            Type the leading quotation mark
  462.           BSR       ConOut
  463. ParsErr2  MOVE.B    (A1)+,D0           And then the guilty word
  464.           BEQ.S     ParsErr3           If end of word, exit loop
  465.           BSR       ConOut             Write a character
  466.           BRA.S     ParsErr2           And the next, if any
  467. ParsErr3  MOVEQ     #'"',D0            Type the trailing quotation mark
  468.           BSR       ConOut
  469. ParsErr4  BSR       NewLine            Start a new line
  470.           RTS
  471.  
  472. ******************************* SkipSpr *******************************ok
  473. *                                                                     *
  474. *  Skip leading separators from the command line.                     *
  475. *                                                                     *
  476. *         Entry conditions : A5.L point to the current position       *
  477. *                            in the command line                      *
  478. *                                                                     *
  479. *         Exit  conditions : D0.B destroyed                           *
  480. *                            A5.L point to the current position       *
  481. *                            in the command line                      *
  482. *                                                                     *
  483. ***********************************************************************
  484. SkipSpr   MOVE.B    (A5)+,D0           Get a character
  485.           BEQ.S     SkipSpr1           End of buffer, exit
  486.           CMPI.B    #' ',D0            Blank ?
  487.           BEQ.S     SkipSpr            Yes, skip
  488.           CMPI.B    #Asc_HT,D0         Tab ?
  489.           BEQ.S     SkipSpr            Yes, skip
  490. SkipSpr1  SUBQ.L    #1,A5              Backup line pointer
  491.           RTS
  492.  
  493.           ends
  494.           END
  495.