Skip to content
Tags

And Hello World!

April 15, 2018

18-04-15 WTO

Another baby step: A C program with inline 370 Assembler. After a fair bit of self-inflicted fumbling around and some help from the Hercules-OS380 mailing list I can run a C program with embedded assembler code.

//GCCMVS2 JOB CLASS=A,MSGCLASS=A,REGION=4096K
//S1 EXEC GCCCLG,COS1='-S',PARM.ASM='DECK,LIST'
//SYSIN DD *
int main(){
	asm(" WTO 'OH HELLO' ");
	return 42;
}

A few notes:

    • The C is in upper and lower case as usual but the assembly part is strictly uppercase
    • The JCL and assembly use single quotes ( ‘ )
    • To get the asm() recognized i needed to override the compiler options in COS1=’-S’ the default is COS1=’-ansi -S -Wpedanticerrors’
    • To see the assembly output and any errors I had to specify PARM.ASM=’LIST,DECK’, the default is ‘DECK,NOLIST’
    • I’m submitting the jobs from windows using netcat which works wonderfully.
    • I’m retrieving the output from the MVS printer using a homebrew awk program that splits the output by job and pipes the last one to more(see below)
    • I’m running hercules/mvs in the background on linux (started with mvs&)

     

     

     

    Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: