Version 2 of PL/1

Updated 2007-01-16 14:52:58

mytest:

    proc(cmdArgs, envBlk) options(main);

dcl

    cmdArgs char(127) var,
    envBlk char(127);

dcl

    (max, i, j) fixed bin,
    base_page_ptr ptr,
    1 base_page based (base_page_ptr),
      2 pad1 (32) fixed bin(15),
      2 psp_seg fixed bin(15);

dcl

    cmdLine_ptr ptr,
    cmdLine char(127) var based (cmdLine_ptr);

dcl

    dateNow char(6),
    timeNow char(9);

dcl

    junk_waffle fixed bin(7) static initial (20);


    dateNow = DATE();
    timeNow = TIME();
    put skip list (dateNow); put skip list (timeNow);
    put skip edit (substr(dateNow,3,2),'/',substr(dateNow,5,2),'/',substr(dateNow,1,2)) (a(2),a,a(2),a,a(2));
    put skip edit (substr(timeNow,1,2),':',substr(timeNow,3,2),':',substr(timeNow,5,2),'.',substr(timeNow,7,3))
                  (a(2),a,a(2),a,a(2),a,a(3));
    put skip list ('');

    unspec(cmdLine_ptr) = '0080'b4;
    put edit ('command line = ', cmdLine) (a);
    put skip list ('');

    unspec(base_page_ptr) = '0000'b4;
    put edit ('PSP segment = ', unspec(base_page.psp_seg),'h')
             (skip,a,b4(4),a);
    put skip list ('');

    i = length(cmdArgs);
    put edit ('cmdArgs = ', cmdArgs) (a);
    put skip list ('');

    put list ('env = ', envBlk);

    i = '12bc'b4;
    put edit ('i = ',unspec(i),'h') (skip,a,b4(4),a);

    return;                /* just for aesthetics */


    end;          /* of main program */

LV Anyone know why this page was created? Generally someone adds a note giving us some context.

escargo - I'm especially mystified because they got the name of the language wrong (it's PL/I). There is work being done on a PL/I front end to the GNU C compiler; I understand that they are looking for language samples to compile.


Category Language