langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
12
Task/Memory-allocation/PL-I/memory-allocation-1.pli
Normal file
12
Task/Memory-allocation/PL-I/memory-allocation-1.pli
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
mainproc: proc options(main) reorder;
|
||||
|
||||
subproc: proc;
|
||||
dcl subvar char init ('X');
|
||||
|
||||
put skip data(subvar);
|
||||
subvar = 'Q';
|
||||
end subproc;
|
||||
|
||||
call subproc();
|
||||
call subproc();
|
||||
end mainproc;
|
||||
17
Task/Memory-allocation/PL-I/memory-allocation-2.pli
Normal file
17
Task/Memory-allocation/PL-I/memory-allocation-2.pli
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
mainproc: proc options(main) reorder;
|
||||
dcl ctlvar char ctl;
|
||||
|
||||
alloc ctlvar;
|
||||
ctlvar = 'A';
|
||||
alloc ctlvar;
|
||||
ctlvar = 'B';
|
||||
alloc ctlvar;
|
||||
ctlvar = 'C';
|
||||
|
||||
put skip data(ctlvar);
|
||||
free ctlvar;
|
||||
put skip data(ctlvar);
|
||||
free ctlvar;
|
||||
put skip data(ctlvar);
|
||||
free ctlvar;
|
||||
end mainproc;
|
||||
27
Task/Memory-allocation/PL-I/memory-allocation-3.pli
Normal file
27
Task/Memory-allocation/PL-I/memory-allocation-3.pli
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue