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 / ALX-.DOC < prev    next >
Text File  |  1984-04-29  |  2KB  |  107 lines

  1.         ASSEMBLY LANGUAGE EXTENSION PREPROCESSOR
  2.  
  3. This application of STAGE2 to enhance assembly language programs with a few
  4. control structures is included with this STAGE2 package mainly for example.
  5. No user documentation is provided but it should not be difficult to see how
  6. to use it by trying the examples provided.
  7.  
  8.     Examples:
  9.         STAGE2 ALXTEST.ASM,ALXTEST.LST=ALX.MAC,ALXTEST.ALX
  10.  
  11.         STAGE2 BOUT.ASM,BOUT.LST=ALX.MAC,BOUT.ALX
  12.  
  13.  
  14. IMPLEMENTATION NOTES:
  15.  
  16.     > means push   ^ means pop   C means condition
  17.  
  18.     Stack        Source Statements    Generated Code
  19.  
  20.     >n >K        IF ( C )            JCF    n
  21.  
  22.     ^K ^n            FIN            n:
  23.  
  24.     -----------------------------------------------------------
  25.  
  26.     >n >n+1 >W    WHEN ( C )            JCF    n+1
  27.  
  28.     ^W >E            FIN                JMP    n
  29.  
  30.     ^E ^n+1 >K    ELSE            n+1:
  31.  
  32.     ^K ^n            FIN            n:
  33.  
  34.     -----------------------------------------------------------
  35.  
  36.     >B        BRANCH
  37.  
  38.                 ( V1 )  L1            CPI    V1
  39.                             JZ    L1
  40.  
  41.                 ( V2 | V3 | V4 )  L2    CPI    V2
  42.                             JZ    L2
  43.                             CPI    V3
  44.                             JZ    L2
  45.                             CPI    V4
  46.                             JZ    L2
  47.  
  48.                 ( OTHERWISE )  L3        JMP    L3
  49.  
  50.     ^B            FIN
  51.  
  52.     -----------------------------------------------------------
  53.  
  54.     >n >S        SELECT
  55.  
  56.     >n+1 >I            ( V1 )            CPI    V1
  57.                             JNZ    n+1
  58.  
  59.     ^I ^n+1            FIN            JMP    n
  60.                         n+1:
  61.  
  62.     >n+3 >I            ( V2 | V3 | V4 )        CPI    V2
  63.                             JZ    n+2
  64.                             CPI    V3
  65.                             JZ    n+2
  66.                             CPI    V4
  67.                             JNZ    n+3
  68.                         n+2:
  69.  
  70.     ^I ^n+3            FIN            JMP    n
  71.                         n+3:
  72.  
  73.     >O            ( OTHERWISE )
  74.  
  75.     ^O            FIN
  76.  
  77.     ^S ^n            FIN            n:
  78.  
  79.     -----------------------------------------------------------
  80.  
  81.     >n >n+1 >L    WHILE ( C )        n+1:    JCF    n
  82.  
  83.     ^L ^n+1 ^n        FIN                JMP    n+1
  84.                         n:
  85.  
  86.     -----------------------------------------------------------
  87.  
  88.     >n >R        REPEAT            n:
  89.  
  90.     ^R ^n            UNTIL ( C )            JCF    n
  91.  
  92.     -----------------------------------------------------------
  93.  
  94.     Statement is allowed if top of stack is one of the following:
  95.     I,K,L,O,R,W,*.  Otherwise particular control statements are
  96.     expected.
  97.  
  98.         I,K,L,O,W    statement or FIN
  99.  
  100.         R        statement or UNTIL
  101.  
  102.         E        ELSE only
  103.  
  104.         S        SELECT ITEM or FIN
  105.  
  106.         B        BRANCH ITEM or FIN
  107.