line decor
  
line decor
 
 
 
 

 
 

Handling Based Variables

PL/M source code

oo : do;

/* This is a demo of handling two variables that
use the same based pointer.
*/

declare ptr pointer;
declare v1 based ptr byte;
declare v2 based ptr word;
declare v3 based ptr real;

v1 = 'a';
v2 = 10;
v3 = 3.5;

end;

Translated C source code

#include "..\C\builtin.h"

/* This is a demo of handling two variables that use the same based pointer.
*/
static WORD *ptr;

 

main()
{
*((BYTE *)ptr) = 'a';
*ptr = 10;
*((REAL *)ptr) = 3.5;
}

 
 

 


Other Examples:

Handling "literally" declarations

Handling "AT" declarations

Handling boolean expressions

.