DBC Compatibility Mode


 

The PLBCMP compiler (PLBCMP.PLC) provides a compatibility mode for source created for the Subject and Wills DBC product. This mode is enabled by use of the "-ZC=3" compiler switch.

 

1.   The DBC Support provides the following additional statement syntax formats.

 

DimArray

DIM

6[3],INITIAL "123","abc","xyz"

FormArray

FORM

6[3],INITIAL 1,2,3

IntArray

INTEGER

[3],INITIAL 1,2,3

.

 

 

Int

INTEGER

"123"

TypeLess

VAR

@

TypeLessArr

VAR

[3]@

.

 

 

DimPtr

DIM

@

DimAr

DIM

[3]@

DimArrPtr

DIM

@[]

Dim2ArrPtr

DIM

@[,]

Dim3ArrPtr

DIM

@[,,]

.

 

 

 

TYPE

TypeLess TYP,DZ1,DZ2,DZ3

 

MOVEADR

TypeLess,DimPtr

 

MOVEPTR

TypeLess,DimPtr

 

CALL

XXX USING DimArray

.

 

 

XXX

ROUTINE

DimArrPtr

 

RETURN

 

.

 

 

YYY

ROUTINE

TypeLess

 

RETURN

 

 

2.   The DIM variable supports the following alternate statement syntax formats:

 

(1)

[label]

DIM

[*][%]{size}({arraysize}), INITIAL "????", ...

(2)

[label]

DIM

({arraysize})@

(3)

[label]

DIM

@()

(4)

[label]

DIM

@(,)

(5)

[label]

DIM

@(,,)

 

     The (1) format supports a new array initialization syntax form.

     The (2) format supports a new DIM syntax for an array of DIM pointers.

     The (3) format specifies a new DIM array pointer construct. The DIM array pointer can contain an address of a DIM array.

     The (4) format specifies a two dimensioned DIM array pointer construct. The two dimensioned DIM array pointer can contain an address of a two dimensioned DIM array.

      The (5) format specifies a three dimensioned DIM array pointer construct. The three dimensioned DIM array pointer can contain an address of a three dimensioned DIM array.

Examples:

 

DimArray

DIM

6[3],INITIAL "123","abc","xyz"

DimArr

DIM

[3]@ ;Array of 3 pointers

DimArrPtr

DIM

@[] ;Array Pointer 1 dimension

Dim2ArrPtr

DIM

@[,] ;Array Pointer 2 dimensions

Dim3ArrPtr

DIM

@[,,] ;Array Pointer 3 dimensions

.

 

 

 

MOVEADR

DimArray, DimArrPtr

 

DISPLAY

DimArrPtr(2)

 

3.   The FORM variable supports the following alternate statement syntax formats:

 

(1)

[label]

FORM

[*][%]{size}({arraysize}), INITIAL {dvalue}, ..

(2)

[label]

FORM

({arraysize})@

(3)

[label]

FORM

@()

(4)

[label]

FORM

@(,)

(5)

[label]

FORM

@(,,)

 

     The (1) format supports a new array initialization syntax form. The {dvalue} in this syntax form is a decimal immediate value without '"' double quote characters.

     The (2) format supports a new FORM syntax for an array of FORM pointers.

     The (3) format specifies a new FORM array pointer construct. The FORM array pointer can contain an address of a FORM array.

     The (4) format specifies a two dimensioned FORM array pointer construct. The two dimensioned FORM array pointer can contain an address of a two dimensioned FORM array.

     The (5) format specifies a three dimensioned FORM array pointer construct. The three dimensioned FORM array pointer can contain an address of a three dimensioned FORM array.

Examples:

 

FormArray

FORM

2.2[3],INITIAL 1.5,2.5,3.5

FormArr

FORM

[3]@ ;Array of 3 pointers

FormArrPtr

FORM

@[] ;Array Pointer 1 dimension

Form2ArrPtr

FORM

@[,] ;Array Pointer 2 dimensions

Form3ArrPtr

FORM

@[,,] ;Array Pointer 3 dimensions

 

4.   The INTEGER variable has been modified to support the following alternate statement syntax formats:

 

(1)

[label]

INTEGER

[*][%]{size}({arraysize}), INITIAL {dvalue}, ...

(2)

[label]

INTEGER

({arraysize})@

(3)

