Displaying the character to the console from the inside hlasm (370)
For fun, I am implementing brainfuck compilers translating bf to eg. x86. I am currently working on bf to build mainframes. The dialect is "HLASM" and the mainframe is one from IBM with 370.
In most cases, Sofar only works with a character output to the operator console: I get spaces, and it looks like an implicit line feed has been added (which I don't need).
Can anyone find my error?
* get a character to display
LLGC R6,0(R7)
* get a pointer to the buffer which will contain the char to displa
LA R5,BUFFER
* store character in buffer
STC R6,0(R5)
* get a pointer to the memory area describing the data to display
LA R1,MSGAREA
* invoke display char
SVC 35
MSGAREA EQU *
DC AL2(5)
DC XL2'00'
BUFFER DC C'!'
source to share
I would suggest writing SYSOUT
DD
to give you the flexibility to run either in batch mode (highlighting SYSOUT
in yours JCL
) or interactively (highlighting SYSOUT
per terminal session, which I think is the default is TSO
).
[entry logic, initialization and so forth]
OPEN (SYSOUT,OUTPUT)
PUT SYSOUT,RECORD
CLOSE SYSOUT
[exit logic]
RECORD DC CL80' '
SYSOUT DCB DDNAME=SYSOUT, X
DSORG=PS, X
MACRF=PM, X
RECFM=FB, X
LRECL=80
You might also want to look at TPUT, TGET, and TPG for I / O terminals if you are ok with linking your program runs exclusively in TSO. Terminal I / O is odd in a 3270 environment if you are streaming I / O like in Unix.
DCB
described here . OPEN
described here . PUT
documented here . CLOSE
documented here .
source to share