Here's one way to do standard EXecute without a base register: AHI R2,-1 Minus 1 for EX *!not yetEXRL R2,_EX_MVC_OUTPUT (Move data to output buffer) LARL R10,_EX_MVC_OUTPUT Move data to EX R2,0(,R10) output buffer
I believe, for most applications, "baseless" code is the way to go moving forward when writing new code or refactoring existing code. Of course, required are bases for save area/local stack and constants/LTORG. A program manages bases for other data areas, just as always -- passed-in-by-reference parameters, heap storage, control blocks, I/O buffers, et cetera. Changing B-s to J-s, BCT to BRCT, et cetera, is tedious but simple ("change all"). One may encounter macros (IBM and otherwise) in existing code that, as traditionally used, have required a base -- there are ways to deal with those. All in all, I've found this entails a relatively small learning curve and amount of effort and cures one of the greatest headaches associated with assembler coding. Doug Watkins http://www.compuware.com/ The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it. From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On Behalf Of Tom Marchant Sent: Tuesday, June 05, 2012 5:20 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Base registers On Tue, 5 Jun 2012 15:59:36 -0400, Scott Ford wrote: >where can you find a good sample of baseless assembler code ? Look for Ed Jaffe's SHARE presentation "Jumpify your code". "Baseless" is not an accurate description, IMO. You still need base registers to reference data. You can, however, use very few base registers for your code simply by using relative branches ("jump"). There are one or two exceptions, depending upon your hardware. One is that there is no indexed relative branch. It's hard for me to imagine what such a thing would do anyway. The other is that EXRL was introduced (IIRC) on the z10. The standard EXecute instruction requires a base register. -- Tom Marchant