Baumeister Mediasoft Engineering BME - Baumeister Mediasoft Engineering  Conventions - English Version Konventionen - Deutsche Version
Baumeister Mediasoft Engineering
Bartels AutoEngineerCarLogServicesResourcesCompany ProfileContact Us
Baumeister Mediasoft Engineering » Bartels AutoEngineer » BAE Documentation » User Language Programmer's Guide » Programming System » Conventions
Bartels User Language - Programmer's Guide

3.1 Conventions

Bartels AutoEngineer® Documentation

The Bartels User Language programming system consists of the Bartels User Language Compiler and the Bartels User Language Interpreter. The Compiler translates User Language source code into User Language machine code (programs or libraries), performs static library linking and generates information required for dynamic linking. The User Language Interpreter is used for (dynamically linking and) executing User Language machine programs. Since the User Language Comiler and the User Language Interpreter are applied time-independent (i.e., they are implemented in different program modules), the following conventions are required for correct program access.


3.1.1 Program Storage

The Bartels User Language Compiler stores successfully translated User Language programs (or libraries) to the ulcprog.vdb file of the Bartels AutoEngineer programs directory. The name of the machine program emerges from the program source code file name. The current User Language Compiler version and a caller type coding (determining the compatible Bartels User Language interpreter environments) are stored with the machine program code. The Compiler also stores any information required for dynamic link processes (i.e., library linking to be applied at program runtime). When calling a program, the User Language Interpreter loads the machine program with the specified name from the ulcprog.vdb file of the Bartels AutoEngineer programs directory. The program's User Language Compiler version is checked to ensure compatibility with the current User Language Interpreter version (otherwise the Interpreter might not understand the program structure). The caller type coding stored with the program is used to check whether the index variable types and system functions referenced by the program are implemented in the current User Language Interpreter environment. During program load, the Interpreter automatically performs all of the required dynamic link processes. The libraries to be linked with the program are checked for compatibility as well.


3.1.2 Machine Architecture

The machine architecture implemented in the Bartels User Language corresponds to a stack machine. The instruction set of this stack machine contains load commands (for loading variable values and/or constants), ALU commands (for activating the arithmetic-logic unit of the machine), store commands (for assignments), function call commands and stack management commands.

The instruction set of this machine is listed in table 3-1. The stack columns provide information on how many stack arguments are required by each instruction and how the stack size changes when executing the instruction.

Table 3-1: User Language Machine Instruction Set

Instruction Designator
nop 0 0No operation
add 2-1Add
addstr 2-1Add string
and 2-1And
bnot 1 0Binary not
cmpeq 2-1Compare equal
cmpge 2-1Compare greater equal
cmpgt 2-1Compare greater
cmple 2-1Compare less equal
cmplt 2-1Compare less
cmpne 2-1Compare not equal
decr 1 0Decrement
div 2-1Divide
divr 2-1Divide rest
incr 1 0Increment
mul 2-1Multiply
neg 1 0Negate
not 1 0Not
or 2-1Or
shl 2-1Shift left
shr 2-1Shift right
sub 2-1Subtract
xor 2-1Exclusive or
cast t 1 0Cast value
castoiv i 3-2Cast of index variable
getary 2-1Get array element
getidx i 1 1Get index
getidxof i 3-1Get index of
loadas s 1 0Load stack array element
loadav v 1 0Load variable array element
loadchr c 0 1Load character
loaddbl d 0 1Load double
loadint i 0 1Load integer
loadiv v 2-1Load index variable
loadoiv v 4-3Load of index variable
loads s 0 1Load stack
loadsd s 0 1Load stack destructive
loadstr s 0 1Load string
loaduref f 0 1Load user function reference
loadv v 0 1Load variable
loadvd v 0 1Load variable destructive
storeas s 2-2Store stack array element
storeav v 2-2Store variable array element
stores s 1-1Store stack
storev v 1-1Store variable
pop s 0 0Pop stack
popt 1-1Pop top of stack
push s 0 0Push stack
swap s 0 0Swap stack
xchg s 0 0Exchange stack
xchgt 2 0Exchange top of stack
jump p 0 0Jump always
jumpeq p 2-1Jump if stack tops equal
jumpnz p 1-1Jump if stack nonzero
jumpz p 1-1Jump if stack zero
calls f 0 1Call system function
callu f 0 1Call user function
hlt 0 0Halt program
ret 1-1Return (pop optional stack)
stop 0 0Stop function
Baumeister Mediasoft Engineering » Bartels AutoEngineer » BAE Documentation » User Language Programmer's Guide » Programming System » Conventions

Conventions • © 1985-2023 Oliver Bartels F+E • Updated: 29 October 2008, 12:56 [UTC]

Baumeister Mediasoft Engineering, Clontarf, Dublin 3, D03 HA22, Ireland
© 2023 Manfred Baumeister

Conventions - English Version Konventionen - Deutsche Version