Welcome to the Bartels Group of Companies
Konventionen - Deutsche Version Conventions - English Version

Bartels System GmbH
Bartels AutoEngineer
BAE Product Info
BAE Price List
BAE Downloads
BAE Documentation
BAE Installation Guide
BAE User Manual
BAE Libraries
User Language Programmer's Guide
1 Introduction
2 Language Description
3 Programming System
3.1 Conventions
3.1.1 Program Storage
3.1.2 Machine Architecture
3.2 Compiler
3.3 Interpreter
4 BAE User Language Programs
A Conventions and Definitions
B Index Variable Types
C System Functions
BAE Update History
BAE Next Version Release Notes Preliminary
BAE V8.0 Release Notes
BAE V7.8 Release Notes
BAE V7.6 Release Notes
BAE V7.4 Release Notes
BAE V7.2 Release Notes
BAE V7.0 Release Notes
BAE V6.8 Release Notes
BAE V6.6 Release Notes
BAE V6.4 Release Notes
BAE V6.2 Release Notes
BAE V6.0 Release Notes
BAE V5.4 Release Notes
BAE V5.0 Release Notes
BAE V4.6 Release Notes
BAE V4.4 Release Notes
BAE V4.2 Release Notes
BAE V4.0 Release Notes
BAE V3.4 Release Notes
BAE Support
BAE Contributions
BAE Development and Service Companies
Electronics Development
Bartels Sport Service
Company Profile
Corporate Info
Bartels :: Bartels AutoEngineer :: BAE Documentation :: User Language Programmer's Guide :: Programming System :: Conventions
Bartels User Language - Programmer's Guide

3.1 Conventions

Bartels AutoEngineer® Dokumentation

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
Bartels :: Bartels AutoEngineer :: BAE Documentation :: User Language Programmer's Guide :: Programming System :: Conventions

© 1985-2023 Oliver Bartels F+E • Updated: 26 January 2007, 17:23 [UTC]

© 1985-2023 Oliver Bartels F+E Bartels Homepage Contact and Corporate Info

Web Development by Baumeister Mediasoft Engineering

Konventionen - Deutsche Version Conventions - English Version