Skip to content

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.

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&)





From → Uncategorized

Leave a Comment

Leave a Reply

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

You are commenting using your 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 )

Connecting to %s

%d bloggers like this: