From: "George R. Gonzalez" Newsgroups: alt.folklore.computers Subject: Really flexible asm macros? Date: Wed, 16 May 2001 11:13:54 -0500 Organization: University of Minnesota, Twin Cities Campus Lines: 15 Message-ID: <9du97s$fvg$1@laurel.tc.umn.edu> X-Trace: laurel.tc.umn.edu 990029885 16368 160.94.124.99 (16 May 2001 16:18:05 GMT) X-Complaints-To: usenet@laurel.tc.umn.edu X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!newsfeed-zh.ip-plus.net!news.ip-plus.net!news.tesion.net!news.belwue.de!news-stu1.dfn.de!news-mue1.dfn.de!news-nue1.dfn.de!news-lei1.dfn.de!news-fra1.dfn.de!news.tele.dk!137.192.6.2!msc1.onvoy!onvoy.com!hardy.tc.umn.edu!laurel.tc.umn.edu!not-for-mail Xref: chonsp.franklin.ch alt.folklore.computers:80623 Most asm macro call facilities are predicatbly simple and boring and unflexible, with "LABEL MACRONAME ARG1,....,(LIST ARG1,....),ARGn" beeing the typical layout. Anybody seen anything more flexible than this? I'm thinking of one from about 20 years back that was somewhat more flexible than most HLL templates or operator overloadings. Let's see if anybody else recalls.... -- George ###### From: jones@cs.uiowa.edu (Douglas W. Jones,201H MLH,3193350740,3193382879) Newsgroups: alt.folklore.computers Subject: Re: Really flexible asm macros? Date: 16 May 2001 17:55:59 GMT Organization: The University of Iowa Lines: 34 Message-ID: <9duevf$cji$1@flood.weeg.uiowa.edu> References: <9du97s$fvg$1@laurel.tc.umn.edu> NNTP-Posting-Host: pyrite.cs.uiowa.edu X-Trace: flood.weeg.uiowa.edu 990035759 12914 128.255.28.3 (16 May 2001 17:55:59 GMT) X-Complaints-To: usenet@news.uiowa.edu NNTP-Posting-Date: 16 May 2001 17:55:59 GMT Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!news-ge.switch.ch!newsfeed00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!portc.blue.aol.com.MISMATCH!portc01.blue.aol.com!uunet!dca.uu.net!news.uiowa.edu!not-for-mail Xref: chonsp.franklin.ch alt.folklore.computers:80727 From article <9du97s$fvg$1@laurel.tc.umn.edu>, by "George R. Gonzalez" : > Most asm macro call facilities are predicatbly simple and boring and > unflexible, > with "LABEL MACRONAME ARG1,....,(LIST ARG1,....),ARGn" > beeing the typical layout. There are two types of flexibility, textual and computational. Some macro languages are textually inflexible but semantically very flexible, offering paramater passing by value or by textual substitution, allowing macros that expand conditionally on the values of actual parameters, allowing recursion, etc. In these systems, the macro mechanism is turing equivalent, so you can write systems of macros that compute any function at compile or assembly time and generate the requested result directly to the compiler or assembler listing without the need to run an object program. Other macro systems, for example, the widely known macro mechanism of C (and C++) are horribly crippled. > Anybody seen anything more flexible than this? I'm thinking of one > from about 20 years back that was somewhat more flexible than most > HLL templates or operator overloadings. Here, you seem to be referring to syntactic flexibility. You might look at Jeff Kingston's Lout text formatter (it may be the best successor to TeX and LaTeX you can find, but that style of formatter is declining in popularity - it's not MS-Word compatable!) Lout macros are textually very flexible -- and computationally powerful as well. Doug Jones jones@cs.uiowa.edu ###### Newsgroups: alt.folklore.computers Subject: Re: Really flexible asm macros? References: <9du97s$fvg$1@laurel.tc.umn.edu> From: Ric Werme X-Newsreader: NN version 6.5.0 CURRENT #119 Lines: 169 Message-ID: <6YzM6.33080$e85.12285388@typhoon.ne.mediaone.net> Date: Wed, 16 May 2001 18:48:34 GMT NNTP-Posting-Host: 24.91.12.32 X-Complaints-To: abuse@mediaone.net X-Trace: typhoon.ne.mediaone.net 990038914 24.91.12.32 (Wed, 16 May 2001 14:48:34 EDT) NNTP-Posting-Date: Wed, 16 May 2001 14:48:34 EDT Organization: Road Runner Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!news-ge.switch.ch!surfnet.nl!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!chnws02.mediaone.net!chnws06.ne.mediaone.net!24.128.8.70!typhoon.ne.mediaone.net.POSTED!not-for-mail Xref: chonsp.franklin.ch alt.folklore.computers:80772 "George R. Gonzalez" writes: >Most asm macro call facilities are predicatbly simple and boring and >unflexible, >with "LABEL MACRONAME ARG1,....,(LIST ARG1,....),ARGn" >being the typical layout. >Anybody seen anything more flexible than this? Arguments is arguments. What do you expect besides "0 or more?" The key is what you can do with the arguments and MACRO-10's IRP and IRPC (Indefinite RePeat [Character]) let us do useful things with the arguments. Here's something for parsing TOPS-10 filenames (except for SFDs) that uses TULIP. ;STANDARD SUBROUTINES (IT WOULD BE NICE TO MAKE THESE INTO A ;SEPARATE PROGRAM SINCE THEY MANAGE TO POP UP ALL THE TIME.) ;PRODUCTIONS TO PARSE THE CLASSIC FILE SPECIFIER (DEV:FILE.EXT[P,PN] ;IN ITS BIGGEST FORM) ;CALL WITH REGISTER FB POINTING TO THE LOSEG FILE BLOCK TO FILL. FILSPC: PROD( ,FILI, , ) ;INIT FILE PARSER FLAGS NXTATM: PROD( ,CALL, ,SIXSCN) ;GET A NAME PROD( ":" ,DEV ,*,NXTATM) ;COLON MEANS A DEVICE PROD( "." ,NAME,*,NXTATM) ;AND PERIOD MEANS NAME PROD( "[" ,NAMX,*,PPNSCN) ;THEN BRACKET MEANS NAME OR EXT PROD( ,NAMX, , ) ;ANYTHING ELSE IS SAME PPNDON: PROD( ,RET , , ) ;QUIT WHILE AHEAD PPNSCN: PROD( ,CALL, ,OCTSCN) ;GET PROJECT NUMBER PROD( ,PROJ,*,OCTSCN) ;SAVE PROJECT. PROJ WILL FAKE CALL PROD( "]" , ,*, ) ;OPTIONAL CLOSE BRACKET PROD( ,PROG, ,PPNDON) ;MERGE WITH PROJECT OCTSCN: PROD( , ,*,. ) ;SKIP BLANKS PROD( ,OCTI, , ) ;INIT OCTAL PACKER PROD( ,OCTS,*,. ) ;HMM. MAYBE WE SHOULD DEFINE OCTIT? PROD( , , ,SKPBLA) ;SKIP BLANKS AND RETURN SIXSCN: PROD( , ,*,. ) ;SKIP BLANKS PROD( ,SIXI, , ) ;SETUP SIXBIT PACKER PROD( ,SIXS,*,. ) ;SAVE ANY ALPHANUMERICS SKPBLA: PROD( , ,*,. ) ;IGNORE BLANKS PROD( ,RET , , ) ;AND RETURN Here's the PROD macro definition: ;MACROS FOR GENERATING PRODUCTION TABLES. ; A PRODUCTION TABLE IS IN THE FORM: ;TABLE: XWD T1,D$TABL ; PROD( .. .. ..) ; ... ... ... ;ANY NUMBER OF PRODUCTIONS ;N$TABL:A.POPJ,,A.ACT1 ;DISPATCH TABLE FOR ALL ACTIONS ; A.ACT2,,A.ACT3 ; USED IN THE ABOVE PRODUCTIONS ; ... ; THIS IS GENERATED THROUGH THE FOLLOWING MACRO CALLS: ; TBLBEG (NAME) ; NAME = LABEL OF BEGINNING OF TABLE. THIS IS USED IN THE CALL TO LEXINT. ; THIS ASSEMBLES THE FIRST WORD OF THE TABLE, WHICH IS THE INDEXED ; POINTER OFF TO THE ACTION DISPATCH TABLE. ; PROD( TEST ,ACTION ,SCAN,NEXT) ; TEST = A CHARACTER CODE, OR A UNION OF CHARACTER CLASSES ENCLOSED ; IN ANGLE BRACKETS, POSSIBLY PRECEDED BY "-". ; ACTION = THE NAME OF AN ACTION ROUTINE (WHICH NEED NOT BE IN THE ; SAME SUBPROGRAM). THIS ACTION ROUTINE IS ACTUALLY CALLED A.ACTION. ; SCAN = ONE OF "*", "_", OR " ", INDICATING FORWARD, REVERSE, OR NO ; SCAN AFTER ACTION ROUTINE IS EXECUTED. NOTE THAT LEXINT NOW ; HAS ONLY A ONE-CHARACTER BACKUP CAPABILITY, BUT FOR ANY SOURCE ; OF INPUT. ; NEXT = LABEL OF NEXT PRODUCTION TO BE INTERPRETED. ; TBLEND ; THIS MACRO CALL IS REQUIRED! IT FINISHES OFF THE TABLE BY GENERATING ; THE HALFWORD ACTION DISPATCH TABLE AND PURGING ALL THE ACTION DEFINITIONS ; IN PREPARATION FOR ASSEMBLING A NEW TABLE. Next page... Previous page... DEFINE TBLBEG(NAME) < INTERN NAME IFE FTDBUG,< NAME: XWD T4,D$'NAME ;POINTER TO ACTION DISPATCH TBL > IFN FTDBUG,< XWD T3,A$'NAME ;PTR TO ACTION NAME TBL, FOR TRACE NAME: 400000+T3,,D$'NAME ;POINTER TO ACTION DISPATCH TBL > PHASE 0 ;; ;SO LABELS ARE RELATIVE TO BASE $ACTN== ;; ;INIT SOME VARIABLES ;; INITIALIZE THE $NWACT MACRO, WHICH ACCUMULATES NAMES OF ALL ACTIONS USED REDEF < $ACT (POPJ) > DEFINE $TBLFN < ;; ;THIS REMEMBERS THE NAME OF THE TABLE HWDGEN (D$'NAME,<$NWACT>,$ACT,A.) IFN FTDBUG,< DEFINE $ACT(A) <;; ;THIS GENERATES AN ACTION NAME TABLE A$'NAME:&777777777400 DEFINE $ACT(B) < &777777777400 >> $NWACT >>> Next page... Previous page... DEFINE PROD(TEST,ACTION,SCAN,NEXT) < $ANG== <$NEG==0> ;; ;INIT SOME VARIABLES IFNB ,;; ;ASSIGN NEXT ACTION NUMBER SYN ZZ,N$'ACTION $NWACT REDEF,< $ACT (ACTION) ;;REMEMBER NAME OF ACTION >>> IRPC TEST ;; ;TEST FOR ANGLE BRACKETS $TESTF==EXP TEST ;; ;GET VALUE OF TEST FIELD IFL $TESTF,< ;; ;IF TEST FIELD NEGATIVE $TESTF==-$TESTF ;; ;THEN NEGATE IT $NEG== 1 ;; ;AND SET "-" FLAG > IFN $TESTF&NEGBIT,< ;; ;TEST FOR SG $NEG== 1 $TESTF==0 > IFNB ,<$NEXT==NEXT> ;; ;IF NEXT NONBLANK, USE IT IFB ,<$NEXT==.+1> ;; ;ELSE USE .+1 BYTE(1)IFIDN<*>,<1>,IFIDN<_>,<1>,$ANG,$NEG(6)IFNB,(8)$NEXT(18)$TESTF > DEFINE TBLEND < IFG .-377,< PRINTX ?PRODUCTION TABLE OVER 256 WORDS LONG > IFG $ACTN-77,< PRINTX ?OVER 63 ACTIONS IN ONE TABLE EXCEEDS WIDTH OF FIELD > DEPHASE $TBLFN ;; ;GENERATE ACTION DISPATCH TABLE DEFINE $ACT(S) < ;; ;PURGE ALL THE ACTION NUMBERS PURGE N$'S > $NWACT > DEFINE REDEF(THIS) < DEFINE $NWACT(OP,NEW) < OP >> DEFINE TSTANG(C) < IFE ASCII\C\-2017B11,<$ANG==1> > Next page... Previous page... ;FORMAT OF A PRODUCTION WORD ; BIT 0 - "*" BIT - MUST BE SIGN ; BIT 1 - "_" BIT ; BIT 2 - 0=CHAR TEST, 1=CLASS TEST ; BIT 3 - "-" BIT ; BITS 4-9 - ACTION NUMBER ; BITS 10-17 - NEXT PRODUCTION ; BITS 18-35 - CHAR OR FLAG BITS TO BE TESTED SCNBIT==1B0 ;"*" BIT RSCBIT==1B1 ;"_" BIT CLSBIT==1B2 ;CHAR/CLASS BIT NEGBIT==1B3 ;"-" BIT SG== NEGBIT ;"SIGMA" DEFINED AS -<> > Let's see if anybody else >recalls.... "Anybody else?" Where's your offering? -- Ric Werme | werme@nospam.mediaone.net http://people.ne.mediaone.net/werme | ^^^^^^^ delete ###### From: Jim Thomas Newsgroups: alt.folklore.computers Subject: Re: Really flexible asm macros? Date: 16 May 2001 14:15:46 -1000 Organization: Canada France Hawai`i Telescope Lines: 11 Message-ID: References: <9du97s$fvg$1@laurel.tc.umn.edu> NNTP-Posting-Host: atlas.cfht.hawaii.edu X-Trace: news.hawaii.edu 990058546 21635 128.171.80.135 (17 May 2001 00:15:46 GMT) X-Complaints-To: usenet@hawaii.edu NNTP-Posting-Date: 17 May 2001 00:15:46 GMT X-Newsreader: Gnus v5.7/Emacs 20.6 Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!newsfeed-zh.ip-plus.net!news.ip-plus.net!news.tesion.net!news.belwue.de!news-stu1.dfn.de!news-mue1.dfn.de!news-was.dfn.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!hammer.uoregon.edu!news.hawaii.edu!not-for-mail Xref: chonsp.franklin.ch alt.folklore.computers:80747 >>>>> "George" == George R Gonzalez writes: George> Most asm macro call facilities are predicatbly simple and boring and George> unflexible, George> with "LABEL MACRONAME ARG1,....,(LIST ARG1,....),ARGn" George> beeing the typical layout. George> Anybody seen anything more flexible than this? Other than keyword versus positional, what else do you propose? How are you extending the concept of mathematical functions? ###### Newsgroups: alt.folklore.computers From: john Latala Subject: Re: Really flexible asm macros? In-Reply-To: <9du97s$fvg$1@laurel.tc.umn.edu> Message-ID: References: <9du97s$fvg$1@laurel.tc.umn.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Lines: 14 Date: Wed, 16 May 2001 22:03:20 -0400 NNTP-Posting-Host: 199.166.210.115 X-Complaints-To: abuse@golden.net X-Trace: radon.golden.net 990065002 199.166.210.115 (Wed, 16 May 2001 22:03:22 EDT) NNTP-Posting-Date: Wed, 16 May 2001 22:03:22 EDT Organization: Golden Triangle On Line Inc. Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!news-ge.switch.ch!newsfeed00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.skycache.com!Cidera!radon.golden.net!shell.golden.net!jrlatala Xref: chonsp.franklin.ch alt.folklore.computers:80642 On Wed, 16 May 2001, George R. Gonzalez wrote: > Anybody seen anything more flexible than this? I'm thinking of one > from about 20 years back that was somewhat more flexible than most > HLL templates or operator overloadings. Let's see if anybody else > recalls.... Many Unix systems have an interesting macro processing package called m4 that you might want to look at. -- john R. Latala jrlatala@golden.net ###### From: "George R. Gonzalez" Newsgroups: alt.folklore.computers Subject: Re: Really flexible asm macros? Date: Thu, 17 May 2001 10:03:02 -0500 Organization: University of Minnesota, Twin Cities Campus Lines: 23 Message-ID: <9e0pf8$oqd$1@laurel.tc.umn.edu> References: <9du97s$fvg$1@laurel.tc.umn.edu> X-Trace: laurel.tc.umn.edu 990112040 25421 160.94.124.99 (17 May 2001 15:07:20 GMT) X-Complaints-To: usenet@laurel.tc.umn.edu X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!newsfeed-zh.ip-plus.net!news.ip-plus.net!Amsterdam.Infonet!News.Amsterdam.UnisourceCS!skynet.be!news.tele.dk!137.192.6.2!msc1.onvoy!onvoy.com!hardy.tc.umn.edu!laurel.tc.umn.edu!not-for-mail Xref: chonsp.franklin.ch alt.folklore.computers:80702 Ok, nobody bit, another hint: How about macros that can act as operators, accept arguments on either or both sides of the keyword, have the "keyword" be other than alphanumeric, recognize special argument separators that you specify, not limited to line-oriented operation on both macro call and generated output, .... more. This assembler came with a much-ignored and much-lamented in some parts OS, circa 1980. System was waaay ahead of it's time, with windows, modeless throughout, peer-to-peer networking, all running in 128K. Surely somebody remembers.....? ###### From: "Russell B. Kegley" Newsgroups: alt.folklore.computers Subject: Re: Really flexible asm macros? Date: Thu, 17 May 2001 10:13:20 -0500 Organization: LM Aero NewsGroup Server Lines: 26 Message-ID: <3B03EA90.B4769A8E@lmco.com> References: <9du97s$fvg$1@laurel.tc.umn.edu> NNTP-Posting-Host: CAA171582.lmtas.lmco.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.72 [en]C-CCK-MCD {C-UDP; LMTAS} (WinNT; U) X-Accept-Language: en Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!news-ge.switch.ch!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!denver-snf1.gtei.net!news.gtei.net!coop.net!newsfeed1.global.lmco.com!svlnews.lmms.lmco.com!news1.lmtas.lmco.com!not-for-mail Xref: chonsp.franklin.ch alt.folklore.computers:81064 "George R. Gonzalez" wrote: > Most asm macro call facilities are predicatbly simple and boring and > unflexible, > with "LABEL MACRONAME ARG1,....,(LIST ARG1,....),ARGn" > beeing the typical layout. > > Anybody seen anything more flexible than this? I'm thinking of one > from about 20 years back that was somewhat more flexible than most > HLL templates or operator overloadings. Let's see if anybody else > recalls.... > > -- George This book also covers your question. Might be available in bigger libraries, and I've seen it in used bookstores from time to time. @book{407, author = {P. J. Brown}, title = {Macro Processors and Techniques for Portable Software}, month = {January}, year = {1974}, url = {http://www.cs.ukc.ac.uk/pubs/1974/407}, publisher = {Wiley}, } ###### From: Brian Inglis Newsgroups: alt.folklore.computers Subject: Re: Really flexible asm macros? Date: Thu, 17 May 2001 20:34:14 -0600 Organization: Systematic Software Lines: 41 Message-ID: References: <9du97s$fvg$1@laurel.tc.umn.edu> Reply-To: Brian.dot.Inglis@SystematicSw.ab.ca NNTP-Posting-Host: h-207-148-137-45.dial.cadvision.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news3.cadvision.com 990153255 26487 207.148.137.45 (18 May 2001 02:34:15 GMT) X-Complaints-To: news@cadvision.com NNTP-Posting-Date: Fri, 18 May 2001 02:34:15 +0000 (UTC) X-Newsreader: Forte Agent 1.8/32.548 Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!news-ge.switch.ch!news.maxwell.syr.edu!newsfeed.direct.ca!look.ca!nntp.cadvision.com!207.228.64.17.MISMATCH!not-for-mail Xref: chonsp.franklin.ch alt.folklore.computers:81033 On Wed, 16 May 2001 11:13:54 -0500, "George R. Gonzalez" wrote: >Most asm macro call facilities are predicatbly simple and boring and >unflexible, >with "LABEL MACRONAME ARG1,....,(LIST ARG1,....),ARGn" >beeing the typical layout. > >Anybody seen anything more flexible than this? I'm thinking of one >from about 20 years back that was somewhat more flexible than most >HLL templates or operator overloadings. Let's see if anybody else >recalls.... I remember writing structured programming macros in macro-11 about 25 years ago -- spaces could be used instead of commas to separate arguments and comments started with ";", so you could write something like (keywords may have been different): IF R1 LT R2 AND (R6) EQ #9 THEN ... ELSE ... FI WHILE R3 LT R4 OR DO ... OD SWITCH @(R5)+ CASE n ... ESAC Thanks. Take care, Brian Inglis Calgary, Alberta, Canada -- Brian.Inglis@CSi.com (Brian dot Inglis at SystematicSw dot ab dot ca) fake address use address above to reply tosspam@aol.com abuse@aol.com abuse@yahoo.com abuse@hotmail.com abuse@msn.com abuse@sprint.com abuse@earthlink.com abuse@cadvision.com abuse@ibsystems.com uce@ftc.gov spam traps ###### From: gah@ugcs.caltech.edu (glen herrmannsfeldt) Newsgroups: alt.folklore.computers Subject: Re: Really flexible asm macros? Date: 18 May 2001 18:59:40 GMT Organization: California Institute of Technology, Pasadena Lines: 24 Message-ID: <9e3res$3p0@gap.cco.caltech.edu> References: <9du97s$fvg$1@laurel.tc.umn.edu> <3B03EA90.B4769A8E@lmco.com> NNTP-Posting-Host: seniti.ugcs.caltech.edu X-Newsreader: NN version 6.5.0 #1 (NOV) Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!news-ge.switch.ch!newsfeeds.belnet.be!news.belnet.be!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!canoe.uoregon.edu!logbridge.uoregon.edu!nntp-server.caltech.edu!gah Xref: chonsp.franklin.ch alt.folklore.computers:80900 "George R. Gonzalez" wrote: > Most asm macro call facilities are predicatbly simple and boring and > unflexible, > with "LABEL MACRONAME ARG1,....,(LIST ARG1,....),ARGn" > beeing the typical layout. > > Anybody seen anything more flexible than this? I'm thinking of one >> from about 20 years back that was somewhat more flexible than most > HLL templates or operator overloadings. Let's see if anybody else > recalls.... The IBM system 360/370/390 assemblers have a much better macro facility than other assemblers that I know of. PL/I has the best of any HLL that I know of, including compile time (that is, preprocessing) loops and procedure calls. One could run assembly code through another preprocessor, but assembly macros have that form because that is the form of assembly code. Note that the 360/370/390 assemblers pass the label to the macro, unlike all others that I know about. -- glen