op code objectΒΆ

(From what I can decipher)

The OP Code Program object is generated by:

The BASIC compiler (BCOMP).

The Dictionary Item compiler (DCOMP), which in turn calls:

The A / S Correlative compiler  for A/S -type dictionary record (ACOMP)

The I Type compiler  for I-type dictionary record (ICOMP)

For C - type dictionary record (BCOMP)

Others?

BASIC OP Code Program object:

The object starts as a 64,000 character string initialized to the Char(0)

Object header fields (byte offsets) are defined in the include file GPL.BP/HEADER.H for BCOMP, gplsrc/hearer.h for C compiler

Example:

PROGRAM HELLO
$EXPLIST  ;* To create a op-code listing of your program, you add the $EXPLIST compiler directive, requires -INTERNAL flag at login
PRINT "Hello QMUSER, What is your name?: "
INPUT UNAME
PRINT UNAME: " Have a great day!"
END


BASIC BP HELLO

OP Code Listing:  (../BP.OUT/HELLO.LIS)

        0000A5:       LD0
        0000A6:       LDSTR    "Hello QMUSER, What is your name?: "
        0000CA:       PRNL
     4  INPUT UNAME
        0000CB:       LDSLCL   UNAME
        0000CD:       LD0
     5  PRINT UNAME: " Have a great day!"
        0000CE:       LD0
        0000CF:       INPUT
        0000D1:       LD0
        0000D2:       LDSLCL   UNAME
        0000D4:       LDSTR    " Have a great day!"
        0000E8:       CAT
        0000E9:       PRNL
     6  END
        0000EA:       RETURN

Header:

Magic number              000000 hx: 64
Object revision           000001 hx: 00
Object id (loaded object) 000002
Start PC                  000006 hx: A5   00   00   00
Argument count            00000A hx: 00   00
Local var count           00000C hx: 01   00
Stack depth               00000E hx: 64   00
Symbol table offset       000010 hx: F2   00   00   00
Line table offset         000014 hx: EB   00   00   00
Object size               000018 hx: F9   00   00   00
Flags                     00001C hx: 00   00
Compile time              00001E hx: 8D   30   F8   65
Program name              000024 hx: 48   45   4C   4C   4F

OP Code object(../BP.OUT/HELLO):

00000000 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000 64 00 00 00 00 00 a5 00 00 00 00 00 01 00 64 00 d.............d.
00000010 f2 00 00 00 eb 00 00 00 f9 00 00 00 00 00 14 2d ...............-
00000020 f8 65 00 00 48 45 4c 4c 4f 00 00 00 00 00 00 00 .e..HELLO.......
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000A0 00 00 00 00 00 1b 12 22 48 65 6c 6c 6f 20 51 4d ......."Hello QM
000000B0 55 53 45 52 2c 20 57 68 61 74 20 69 73 20 79 6f USER, What is yo
000000C0 75 72 20 6e 61 6d 65 3f 3a 20 f7 19 00 1b 1b cf ur name?: ......
000000D0 33 1b 19 00 12 12 20 48 61 76 65 20 61 20 67 72 3..... Have a gr
000000E0 65 61 74 20 64 61 79 21 43 f7 02 a5 00 00 26 06 eat day!C.....&.
000000F0 19 01 55 4e 41 4d 45 fd 00                      ..UNAME..