Shmuel Metz (Seymour J.) wrote:

In
<[EMAIL PROTECTED]>,
on 05/31/2007
  at 01:38 PM, "Flint, Mike" <[EMAIL PROTECTED]> said:

Does anyone know of a product that will take HLASM source and produce
object or executables for the wintel platform?

Such a product would not be a cross assembler but a machine to machine
translator. Those have been around for decades, but expect some manual
recoding of what it can't handle and expect the output to be difficult
to maintain.

It is possible to write code that runs on both the mainframe and a PC.

There are a few things you have to change ONCE, but really very, very
little.  I developed thousands of lines of code that run on the PC or
the mainframe with no changes.

One is to use the a macro called DATASECT instead of CSECT for your
variables.  Because there is not the same concept of Based storage on a
PC, this allows all variables to go into the PCs data section. I supply
a DATASECT macro for the mainframe that simply says "CSECT".

And because MASM and TASM (x86 assemblers) are one pass assemblers, it
is better to move your variables (DC's and DS's) to the front of the
program.

I think that is about it.  There are some GOTCHAs but not too many.
Macros are a problem, and one way over that is to run the Z/OS Assembler
listing into a converter, and then use the instructions from the macro.
That has been done by someone in this forum, but my method allows full
debugging and virtually instantaneous turn around when using the Borland
C compiler.  And, I didn't have easy access to a mainframe at the time.
So it was all good, and I learned an enormous amount about PC in the
year or so it took to build it. But if the interest was there, using the listing could be done.

Regarding the speed of the resultant code - it is plenty fast.  I
suspect that a lot of us think PCs are slow because of our experience
with Windows.  Windows is code bloat personified, and the C string
problem just makes then perform much slower than they should.

But of course x86 doesn't have 16 general purpose registers, and so
storage is used for them which is slower.  But, it really is fine, and
there is only one user!

What I might do is add a TPUT instruction that interfaces to a 3270
simulator.  Now, that would be a useful enhancement.  Or someone else
might like to do it. There's an invitation. Then, who needs a mainframe? (Gosh, did I really say that?)

Cheers,

Clem

"Imagination is more important than knowledge" - Albert Einstein

"Reality is merely an illusion, albeit a very persistent one." - Albert Einstein

,-._|\  Clement V. Clarke - Author Jol, EASYJCL, EASYPANEL, 370TO486
/  Oz  \ Web: http://www.ozemail.com.au/~oscarptyltd
\_,--.x/ 16/38 Kings Park Road, West Perth, AUSTRALIA, 6005.
     v  Tel (61)-8-9324-1119, Mob 0401-054-155.
        Email: [EMAIL PROTECTED]

Here's an example from the 370TO486 manual:

*--------------------------------------------------------------------
* sample Read/Write assembler language program - Docsamp.bal
*--------------------------------------------------------------------
*
* This code is the OPEN for 370 for the 370 code translator.
*
* Mainframe Assembler uses a DCB which specifies RECFM, LRECL etc,
*       and the OPEN instruction, which actually opens the file.
*
* We will (later) use the DDNAME as PL/I does, but for now,
*       we will use a DSN= specific keyword in the DCB.
*
*
* Put your data first after the DATASECT, then follow with code.
*
datamips Datasect
LOOPCNT  DC  F'65536'
RECAREA  DC  CL1000
*
*
CVCDCB  DCB LRECL=80,BLKSIZE=4096,EODAD=XXX,MACRF=GM,RECFM=T,     XXXXXXX
          DSNAME='docsamp.bak'
CVCDCBO DCB LRECL=80,BLKSIZE=4096,EODAD=XXX,MACRF=PM,RECFM=V,     XXXXXXX
          DSNAME='testopenout.new'
*
   COPY IHADCB
*
CODE370  CSECT
    GENSAVE CSECT=MAIN
*
    wtor 'Enter the Dsname of the file to Copy',recarea,44
    cli   recarea,C' '
    be    usedef                Use the default
    LA    R15,CVCDCB
    using IHADCB,R15
    la    R1,DCBDSN             Instruction not needed
    MVC   DCBDSN,RECAREA
usedef  open CVCDCB
     open CVCDCBO,(OUTPUT)
IOLOOP    get  CVCDCB,recarea
     put  CVCDCBO,recarea
     B    IOLOOP
    return (14,12)
*
XXX   DS 0H
     WTO 'End of File'
     return (14,12)
     end










Here's an example programs

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to