Elmo HARSFEN0602 211, Virtual Machine Code Segment, Text Backup & Compiler data segment

Models: HARmonica HARSFEN0602

1 220
Download 220 pages 51.63 Kb
Page 213
Image 213

HARSFEN0602ElmoHARmonicaSoftwareManual

PRELIMINARYDRAFT

If the compilation flag is zero, program is ready. Other values indicate not ready program.

The command CP sets the compilation flag to –1. The Compilation Flag is checked when:

DL command – If the flag is zero, DL will not execute (CP must be issued before DL).

XQ command – If the flag is nonzero, the command returns with PROGRAM_NOT_READY

error

CC inquiry – Returns 1 if the flag is zero, otherwise 0.

The compilation flag is set to zero at a CC=xxxx command, if xxxx matches the 32 bit program checksum, to the length stated at the TOC.

211

16.5.3The Virtual Machine Code Segment

The virtual code segment holds consecutively the virtual machine code as compiled.

16.5.4The Text Backup & Compiler data segment

The text backup segment holds the program text and the compiler data. The first 80 characters are dedicated to the compiler version.

Characters [81.. End of segment] include the program text and line number information. The compiler version is a zero terminated string, including:

-Compiler Version.sub.subsub, something like 15.2.1

-Op-codes version: same method as compiler version.

-Data of release, something like 17-Dec-2002

-Target: Release/Eng/Special

-Any general comment.

In each program line, the corresponding program counter value is the first word (unsigned short). If the first word is 0xFFFF, the text line contains no executable code. For example, the code

mo=1;

**This is a comment mo=0;um=5;

will be written as

0x0246mo=1;<CR>0xFFFF**This is a comment<CR>024Cmo=0;um=5;<CR>....

supposing the VAC code for mo=1 is at PC=0246 and for mo=0 is at PC=0x24C, when PC is an address in the serial flash relatively to the start of the code segment of the user code partition.

16.5.5The Function Symbol Table

The function symbol table states what functions and labels are accessible through the user program. The symbol table does not include any information on system functions. The first 34 bytes of the function symbol table is devoted to statistics:

-Number of functions in the table (signed short) For each function, the following data 34 bytes record is set:

Name (24 bytes long, every character takes two bytes - signed short, unused tail filled with zeros)

Address in the Code Segment (2 bytes – unsigned short)

Type (2 bytes, signed short – 0 for label, 1 for auto routine, 2 for user function) Number of input arguments (2 bytes, signed short, for functions only)

Number of output arguments (2 bytes, signed short, for functions only)

LabelProcRef (2 bytes, signed short). If this member is local label, this field contains index of the function inside which this label resides. For global label this field is equal to –1. For user function this field is not relevant and equal to -1.

The byte length of the function symbol table is 34 * (number of functions+1).

Page 213
Image 213
Elmo HARSFEN0602, HARmonica 211, Virtual Machine Code Segment, Text Backup & Compiler data segment, Function Symbol Table