home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / proasm / rexx / ced / proasm.ced < prev    next >
Text File  |  1996-04-29  |  4KB  |  99 lines

  1. /*****************************************************************************
  2. *                                                                            *
  3. * ARexx script:              ProAsm.ced v1.02     for the ProAsm Assembler   *
  4. *                                                                            *
  5. * This script assembles the source in the actual view of the CygnusEd using  *
  6. * the ProAsm assembler and the ASX user interface.                           *
  7. *                                                                            *
  8. * by Daniel Weber                                                            *
  9. * 26.May.93                                                                  *
  10. *                                                                            *
  11. * Tue Jul 20 1993  cschneid: 'Beg Of File' added, jumping to 1st error       *
  12. *                                                                            *
  13. *                                                                            *
  14. * Usage:   ProAsm.ced                                                        *
  15. *                                                                            *
  16. *                                                                            *
  17. * How to run:                                                                *
  18. *                                                                            *
  19. *  1) Activate the view of the source file.                                  *
  20. *  2) Start this ARexx script via 'Send DOS/ARexx command...'                *
  21. *                                                                            *
  22. *****************************************************************************/
  23.  
  24. editorID = 'CygnusEd'                   /* define editor ID             */
  25.  
  26. OPTIONS RESULTS
  27.  
  28. ADDRESS 'rexx_ced'                      /* get some information from the CED */
  29. status 15
  30. fileadr = result                        /* file address of actual view  */
  31. status 19
  32. name = result                           /* complete path and filename   */
  33. status 57
  34. oldline = result                        /* current line numer           */
  35.  
  36. 'Beg Of File'                           /* ensure file is updated       */
  37.  
  38. ADDRESS 'asx_rexx'
  39. FindID editorID':'name
  40. port = result
  41. DO WHILE port~=''
  42.   ADDRESS (''||port)
  43.   EndOfAssembly                         /* quit all open jobs of this source */
  44.   ADDRESS 'asx_rexx'
  45.   FindID editorID':'name
  46.   port = result
  47. END
  48.  
  49.  
  50. BegOfAssembly                           /* begin a new job              */
  51. port = result
  52.  
  53. IF port~='' THEN DO
  54.   ADDRESS (''||port)                    /* ARexx weirdness              */
  55.   DefineID editorID':'name              /* set an ID (optional)         */
  56.   Assemble ADDRESS fileadr
  57.  
  58.   PARSE VAR result . errors . warnings . optims optimbytes . codesize . workspace
  59.  
  60.  
  61.   IF errors~=0 THEN DO            /* jump to first error          */
  62.     NextError                           /* get next error               */
  63.     errortxt = result
  64.  
  65.     ADDRESS 'rexx_ced'
  66.     IF errortxt ='' THEN DO
  67.       Okay1 'no more errors'
  68.       exit(0)
  69.     END
  70.  
  71.     PARSE VALUE errortxt WITH 1 LineNumber ' : ' ErrorMsg ' in file ' filename
  72.     IF filename ~='' THEN DO
  73.       status 66
  74.       DO numwins= result-1 TO 1 BY -1 UNTIL UPPER(result) = UPPER(filename)
  75.         next view
  76.         status 21
  77.       END
  78.       IF UPPER(result) ~= UPPER(filename) THEN DO
  79.       split view
  80.       open filename
  81.       END
  82.     END
  83.     Jump To Line LineNumber
  84.     Okay1 ErrorMsg
  85.   END
  86.  
  87.   ELSE DO
  88.     stat = codesize 'bytes.' '0A'X''optims 'optimizations saved' optimbytes 'bytes' '0A'X
  89.     stat = stat''errors 'Errors,' warnings 'Warnings,' workspace 'bytes of workspace used.'
  90.  
  91.     ADDRESS 'rexx_ced'
  92.     Jump To Line oldline
  93.     Okay1 "File '"name"'"'0A'X"assembled to" stat
  94.   END
  95. END
  96.  
  97. EXIT(0)
  98.  
  99.