Now that we have covered the basics we can begin writing our first Bare Metal, Stand Alone program. This program will IPL from the card reader and execute without any help from an operating system.
For our first program we will attempt something very simple. We will read cards from a card reader and print them to a printer. We will call it 80-80 List because it will read eighty bytes from the card reader and print eighty bytes to a printer.
Our IPL deck will consist of five cards. The first card will contain the 24-byte IPL record expected by the IPL process. It will read in a second card containing additional CCWs used to read additional cards containing executable code.
For this simple program we will require three cards to contain our executable code so our IPL deck will be a total of five cards.
Immediately following our 5-card IPL deck are the data cards for our program. The program will continue reading and printing cards until an exceptional condition is detected on the card reader – usually because it is out of cards to read.
If an error condition is detected or when an exceptional condition is encountered on a read operation, a PSW with the wait bit turned on will be loaded with a LPSW command. This will cause the CPU to stop execution and go into wait mode.
Download the source code: card80