home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / asmutl / chkif.lbr / CHKIF.DZC / CHKIF.DOC
Encoding:
Text File  |  1987-09-09  |  2.8 KB  |  59 lines

  1.                 Documentation for CHKIF.PAS by J.Loke 87Sep07
  2.  
  3.      One of the most annoying errors that can crop up in an assembly language
  4. program is the BALANCE error.  This occurs when conditional assembly modules
  5. or macro statments are not bracketed properly.  The assemblers I use only
  6. report that such an error has occured, but don't actually locate the error.
  7.  
  8.      I found that visual scanning of a program longer than 3000 lines was not
  9. very productive.  Hence the program CHKIF, written in TURBO Pascal.  This
  10. scanner processes .ASM, .Z80 or .PRN files, checking that IF-ELSE-ENDIF
  11. statements are matched properly.  It also handles MACRO/REPT/IRP/IRPC-EXITM-
  12. ENDM pseudo-ops, and takes the multi-statement lines of ASM and MAC, etc.
  13. provided they are delimited with exclamation marks!
  14.  
  15.      Invoking CHKIF without parameters displays a short usage message:
  16.                    "Usage:  CHKIF [-Q] <file>     -Q=Quiet"
  17.  
  18. For example, to scan the file B:Z3CCP.PRN, you would type:
  19.                              A>CHKIF B:Z3CCP.PRN
  20. During scanning, lines with conditional or macro assembly pseudo-ops are
  21. displayed on the console.  If this chews up the paper on your teletype, use
  22. the -Q option to turn off all output except the summary at the end.
  23.  
  24.  
  25.                            Errors detected by CHKIF
  26.  
  27. *ENDIF: No matching IF          ENDIF detected before IF
  28.  
  29. *IF: Too many IF's              Most assemblers handle nesting to 8 levels. 
  30.                                 CHKIF will report errors above level 8, but
  31.                                 can manage 16 levels of nesting in case you
  32.                                 really goofed and forgot all your ENDIF's!
  33.  
  34. *ELSE: Missing IF               ELSE detected before IF
  35.  
  36. *ELSE: Missing ENDIF            IF-ELSE-ELSE construct attempted.  Tsk, Tsk!
  37.  
  38. *MACRO: Too many MACRO's        Macro nesting beyond level 8.  Again CHKIF
  39.                                 will handle up to 16 levels before crashing.
  40.  
  41. *EXITM: Missing MACRO           EXITM detected before any MACRO pseudo-op
  42.  
  43. *ENDM: Missing MACRO            ENDM detected before any MACRO pseudo-op
  44.  
  45. CHKIF: Missing ENDIF.           These reports the state of the IF/ELSE/ENDIF
  46.  Unmatched IF at line #####     stack.  The lines reported will help you
  47.  Unmatched ELSE at line #####   track down that error.
  48.  
  49. CHKIF: Missing ENDM.            Similarly, this reports the state of the
  50.  Unmatched MACRO at line #####  MACRO stack.
  51.  
  52.                                   Disclaimer
  53.  
  54.      CHKIF is provided for non-commercial distribution distribution as is. 
  55. Direct any enquiries to me via EASTWOOD RCP/M Melbourne Australia (03)8704623.
  56.  
  57. End of Documentation
  58.  distribution as is. 
  59. Direct any enquiries to me via EASTWOOD RCP/M Melbourne Australia (03)8704623.