I’m trying to use the WTO instruction from with in Metal C to print out "Hello World" to my job log. This is based on the example in section 1.2.3.5 of the z/OS V1R10.0 Metal C Programming Guide and Reference It appears when I use WTO I am having either issues with my buffer containing 0 or ASCII to EBCDIC conversion. I’ve pasted the relevant section of my job log below, followed by my code, then the code from the IBM example which I could not get to compile. Job log
09.01.56 J0686275 IEF403I IMIJWS0G - STARTED - TIME=09.01.56 09.01.56 J0686275 +...0....... 09.01.56 J0686275 - --TIMINGS (MINS.)-- ----PAGING COUNTS--- 09.01.56 J0686275 -IMIJWS0G GO 00 6 .00 .00 .00 1292 0 0 0 0 0 1 09.01.56 J0686275 IEF404I IMIJWS0G - ENDED - TIME=09.01.56
My code
#include #include #include int main() { struct WTO_PARM { unsigned short len; unsigned short code; char* text; } wto_buff = { 4+11, 0, "hello world" }; __asm( " WTO MF=(E,(%0)) " : : "r"(&wto_buff)); }
IBM code
int main() { struct WTO_PARM { unsigned short len; unsigned short code; char text[80]; } wto_buff = { 4+11, 0, "hello world" }; __asm( " WTO MF=(E,(%0)) " : : "r"(&wto_buff)); return 0; }