[label]

INTEGER

@()

(4)

[label]

INTEGER

@(,)

(5)

[label]

INTEGER

@(,,)

(6)

[label]

INTEGER

{value}

 

     The (1) format supports a new array initialization syntax form. The {dvalue} in this syntax form is a decimal immediate value without '"' double quote characters.

     The (2) format supports a new INTEGER syntax for an array of INTEGER pointers.

     The (3) format specifies a new INTEGER ARRAY POINTER construct. The INTEGER ARRAY POINTER can contain an address of a INTEGER ARRAY.

     The (4) format specifies a two dimensioned INTEGER ARRAY POINTER construct. The two dimensioned INTEGER ARRAY POINTER can contain an address of a two dimensioned INTEGER ARRAY.

     The (5) format specifies a three dimensioned INTEGER ARRAY POINTER construct. The three dimensioned INTEGER ARRAY POINTER can contain an address of a three dimensioned INTEGER ARRAY.

     The (6) format allows an INTEGER to be specified where the {value} is a numeric literal without a size specification. In this case, the INTEGER size defaults to an 4-byte integer.

Examples:

 

IntArray

INTEGER

[3],INITIAL 1,2,3

IntArr

INTEGER

[3]@ ;Array of 3 pointers

IntArrPtr

INTEGER

@[] ;Array Pointer 1 dimension

Int2ArrPtr

INTEGER

@[,] ;Array Pointer 2 dimensions

Int3ArrPtr

INTEGER

 @[,,] ;Array Pointer 3 dimensions

Int

INTEGER

"123" ;Default to 4 byte integer

 

5.   The VAR variable is a new language declaration statement that declares a typeless data variable pointer. A typeless variable can contain the address of any PL/B language variable. The typeless variable can only be declared when the compiler 'ZC=3' option is used. Also, it can only be used as an operand variable in ROUTINE, LROUTINE, MOVEADR, MOVEPTR, TYPE, CLEARADR, LOADADR, and STOREADR statements.

Syntax:

 

[label]

VAR

@

[label]

VAR

[{arraysize}]@

Example:

 

TypeLess

VAR

@

TypeLessArr

VAR

[3]@

DimX

INIT

"ABC"

FormX

FORM

"123.456"

IntX

INTEGER

1,"256"

XType

INTEGER

4

DimPtr

DIM

@

FormPtr

FORM

@

IntPtr

INTEGER

@

$08h

INTEGER

1,"0x8"

$10h

INTEGER

1,"0x10"

$20h

INTEGER

1,"0x20"

.

 

 

 

CALL

CHKVAR USING DimX

 

CALL

CHKVAR USING FormX

 

CALL

CHKVAR USING IntX

 

STOP

 

.

 

 

CHKVAR

ROUTINE

TypeLess

 

TYPE

TypeLess,XType

 

AND

0xFF,XType

 

SWITCH

XType

 

CASE

$20h

 

MOVEADR

TypeLess,DimPtr

 

DISPLAY

"DIM:",*LL,DimPtr

  

 

 

 

CASE

10h

 

MOVEADR

TypeLess,FormPtr

 

DISPLAY

"FORM:",FormPtr

  

 

 

 

CASE

$08h

 

MOVEADR

TypeLess,IntPtr

 

DISPLAY

"INTEGER:",IntPtr

  

 

 

 

DEFAULT

 

 

DISPLAY

"Input Variable Type Invalid!"

  

 

 

 

ENDSWITCH

 

 

RETURN

 

 

6.   The MOVEADR (MOVEADDR) statement has been modified to allow a VAR typeless variable or ARRAY POINTER variable in the source and destination operands. An example of this statement is included in item 5 above.

7.   The MOVEPTR statement has been modified to allow a VAR typeless variable or ARRAY POINTER variable in the source and destination operands.

8.   The ROUTINE and LROUTINE variable list has been modified to allow a VAR typeless variable or ARRAY POINTER as valid variables. An example of this statement is included in item 5 above.

9.   The TYPE statement has been modified to accept an alternate syntax format. A detailed discussion of the TYPE instruction is located in the PL/B Reference file. An example of this statement is included in item 5 above.

Syntax

 

[label]

TYPE

{var}[,{type}[,Dim1[,Dim2[,Dim3]]]]

 

 

See Also:



PL/B Language Reference