Free Republic
Browse · Search
Bloggers & Personal
Topics · Post Article

To: ClearCase_guy
For the real men on the thread:


**************************************************************
** HELLO - Program to print "Hello, World" on device 009 **
**************************************************************

HELLO CSECT
STM R14,R12,12(R13) Save Registers
LR R12,R15 Load Base Register
USING HELLO,R12 Establish Addressability
SSM =X'00' Disable Interrupts
SPKA 0(0) Disable storage protection
LA R2,CCWS Store pointer to CCW chain
ST R2,CAW ... in Channel Address Word
LA R2,9 Put device address in R2
CLEARIO TIO 0(R2) Test for device busy
BC CC1+CC2,CLEARIO Wait until device not busy
BC CC3,IOERROR Abort if device error
STARTIO SIO 0(R2) Start I/O to the console
BC CC1,CSWSTORE A CSW Has been stored
BC CC2,CLEARIO Device busy. Wait until clear
BC CC3,IOERROR Abort if device error
TESTIO TIO 0(R2) Wait for I/O completion
BC CC2,TESTIO Busy, Wait for completion
BC CC3,IOERROR Abort if device error
CSWSTORE CLI CSW+4,CE Channel End w/o Device End?
BE TESTIO Yes - wait for Device End too
TM CSW+4,BY Channel Busy?
BO TESTIO Yes - Keep Waiting
TM CSW+4,DE Device End?
BNO IOERROR No - The CSW is bad
SUCCESS SSM =X'FF' Reenable Interrupts
LM R14,R12,12(R13) Restore Caller's Registers
XR R15,R15 Clear Return Code
BR R14 Return to Caller
IOERROR SSM =X'FF' Reenable Interrupts
LM R14,R12,12(R13) Restore Caller's Registers
LA R15,4 Set Return Code 4
BR R14 Return to Caller
DS 0D CCW must be doubleword aligned
CCWS CCW X'09',MESSAGE,X'20' ,L'MESSAGE
MESSAGE DC C'Hello, World'
CSW EQU X'40' Addre ss of Channel Status Word
BY EQU X'10' Chann el Busy
CE EQU X'08' Chann el End
DE EQU X'04' Devic e End
CAW EQU X'48' Addre ss of Channel Address Word
R2 EQU 2 Regis ter 2
R12 EQU 12 Regis ter 12
R13 EQU 13 Regis ter 13
R14 EQU 14 Regis ter 14
R15 EQU 15 Regis ter 15
CC0 EQU 8 Condi tion Code 0
CC1 EQU 4 Condi tion Code 1
CC2 EQU 2 Condi tion Code 2
CC3 EQU 1 Condi tion Code 3
END

54 posted on 06/19/2014 11:24:39 PM PDT by FredZarguna (Das ist nicht nur nicht richtig, es ist nicht einmal falsch!)
[ Post Reply | Private Reply | To 6 | View Replies ]


To: FredZarguna
Oh man! You are ancient!

The only part of that post that remotely qualifies as modern is the mixed-case comments, which were likely added later on a 3270l, probably using the likes of XEDIT, some time in the 80's. XEDIT was a creature of CP/CMS, a virtual operating system which allowed one to run privileged code such as your example without needing exclusive use of an expensive mainframe. Using CP/CMS, you could treat a mainframe as if it were a PC.

Looks like there was a tabbing problem down in those EQUs. Still assembles due to a white space break, but it's ugly.

58 posted on 06/20/2014 12:38:54 AM PDT by cynwoody
[ Post Reply | Private Reply | To 54 | View Replies ]

To: FredZarguna
Or, you could just use Cache and do this:

w "Hello world"

69 posted on 06/20/2014 6:06:59 AM PDT by LivingNet
[ Post Reply | Private Reply | To 54 | View Replies ]

Free Republic
Browse · Search
Bloggers & Personal
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson