home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / snma / arexx / easyasm.rexx < prev    next >
OS/2 REXX Batch file  |  1977-12-31  |  1KB  |  50 lines

  1. /*
  2.     EasyAsm.rexx
  3.     This little ARexx program assembles files using SNMA Arexx host.
  4.     This one uses direct snma output, as opposed to ShellAsm.
  5.     To use, you must set snma to the following state:
  6.     rx "address snma set outfile on rxerr off keepsource off"
  7.  
  8.     All the flags are not neccessarily required, but certainly useful.
  9.     (See documents, chapter 4.2.7 Arexx/SET for more info).
  10.  
  11.     When you start snma, you can redirect output file to the "CON:..".
  12.     This is especially important if you use snma from the different Shell
  13.     you started it, as default output would otherwise go to the Shell
  14.     snma was stated from.
  15.  
  16. */
  17.  
  18. if arg() ~= 1 THEN  DO
  19.     say 'Usage: rx ShellAsm.rexx "CMDLINE"'
  20.     exit    5
  21.     end
  22. arg cmd
  23. address SNMA
  24. call Assemble(cmd)
  25. 'FREE'                      /* free source, errors..., just in case*/
  26. exit
  27.  
  28.  
  29. /*
  30.    Following routine will assemble and display information about it
  31.    Now this one takes one argument , commandline
  32.    "Ram Disk:"
  33. */
  34. Assemble:
  35.  
  36.   options RESULTS
  37.   arg cmd
  38.   cmd=strip(cmd,B,'"')            /* strip leading and trailing "s */
  39.   mydir=pragma('d')
  40.   mydir=insert('"',mydir,0)
  41.   mydir=insert('"',mydir,length(mydir))
  42.  
  43.   'SET  outfile on rxerr off keepsource off'
  44.  
  45.   CHDIR mydir                     /* change the current directory of the snma */
  46.   say "Calling SNMA: ASM" cmd
  47.   ASM cmd                         /* assemble it */
  48. return  /* End of Assembly */
  49.  
  50.