Fish,
I sure would like to see your "trivial" example of a 3270 write /
read / (write back input), code example.
I'm still trying to get the SATK "pieces" working together. :/
You can start with the following code, from which I'm getting a "could
not resolve implied base register for location: ABS:0x3259 .. error"
Mike
------------------------------
* Copyright (C) 2015 Harold Grovesteen
TITLE '3270-read-write-0.01a - 3270 Generic Mainframe
Bare-Metal Hello World Program'
* ----------------------------------------------------------------
* Aug 2 2018 - Mike Stramba ***@gmail.com
*
* modified from 'hello.asm' (satk samples)
* - added ccw for 3270
* - rest of program is unchanged from the original '3215'version
*
* see H32CCW, and H32MSG DC X'C3'
* --------------------------------------------------------------------
*
PRINT OFF
COPY 'satk.mac'
PRINT ON
* ----------------------------------------------------------
* Macro for conditionally including an architecture change or not
*
*** mike commented
* MACRO
*&LABEL SETARCH &BASE
* GBLA &ARCHLVL Current architecture level
* AIF ('&LABEL' EQ '').NOLBL
*&LABEL DS 0H
*.NOLBL ANOP
* AIF (&ARCHLVL LT 8).DONE
* AIF ('&BASE' EQ '').NOCLR
* ZEROLH &BASE,1 Make sure bit 32 in 64-bit register is
zero after change
*.NOCLR ANOP
* ZARCH 6,5,SUCCESS=INZMODE,FAIL=FAIL Change to 64-bit mode if capable
*INZMODE DS 0H
*.DONE MEND
*--------------------------------------------------
*
* ARCHLVL ZARCH=NO Mike commented
* mike ----
* ARCHIND Mike not needed ... ARCHLVL defaults to
running it ?
ARCHLVL ZARCH=YES,SET=9,MNOTE=YES MIKE
* ------
*
DSECTS NAME=(ASA,IO,IOCB)
*
* Initiate the LOWCORE CSECT in the LOAD region with location counter at 0
PRINT DATA
LOWCORE ASALOAD REGION=LOAD
* Create IPL PSW
ASAIPL IA=HELLO
*
* The Hello World program itself...
* Address Mode: 24
* Register Usage:
* R1 I/O device used by ENADEV and RAWIO macros
* R2 Program base register
* R3 IOCB pointer for ENADEV and RAWIO macros
* R4 IO work register used by ENADEV and RAWIO
* z/Architecture systems only:
* R5 Used for CPU register when signaling architecture change
* R6,R7 Signaling registers when changing architecture
*
*
HELLO START X'2000',PROGRAM Initiates the HELLO CSECT in the PROGRAM region
USING ASA,0 Allow the program to address assigned
storage directly
$BASR R2,0 Establish the program's base register
USING *,R2 ..and inform the assembler
MVC MIKJUNK3,MIKJUNK3 mike assembler addressing test
MVC MIKJUNK1,MIKJUNK2 mike assembler addressing test
B MIKSKIP
MIKJUNK3 DS X
MIKSKIP EQU *
*
* ARCHLVL ZARCH=YES,SET=9,MNOTE=YES MIKE zop
*
* SETARCH 2 Cleanly enter 64-bit mode if that makes
sense * mike commented
*
LA R3,HELLOIO Provide access to the IOCB
USING IOCB,R3 ..and inform the assembler
MVC MIKJUNK3,MIKJUNK3
MVC MIKJUNK1,MIKJUNK2 mike assembler addressing test
*
* Display the hello world message on the console.
* Step 1 - Initialize the CPU for I/O operations
IOINIT
*
* Step 2 - Enable the device, making it ready for use
ENADEV DISPLAY,FAIL,REG=4
*
* Step 3 - Output the hello world message on the console
*
DISPLAY RAWIO R4,FAIL=FAIL,CERR=FAIL,UERR=FAIL
*
* Mike
* LA R3,READ3270IOCB Provide access to the IOCB
* USING IOCB,R3 ..and inform the assembler
*
LA R8,READ3270IOCB Provide access to the IOCB
USING IOCB,R8 ..and inform the assembler
MVC MIKJUNK1,MIKJUNK2 mike assembler addressing test
* USING *,R2
RAWAIT R8,FAIL=RAWAITFAIL mike wait for
ATTENTION from 3270
RAWIO R4,FAIL=FAIL,CERR=FAIL,UERR=FAIL mike READ FROM 3270
MVC GOTAGE,INBUFF+6
* Now output the input
LA R8,HELLOIO Provide access to the IOCB
USING IOCB,R8 ..and inform the assembler
MVC MIKJUNK1,MIKJUNK2 mike assembler addressing test
RAWIO R4,FAIL=FAIL,CERR=FAIL,UERR=FAIL
*
* Step 4 - Terminate the bare-metal program
LPSW GOODPSW Terminate with indication of success
*
* Any error arrives here
*
*mike
RAWAITFAIL LPSW WAITFAILPSW
FAIL LPSW FAILPSW Terminate with indication of failure
*
* Data and structures used by the program
*
* Structure used by RAWIO identifying the device and operation being performed
* HELLOIO IOCB X'00F',CCW=HELLOCCW
*
HELLOIO IOCB X'00F',CCW=H32CCW
*
*
* mike
*
READ3270IOCB IOCB X'00F',CCW=READMOD,WAIT
READMOD CCW READMD,INBUFF,0,INBUFLEN
INBUFF DS (43*80)X
*FIELD1 DS 3
INBUFLEN EQU *-INBUFF
*
*
*HELLO32 IOCB X'00F',CCW=H32CCW
*
* Channel program that displays a message on a console with carriage return
WRITECR EQU X'09'
ERAWRALT EQU X'0D'
READMD EQU X'06'
*HELLOCCW CCW WRITECR,HELLOMSG,0,HELLOLEN
*
H32CCW CCW ERAWRALT,H32MSG,0,HELLO32LEN
*
* The actual Hello World message
* HELLOMSG DC C'Hello World from a bare-metal mainframe program'
* HELLOLEN EQU *-HELLOMSG
*
MIKJUNK1 DS X
MIKJUNK2 DS X
* mike 3270 Hello Screen
*
H32MSG DC X'C3'
*
DC X'11',X'0024'
DC X'1D',X'60',C'LSSM'
*
DC X'11',X'00AA'
DC X'1D',X'60',C'A test from the Satk assembler !'
*
DC X'11',X'019A'
DC X'1D',X'60',C'Age:'
*
DC X'1D',X'10',X'13',C'___'
*
DC X'11',X'0200'
DC X'1D',X'60',C'Got:'
GOTAGE DC C'XXX'
* DC X'11',X'0250'
DC X'1D',X'60'
YRB DC C'YYYY'
*
DC X'11',X'0D20',C'3270-read-write-0.01'
DC X'11',X'0D40',C'Mike Stramba 2018-Aug-4'
HELLO32LEN EQU *-H32MSG
* Termination PSWs
*
* mike
WAITFAILPSW DWAIT CODE=999
*
FAILPSW DWAIT I/O failed
GOODPSW DWAITEND Hello World succeeded
REGEQU
END HELLO
---------------------------------- err.txt ---------------------------