28 lines
652 B
Plaintext
28 lines
652 B
Plaintext
mainproc: proc options(main) reorder;
|
|
dcl list_ptr ptr init (sysnull());
|
|
dcl list_top ptr init (sysnull());
|
|
dcl list_end ptr init (addr(list_top));
|
|
dcl i fixed bin (31);
|
|
|
|
dcl 1 list based(list_ptr),
|
|
2 list_nxt ptr init (sysnull()),
|
|
2 list_data fixed bin (31) init (i);
|
|
|
|
/*
|
|
* Allocate the list
|
|
*/
|
|
do i = 1 to 4;
|
|
alloc list;
|
|
list_end -> list_nxt = list_ptr;
|
|
list_end = list_ptr;
|
|
end;
|
|
|
|
/*
|
|
* Print the list
|
|
*/
|
|
do list_ptr = list_top repeat list_nxt
|
|
while(list_ptr ^= sysnull());
|
|
put skip list(list_data);
|
|
end;
|
|
end mainprog;
|