home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / SIMTEL / CPMUG / CPMUG051.ARK / ABSTRACT.051 < prev    next >
Text File  |  1984-04-29  |  2KB  |  41 lines

  1. Abstract for National CP/M Users Group Vol. 51,
  2.     "STAGE2 Macro Processor"
  3.  
  4.  
  5.     Richard Curtiss implemented STAGE2, wrote many of the
  6. sample programs, and did an excellent job of commenting on his
  7. own work.  INTRO.DOC and VOLUME51.DOC, provide not only doc-
  8. umentation, but "insight", which is normally the service an
  9. "abstract" serves.  Because of such good documentation, (and
  10. this disk is full), this abstract will be brief.
  11.     STAGE2 is "cryptic", but quite interesting.  Many of
  12. you will enjor "experimenting with it", and many will make
  13. regular use of it.
  14.     What is a "macro processor"?  A program, which "trans-
  15. forms" or "expands" character strings, into something else.
  16. Traditional uses were in assembler programming, allowing you
  17. to say, for example, " OPEN MYFILE,INPUT,4096", rather than
  18. having to code the necessary assembler instructions.  Richard
  19. Curtiss uses it to expand ANY language he uses on his micro,
  20. to add structured programming:  IF/THEN, WHILE, REPEAT, etc.
  21. The macros generate the proper GOTOs, etc, no matter what the
  22. language
  23.     STAGE2 was written in "FLUB", a machine-independent
  24. simple language.  The FLUB source for STAGE2 is on the disk.
  25. IMPL.DOC goes into the details.  You could transport STAGE2 to
  26. some other processor, quite readily.
  27.     The only thing missing is some documentation on the
  28. "state machine" macros of ALX.  VDB.ALX, a video driver for a
  29. memory-mapped display, uses them.  You are normally in ST1
  30. (state 1) waiting for characters.  If you get an ESC, you go
  31. to ST2, because you are awaiting a control sequence.  Then, if
  32. you receive a "Y", it is cursor addressing, so you set the
  33. next state to ST3 via "SETNEXT ( NSTATE = ST3 )" to get the
  34. row, then when its received, "SETNEXT ( NSTATE = ST4 )", i.e.
  35. state 4 to receive the column.  Then reset to state 1.
  36.     The NSTATE DW is the address of the next state (rou-
  37. tine) you will be in, and "EXECUTE ( NSTATE )" expands to
  38. "branch to what is stored in NSTATE.
  39.  
  40.     Abstract by Ward Christensen
  41.