Inbound 9027578700386596128
Inbound 9027578700386596128
Inbound 9027578700386596128
Manual
2 Batronix – Prog-Studio User Manual
TABLE OF CONTENTS
SYSTEM REQUIREMENTS...................................................................................................... 6
COMMUNITY .................................................................................................................. 7
PERSONAL ...................................................................................................................... 7
PROFESSIONAL ............................................................................................................... 7
EDUCATIONAL ................................................................................................................ 8
INSTALLATION ................................................................................................................ 9
REGISTRATION ............................................................................................................. 13
VIEW->DEBUG SUBMENU................................................................................. 20
DEBUG .................................................................................................................. 21
Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com
2
This document is protected by German and international copyright laws. The incomplete or partial use, sale or reproduction, publishing – including
excerpts – of any kind requires the written permission of the author.
Batronix – Prog-Studio User Manual 3
STANDARD ............................................................................................................ 23
FORMAT................................................................................................................ 25
HEX-EDITOR .......................................................................................................... 25
DEBUG .................................................................................................................. 26
STOPWATCH ......................................................................................................... 27
WORKSPACE................................................................................................................. 27
WINDOWS ............................................................................................................ 27
WATCH LISTS......................................................................................................... 29
LOCALS LIST........................................................................................................... 30
BREAKPOINTS........................................................................................................ 34
BOOKMARK LIST.................................................................................................... 34
CODE-FOLDING ..................................................................................................... 36
SUMMARY ............................................................................................................ 44
RECORDING........................................................................................................... 45
PROJECT 49
PRE-PROCESSOR................................................................................................................. 51
MACROS....................................................................................................................... 51
$SET ............................................................................................................................. 52
$INCLUDE ..................................................................................................................... 55
COMMENTS ................................................................................................................. 58
EXPRESSIONS ............................................................................................................... 59
OPERATORS:................................................................................................................. 60
NUMBERS..................................................................................................................... 61
EQU ...................................................................................................................... 63
DATA ..................................................................................................................... 64
BIT ........................................................................................................................ 65
LABEL .................................................................................................................... 66
ORG ...................................................................................................................... 67
DS ......................................................................................................................... 68
DB ......................................................................................................................... 69
DW........................................................................................................................ 70
DO ........................................................................................................................ 71
WHILE ................................................................................................................... 74
FOR ....................................................................................................................... 75
IF........................................................................................................................... 77
SYSTEM REQUIREMENTS
This chapter contains the system requirements for Prog-Express and Microsoft® .NET Framework 2.0.
Prog-Express requires Microsoft® .NET Framework 2.0. If the framework isn’t already installed the
setup detects this automatically and offers the option to install the framework for you.
Notice, only the CD Version of Prog-Studio contains the .NET Framework embedded. All other versions
(including the Internet Version) have to download the .NET Framework first.
256 MB RAM
512 MB RAM
Prog-Studio will be delivered in different versions. This chapter describes the license differences in
detail. We’ve tried to offer special licenses for any case of application.
COMMUNITY
The community version of Prog-Studio is dedicated to beginners, who desire to write there first
microcontroller programs in assembler without the need to abandon the comfort of an integrated
development environment. The useable program segment of assembler programs is limited to the
memory eighth of the chosen microcontroller with an upper cap of 2048 byte (2 kilobytes). The first 48
bytes are always user programmable in foresight to redirect the interrupt service routines to a useable
program segment address. This version is advised to everybody who is searching for a powerful and
free development environment for small projects.
RESTRICTIONS:
The useable program size is limited to the eighth of the microcontrollers overall memory with
an upper cap of 2 kilobytes.
RECOMMENDED FOR:
Beginners
evaluation users
PERSONAL
The personal version of Prog-Studio 2007 is the ideal choice for the hobby developer who wants to
develop micro-controller projects for personal use. This version is technically the same as the
professional version.
RESTRICTIONS:
RECOMMENDED FOR:
hobbyists
evaluation users
PROFESSIONAL
The professional version has no limitations and can be used to full effect for commercial projects. It’s
the ideal choice for professional developer.
RESTRICTIONS:
Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com
7
This document is protected by German and international copyright laws. The incomplete or partial use, sale or reproduction, publishing – including
excerpts – of any kind requires the written permission of the author.
8 Batronix – Prog-Studio User Manual
none
RECOMMENDED FOR:
professionals
EDUCATIONAL
The educational version is intended specifically for training centers and schools. It has the same level
of functionality as the personal version, but also allows for the installation of the Prog-Studio software
on up to 30 PCs, which must be located in a classroom, training room or laboratory. To install Prog-
Studio in several rooms an educational license is required for each room, even if the total number of
PCs is still 30 or less. The benefit of the educational version is the lower price compared to the
individual license costs for the same number of installations.
RESTRICTIONS:
RECOMMENDED FOR:
School
university
INSTALLATION
This chapter contains all the information necessary for installing Prog-Studio.
Because Prog-Studio is build upon then .NET Framework 2.0, you may want to install it manually
before you install Prog-Studio. If a active internet connection is active the setup program is able to
download and install the .NET framework on its own. If you got Prog-Studio delivered on a CD then
you find the .NET Framework on CD.
To start please double-click on the setup file or use the CD auto-start function.
Click on “Next”
Read the eula and accept it by checking then checkbox control. Click on the just enabled “Next”
button. If you do not accept this eula you are not allowed to install Prog-Studio.
Choose your start menu folder, or use the default value. Click on “Install”
Setup installs all necessary files. Click on “Next” when the operation has finished.
If you do not want to run Prog-Studio after setup, or do not want to open the Readme file, then
remove the checks. Click “Finish” to complete the installation.
REGISTRATION
The first time you run Prog-Studio you will be prompted to enter your product key. You will receive
this product key together with the software.
After filling out all fields you can enable the software by clicking on the “Register” button.
The product activation is intended to reduce a form of piracy know as illegal copying or software theft.
Illegal copying is the sharing and installation of software that does not conform to the end user license
agreement (EULA) and makes up about half of all pirated installations.
Activation of your software is therefore necessary to ensure that your product key is only used by you.
It functions as a protection measure and is intended to prevent illegal use of the software, enabling us
to continue developing high quality software in the future. Activation is necessary for each new
installation of the software.
After entering the product key you have 30 days to complete the activation, after that the software
will not run without a successful activation.
A Batronix product can be activated automatically over the internet or as an alternative manually by
sending an email or calling Batronix-Support.
2. Check that you have selected the activation method "Over the Internet".
A connection is now made to a Batronix Server. For activation only your encrypted product key in
combination with an installation ID that identifies your computer is transmitted.
Once this process has completed successfully the software runs normally and you are no longer
prompted for activation.
For manual activation select “by Email or by Telephone” in the activation dialog and then click on
“Activate Now”.
You can reach Batronix Support via E-Mail or by phone. If you choose to activate via e-mail, please
ensure that you include both the serial number as well as the installation ID in your email!
You will receive an activation code from Batronix Support. Please enter this in the text field and
complete the activation by clicking on the "Activate" button.
After closing this dialog box the development environment starts, and no further messages are
displayed when starting Prog-Studio.
The automatic activation can fail if your computer is not connected to the internet, if the internet
servers are overloaded, or if your registration information is not correct.
Please verify that your computer has a working connection to the internet. You can check this with,
among other things, the dos prompt command Ping.
If you are using a firewall, please ensure that Prog-Studio is included in the list of programs that are
allowed to access the internet. For details on this please look in the documentation for your firewall.
Prog-Studio connects to the internet only for product activation, so you can remove Prog-Studio from
this list after successful activation without limiting the products functionality. Please try the activation
again after a short time. It is possible that the Batronix Server is temporarily not available.
Close this dialog by clicking on the “OK” button and verify the "Activation Code" you entered.
If you are unable to successfully activate your product after further attempts please contact Batronix
Support.
This chapter contains information about the individual screens in the development environment.
APPLICATION STRUCTURE
Prog-Studio uses an typical windows application structure with menu bar, toolbar, workspace and
status bar.
menu bar
toolbar
workspace
status bar
MENU BAR
The menu bar contains following menus – File, Edit, View, Project, Debug, Extra, Window and Help.
Some of this menus contain submenus. These submenus will be described in the details of each menu.
With a left mouse click you can open an chosen menu or close an already open menu. Alternative you
can open a menu by holding the ALT key and pushing the underlined letter on your keyboard. The
escape key closes an open menu.
You can navigate through the menus by using the up, down, left and right cursor keys.
Menu items will be activated by a left click or by hitting the enter key if the menu item is focused.
Many menu items provide an shortcut. They could be found behind the menu text. The regular use of
shortcuts may improve your productivity.
FILE MENU
New Project (CTRL+N) Starts a wizard for creating a new project, if another project
is currently open it is closed.
Save As … Saves the file currently displayed in the editor with a new
name.
EDIT MENU
Cut (CTRL+X) Cuts out the selected content and copies it to the clipboard.
VIEW MENU
Project Manager (CTRL+SHIFT+P) Opens the project manager or sets the focus to this
window.
Error List (CTRL+SHIFT+E) Opens the error list window or sets the focus to this
window.
Output (CTRL+SHIFT+O) Opens the output window, or sets the focus to this
window.
Monitor (CTRL+SHIFT+M) Opens the monitor window, or sets the focus to this
window.
Mnemonics Information Opens the mnemonics window, or sets the focus to this
(CTRL+SHIFT+I) window.
Start Page Opens the start page, or sets the focus to this document
VIEW->DEBUG SUBMENU
Locals (CTRL+SHIFT+L) Opens then Locals window, or sets the focus to this
window.
Watch 1 (CTRL+SHIFT+1) Opens the watch 1 window, or sets the focus to this
window
Watch 2 (CTRL+SHIFT+2) Opens the watch 2 window, or sets the focus to this
window
Watch 3 (CTRL+SHIFT+3) Opens the watch 3 window, or sets the focus to this
window
RAM Opens the RAM window, or sets the focus to this window
External RAM Opens the XRAM window, or sets the focus to this window
PROJECT MENU
Create New System Creates a new system and adds it to the current project.
Set Current System Active Sets the selected system to active state. The active system
is used by the debugger and isp programming interface.
DEBUG
Single Step (F8) Executes one statement and sets the debugger to pause
mode.
Set next Statement (F10) Sets the program counter to the caret.
Goto Next Statement The current program position is moved down by one
instruction, without executing the current command (only
during a debug session).
EXTRA MENU
ISP Flip (F12) Sends the output file (program segment) of the active
system via ISP to the microcontroller.
FENSTER MENU
Split Horizontal Splits the current editor window into two horizontal parts.
Split Vertical Splits the current editor window into two vertical parts.
New Horizontal Tab Group Divides the editor horizontally, places the currently
selected window underneath the other windows.
New Vertical Tab Group Divides the editor vertically, places the currently selected
window to the right of the other windows.
HILFE MENU
Technical Support Opens the installed email client and inserts a standard
body. You can add your request and send it directly to our
service.
THE TOOLBARS
Prog-Studio has 6 toolbars with which various commands that can be run, displayed, activated or de-
activated.
Standard
Documentation Format
Debug
Source Editor
Hexeditor
Stopwatch
Toolbars can become floating or docked state. Toolbars could be docked to any border of the
application. The default position is the border underneath to the menu bar.
1. Drag the toolbar on the grip (if the toolbar is docked) or on the title bar (if the toolbar is
floating).
2. Drop the toolbar to the target position at the border or drop the toolbar out of the border bar
to let the toolbar float.
2. Open the context menu with a right mouse click on any toolbar. Check then corresponding
item to show the toolbar, or uncheck it to hide the toolbar.
STANDARD
The Standard Toolbar contains all standard functions such as Copy / Paste, Undo / Redo etc.
New Project(CTRL+N) Starts a wizard for creating a new project, if another project is
currently open it is closed.
Open Project (CTRL+O) Opens an existing project, if another project is currently open it is
closed.
Open File Opens an existing file without adding it to the current project.
Cut (CTRL+X) Cuts out the selected content and copies it to the clipboard.
ISP Flip (F12) Sends the output file (program segment) of the active system via
ISP to the microcontroller.
Project Manager Opens the project manager or sets the focus to this window.
(CTRL+SHIFT+P)
Error List (CTRL+SHIFT+E) Opens the error list window or sets the focus to this window.
Output (CTRL+SHIFT+O) Opens the output window, or sets the focus to this window.
Monitor (CTRL+SHIFT+M) Opens the monitor window, or sets the focus to this window.
Mnemonics Information Opens the mnemonics window, or sets the focus to this window.
(CTRL+SHIFT+I)
Breakpoints Opens the breakpoint window, or sets the focus to this window.
Locals (CTRL+SHIFT+L) Opens then Locals window, or sets the focus to this window.
Watch 1 (CTRL+SHIFT+1) Opens the watch 1 window, or sets the focus to this window
Watch 2 (CTRL+SHIFT+2) Opens the watch 2 window, or sets the focus to this window
Watch 3 (CTRL+SHIFT+3) Opens the watch 3 window, or sets the focus to this window
RAM Opens the RAM window, or sets the focus to this window
External RAM Opens the XRAM window, or sets the focus to this window
FORMAT
The Format toolbar contains functions that can be used for formatting text in the text editor (not in
the source code editor).
Font size selection Chooses then font size for the current selection.
HEX-EDITOR
The Hex Editor Toolbar contains functions for navigating and modifying the data in the Hex Editor.
Decrease width Reduces the number of bytes shown in a row of the editor.
Increase width Increases the number of bytes shown in a row of the editor.
Goto first NOT 0FFH Byte Jumps to the first byte in the data set that is not FFH
Goto next NOT 0FFH byte Jumps to the next byte in the data set that is not FFH.
Goto last NOT 0FFH byte Jumps to the last byte in the data set that is not FFh.
TEXT EDITOR
The Text Editor Toolbar contains functions for structuring the source code.
DEBUG
The Debug toolbar contains functions necessary for controlling the debug session.
Pause (F6) Pauses the debug session, the location is shown in the editor.
Single Step (F8) Executes one statement and sets the debugger to pause mode.
Goto Previous Statement The current program position is moved up by one instruction,
without executing the current command (only during a debug
session).
Goto Next Statement The current program position is moved down by one instruction,
without executing the current command (only during a debug
session).
STOPWATCH
The stopwatch toolbar contains functions for measuring times and machine cycles during a debug
session.
Toggle display unit Checked is time unit. Uncheck for machine cycle unit
WORKSPACE
The development environment (IDE) is composed of various windows with different functions:
WINDOWS
Project Manager Manages projects and system meta informations and files.
Error list Displays the last occured errors of the last assembling.
Start page Offers a recent projects list and displays general information.
Locals Displays and offers modification abilities for all local variables.
Externes RAM Displays and offers modification abilities of the Debugger RAM.
PROJECT MANAGER
The individual files can be opened and displayed in the editor for
editing by double-clicking on them in the project manager. You
can also rename, delete are create objects such as the project, a
system or a file within the project manager. You can drag and
drop files and subfolders to other folders.
Within the doc and src folders subfolders can be created for
source and documentation files to improve the structuring of
large projects.
SYMBOL EXPLANATION
Project This is the main category under which several systems for a project are located.
System Since an actual project will contain one or more microcontrollers, a symbolic “System”
was developed to contain the source files, documentation, hardware configuration and
assembler output files for each chip.
CONTEXT MENU:
With a click of the right mouse button a context menu with the
following functions can be displayed in the project manager.
- Activates the selected systems. Only the currently active system for the project is assembled.
ASM MNEMONIC
This table serves as a summary of all possible op-codes for the 8051 micro-controller and shows the
hex code, assembly instruction including operators, how many bytes this instruction takes up in
memory and how many machine cycles the corresponding instruction takes.
With the “Group Mnemonic” button you can switch between a simple list and a list by
functional group.
Clicking on a column header sorts the list according to this column (also when using functional groups).
WATCH LISTS
The watch lists show the current values for the entered variables during a debug session. Three watch
lists are available in the IDE, so that the symbols can be separated into logical groups if required.
New variables can be added from the source code editor or another watch list using drag and drop, or
alternately can be entered directly. To move a variable from the source code editor to a watch list
using drag and drop, first select the variable (for example be double-clicking on it) an then drag it to
the watch list while holding down the mouse button.
The variable values are editable and can be changed during program execution.
With this button you can toggle the display format for the entire list between hexadecimal and
decimal form.
This button deletes the currently selected entry. Alternately you can use the [DEL] key.
LOCALS LIST
All variables defined in the system are displayed in the locals list during the debug session. The
variable name, its current value and the storage location (compared to chip architecture). are shown
With this button you can toggle the display format for the entire list between hexadecimal and
decimal form.
The variable values are editable and can be changed during program execution.
RAM LIST
The RAM list provides an overview of the internal RAM in the address range 00h-0FFh. The address,
value in hex or decimal and the decoding of each value into the individual 8 bits are displayed.
With this button you can toggle the display format for the entire list between hexadecimal and
decimal form.
The address values are editable and if changed can affect program execution. By double-clicking
individual bits of a value can be manipulated.
EXRAM LIST
The EXRAM list provides an overview of the simulated external storage in the address range 0000h-
0FFFFh. The address of every eighth byte and the values of the bytes [address] – [address + 7] are
displayed in hexadecimal.
The address values are editable and if changed can affect program execution. With a double-click you
can open an editor for individual values.
OUTPUT LOG
In this log individual assembler functions such as start and end times for the program build are logged.
ERROR LIST
All errors, warnings and messages generated during the build process by the assembler are output to
this window. The type (error, warning, or message), a counter, an error description, the file in which
the error was found as well as the position of the error within the file are all displayed.
Double-clicking on an entry makes the editor display the location at which the error occurred on the
screen. The cursor is moved to the corresponding location.
The source code editor is the core element in which all files related to a project can be edited. The
source code editor was developed for the comfortable, simple and clearly laid out coding of programs.
This is attained through current technologies such as code-folding, line-marking and code-highlighting.
Code-folding allows for the maximizing and minimizing of code segments. In this way you can increase
the legibility of your program by hiding non-relevant sections. Recent changes are highlighted by line
markings so that you always see where you are working.
Binary files (e.g. the created program code) are displayed in the hex editor (chapter “Hex Editor”).
Changes made since opening or creating a source data file are symbolically marked by a respectively
yellow or green bar in front of the corresponding line.
A yellow bar in front of a line shows that this line was modified since opening the file/editor.
A green bar in front of a line shows that this line was modified since opening the file/editor and
that this change was already saved.
BREAKPOINTS
Breakpoints cause the debugger to stop and switch to pause mode (same as the →STOP command).
There are several methods for setting or clearing a breakpoint. Either click on the symbol bar (on the
left side of the line numbers) or select a line where the debugger should stop and click on the menu
option "Toggle Breakpoint" (Hotkey F9).
If a breakpoint was already set on this line it is removed (and vice versa).
This indicates a set breakpoint. This means that the debugger will stop and switch to pause
mode the next time it reaches this line. This is also show with the yellow arrow (see below).
Breakpoints can only be set per line.
This arrow points to the next program instruction (marked in yellow) that the debugger will
execute in the next step. It is only displayed in step or pause modes during a debug session.
BOOKMARK LIST
A drop-down list with all defined bookmarks for the current file is displayed in the upper right corner
of the source code editor. Selecting an entry causes the editor to jump to the corresponding line.
With this function low priority bookmarks (indicated with at list one underscore at the start of
the bookmark) can be hidden from the drop-down list.
If this function is active the bookmark list is displayed in alphabetical order. If it is deactivated
the bookmarks are displayed in the list according to their logical sequence.
When hovering over a variable with the cursor in debug mode a tool tip with information about the
variable is displayed.
In the tool tip the value, type and (if known) the address of the variable are displayed. For bookmarks
the address and type are displayed.
The editor contents can be easily modified with the help of drag & drop. Marked locations can easily
be moved to other locations in the editor using the mouse.
In debug mode it is also possible to mark variables and display them in a watch list or monitor for
observation. A new entry/channel is created for the corresponding variable.
It is also possible to drag a variable from a watch list to the monitor using drag & drop to add a channel
for this variable.
CODE-FOLDING
Source code segments that logically belong together such as macros or user-defined sections are
grouped in the source code editor. These segments can be shown or hidden as required to improve
the legibility of the source code.
Sample:
A program fragment is shown below with a user-defined region and a macro call with two blocks that
can be hidden.
After hiding the macro call by clicking on the minus symbol in front of the macro definition the source
code editor looks as follows.
The macro is reduced to one line and the legibility of the source code was increased. The number of
hidden lines can be seen via the line number column (21-13=8).
By clicking on the plus symbol in front of the hidden block the macro can be fully displayed again.
After hiding the user-defined program block by clicking on the minus symbol the source code editor
looks as follows
The program block was reduced to one line and the name of the program block is displayed in this
location.
Any desired number of program blocks can be stacked within each other. This provides a simple way
to structure the source code file in a good way.
The source code editor can show up to four views of a file simultaneously. For example, a programmer
can look at the body of a function or a macro that he wants to use at the current location.
The views can be resized freely with the mouse, or opened and closed via the “Window” menu.
Sample:
Horizontal editor
split
The mouse can be used to set the split of the window. The following picture shows the source code
editor after a horizontal split.
The source code editor after an additional vertical split of the window.
The window split is removed by pulling back the separators to their original position, or by un-checking
the corresponding item in the “Window” menu.
THE HEX-EDITOR
In the hex editor binary data can be viewed and edited. There are some functions that simplify the
editing of data.
These functions are available as buttons from the toolbar (chapter “The Toolbar”) and as functions on
the context menu. The context menu can be opened using the right mouse button.
This toolbar contains functions for navigating and manipulating the data in the hex editor.
Rolls forward the last operation that was rolled back (redo)
Here the basic editing functions such as “Copy & Paste” or “Undo and Redo” are found. In the
“Selection” menu further expanded functions for editing the current selection are available.
These options can also be selected via the selection box in the
upper right corner of the hex editor.
Set Manually
Fill by Value*
Fill Sequential*
Increase/Decrease Selection*
Increases or decreases all values in the selected area by a specified amount or percentage value.
Depending on the setting, switches the first and second byte/word/double word or quad word
values with each other. If more than one pair is selected the switching is continued by the same
method (for example, byte 1 is switched with byte 2, byte 3 with byte 4, etc.).
Swap Selection*
Switches the selected data with data starting at a specified offset address.
Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com
42
This document is protected by German and international copyright laws. The incomplete or partial use, sale or reproduction, publishing – including
excerpts – of any kind requires the written permission of the author.
Batronix – Prog-Studio User Manual 43
Copies the selected data to a specified address. You can select whether the target range should be
expanded or overwritten.
Calculates a checksum value for the selected range using a selectable algorithm (sum, MD5, SHA-1
or CRC32).
THE MONITOR
The debugger always shows the current variable values at the program position. Therefore it is not
possible to see the value of a variable earlier (for example 8 machine cycles before) without resetting
the debugger and interrupting the program exactly 8 machine cycles earlier. To make this step
unnecessary and to display the variable value changes over time in a better format a monitor was
integrated into Prog-Studio.
SUMMARY
Add channels by entering a variable or with drag & drop for the watch list or source code
editor.
Selecting a channel via a combo box or through selection with the mouse
Easy reading of the values and the differences at particular points in time via 2 traces that can
be freely positioned with the mouse
RECORDING
The monitor has a separate storage for each channels values. During a debug session the values of
each channel (variable) are stored and displayed with each machine cycle.
CHANNEL SETTINGS
The monitor creates a separate channel with its own storage and individual settings for each added
variable.
The symbol table in the chapter “The Toolbar” shows which button executes which function.
o Using the button "Add Channel" prompts for a variable and then creates a new channel for it.
o Adding a channel using drag & drop. Select a variable with a double-click in the source code
editor or by selecting it in a watch list and drag it into the monitor. A new channel is then
created for this variable.
Selecting a Channel
A channel can be selected by clicking on its positioning triangle or by selecting it from the drop-down
list in the monitor toolbar.
A channel has to be selected to make setting changes to it (y-scale, display color, visibility, and
reference line) or to delete it.
Channels can be deleted using the corresponding button on the monitor toolbar, but have to be
selected first. Another button on the toolbar can be used to delete all channels at once.
The reference line for a channel can be moved by dragging the corresponding positioning triangle.
Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com
45
This document is protected by German and international copyright laws. The incomplete or partial use, sale or reproduction, publishing – including
excerpts – of any kind requires the written permission of the author.
46 Batronix – Prog-Studio User Manual
If the snap to grid function is enabled the reference line can only be moved by entire grid segments.
The display of signals can be shown either as a continuous line or as individual values with no
connecting line. This can be set using the corresponding option in the monitor toolbar. Each channel is
set to its own color when created, this can be changed using the color option in the monitor toolbar.
A channel can also be hidden, it is then no longer shown in the display. To make it visible again, it has
to be selected using the channel drop-down list and the shown by clicking on the toolbar button.
Scaling
Each channel can be individually scaled in the y-axis using the toolbar drop-down list. The mouse
wheel can be used to change the x-axis scale for all channels.
TRACE LINES
The monitor offers two trace lines for evaluating the displayed data. These lines can be moved in the
monitor display using the left and right mouse buttons.
The time of the respective trace line and its difference are displayed at the bottom edge of the
monitor.
Each channel has a separate display of its values at the times corresponding to the trace lines as well
as a display of the value change between times T1 and T2.
This button (in the upper left of the toolbar) activates the recording of values for the
created channels during a debug session.
Prompts for a variable and then creates a new channel for it.
PROJECT
Prog-Studio supports the structured development of programs through the consistent implementation
of project oriented development. Source code, documentation, published data and project settings are
managed centrally by a project manager:
Adding new files and folders, copying, moving, or erasing are accomplished with the project manager
in the usual way (shortcuts, context menus and drag & drop) - an external file manager is not required.
This simplifies the management of projects so that a programmer can concentrate on the essentials -
working on their project files.
In some cases it can happen that several micro-controllers are required for the implementation of a
project. This situation is supported by the project manager, which automatically groups all the files
and settings for each micro-controller into systems. Any number of such systems can be contained in a
project and allow for even highly complex project with several micro-controllers to be developed in
Prog-Studio.
In projects with multiple systems one is always marked as active. Only this system is assembled during
a build and simulated during a debug session. Activating a system is done using the project manager
context menu selection “Set to Active Project”. The context menu is called up with a click of the right
mouse button on a system. Please note that the context menu option “Set to Active Project” is only
available by right-clicking on a system and is not shown for the other entries.
When creating a new project the project assistant is launched. Here the framework for a project, such
as project name and folder, can be specified.
You can also select whether a main system should automatically be created in addition to setting the
project name and folder. The default setting is that the main system has the same name as the project.
The clock frequency for the oscillator can also be specified here for this system.
Additional systems, assembly files or documentation can be added to the project in the project
manager.
PRE-PROCESSOR
MACROS
DEFINING MACROS
Definition:
macroname MACRO [ param1[ [ , param2 ] … ] ]
[ LOCAL labelname ]
[ statements ]
ENDM
Components:
Macroname
paramX
Optional. Defines parameters for the macro. These can be used locally in the
Labelname
ENDM
Required, terminates the macro definition.
CALL MACRO
Definition:
macroname [ param1[ [ , param2 ] … ] ]
Components:
Macroname
paramX
Optional. Specifies parameters for the macro. If defined parameters are not specified the value
0 (Null) is used.
Notes:
Labels in macros are treated as global labels. To prevent error messages if the macro is called
repeatedly it is necessary to define the labels as local labels. For this the keyword Local is used.
Sample:
; The smaller variable is loaded into the Accu
CLR C
MOV A, par1
CJNE A, par2, 0
JNC Par2Lesser
SJMP ComapareFinished
Par2Lesser:
MOV A, par2
CompareFinished:
ENDM
$SET
Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com
52
This document is protected by German and international copyright laws. The incomplete or partial use, sale or reproduction, publishing – including
excerpts – of any kind requires the written permission of the author.
Batronix – Prog-Studio User Manual 53
With the assembler instruction $SET variables can be defined that are valid exclusively for the pre-
processor. Such variables can be used, for example, as operators for specific pre-processor
instructions.
Definition:
$SET ( identifier1 [ [ = number ] [, identifier2 [ = number ] … ] ] )
Components:
identifierX
number
Sample:
$ELSE
$END IF
$SET (DEBUGMODE)
$IF DEBUGMODE
$ELSE
$END IF
$INCLUDE
The pre-processor instruction $INCLUDE includes files in the program code. In simplified terms using
an $INCLUDE instruction is no different than replacing the $Include instruction with the contents of a
file.
Anything allowed at the location of the $include instruction can be contained in the included file. A
recursive include that would lead to an infinite loop creates an error.
Definition:
$INCLUDE filepath
Components:
filepath
Required. Specifies the path of the file to be included. Paths that don’t contain spaces can be
used without double quotation marks.
Notes:
The $INCLUDE instruction replaces the old “Include” instruction without leading dollar symbol form
the previous Prog-Studio versions (up to 6.x). Using the old instruction will generate an error.
Sample:
$INCLUDE math.asm
With the $IF pre-processor instruction a particular assembly section can be started.
This, for example, allows customized versions of a program to be assembled from one file by simple
setting a switch.
Definition:
$IF condition
[ statements ]
[ $ELSEIF elseifcondition
[ elseifstatements ] ]
[ $ELSE
[ elsestatements ] ]
$ENDIF
Components:
condition
Required. Expression. Must be True or False or specify a data type that can be implicitly
converted to boolean.
statements
Optional. One or more instructions following $IF…, that are executed when condition is True.
elseifcondition
Required when $ELSEIF … is present. Expression. Must be True or False or specify a data type
that can be implicitly converted to boolean.
elseifstatements
Optional. One or more instructions following $ELSEIF…, that are executed when elseifcondition
is True.
elsestatements
Optional. One or more instructions that are executed when none of the preceding condition-
expressions or elseifcondition-expressions is True.
$ENDIF
Notes:
If the $IF condition is true the block immediately following it is assembled. Following this further
optional conditions can follow using $ELSEIF and/or an alternate program path can be specified with
$ELSE. A pre-processor condition is always terminated with $ENDIF.
These conditional pre-processor instructions replace the old #IF DEBUGGING and #IF NOT DEBUGGING
instructions from previous versions of Prog-Studio (up to 6.x). These are no longer available in the
current version.
Sample:
$SET (DEBUGVERSION, TARGET=8051)
$ELSE ; Optional
$ENDIF
In this chapter the language definition for the assembler language and the basic high-level language
elements are described.
Please note that there are changes to the language definition in comparison to the language definition
of the 6.x and earlier versions of Prog-Studio.
In some situations it can be useful to group several instructions on one line, for example when several
very short instructions follow each other and you want to save space. For this purpose the colon
operator was added.
Sample:
;Waiting loop (100 repetitions)
Mov A, #100D
At least one space is required between the instruction and the colon, otherwise this can not be
differentiated form a jump label.
COMMENTS
The semi-colon is the comment character. The additional comment character semi-colon from
previous versions of Prog-Studio (up to 6.x) was removed from the language definition and has been
reserved for later use.
Sample:
MOV A, #10h ; This comment is OK!
EXPRESSIONS
The order that operations are calculated in follows mathematical rules, i.e. multiplication and division
before addition and subtraction, etc…..
Sample:
OFFSET EQU 10
MOV A, #16^(1/2)
OPERATORS:
The operators are not assembly instructions and do net generate byte code. For this reason operators
for an expression may only contain values that are already known at time of assembly.
0 () Brackets
1 ^ Exponent operator
3 /* Division, Multiplication
4 MOD Modulo
5 + - Addition, Subtraction
11 . Bit operator
HIGH OPERATOR
The high operator is a unary operator that extracts the second-lowest value byte from a number. The
high operator is equivalent to an AND-operation with a constant bit mask of 0FF00h followed by a bit
shift of 8 bits to the right.
LOW OPERATOR
The high operator is a unary operator that extracts the lowest value byte from a number. The low
operator is equivalent to AND-operation with a constant bit mask of 0FFh.
NUMBERS
DECIMAL NUMBERS
Definition:
Number sequences that have no terminate character are interpreted as decimal numbers.
Notes:
The prefix-notation % for decimal numbers in previous versions of Prog-Studio (up to 6.x) was
removed from the language definition.
Sample:
1234 ; Decimal Number OK
HEXADECIMAL NUMBERS
Definition:
A hexadecimal number starts with a number from 0 to 9 followed by any number of digits from the
hexadecimal value range terminated with an H character.
Notes:
The prefix-notation $ for hexadecimal numbers in previous versions of Prog-Studio (up to 6.x) was
removed from the language definition and will be used as a pre-processor prefix in the future.
Sample:
0FFH ; Hexadecimal Number OK
OCTAL NUMBERS
Definition:
A number sequence in the value range from 0-7 followed by an O or Q character is interpreted as an
octal number.
Sample:
777O ; Octal number OK
BINARY NUMBERS
Definition:
A number sequence in the value range from 0-1 followed by a B character is interpreted as a binary
number.
Notes:
The prefix-notation ! for binary numbers in previous versions of Prog-Studio (up to 6.x) was removed
from the language definition.
Sample:
01011011B ; Binary number OK
SYMBOL DEFINITION
EQU
The symbol definition directive EQU allows the definition of symbols which represent registers or
numbers.
Definition:
Symbol EQU Expression
Components
Symbol
Required. The name of the symbol to be defined. Each occurrence of Symbol in the source
code is replaced with the defined expression or register during assembly.
Expression
Required. A standard expression which may also contain other symbols. Forward references
are not allowed.
Register
Required. Any of the following registers are possible:
A, R0, R1, R2, R3, R4, R5, R6, R7
Sample:
MinValue EQU 10
CalcRegLow EQU R0
CalcRegHigh EQU R1
DATA
The symbol definition directive DATA allows the definition of symbols which represent addresses.
Definition:
Symbol DATA Address
Components
Symbol
Required. The name of the symbol to be defined. Each occurrence of Symbol in the source
code is replaced with the defined address during assembly. The use of the address type must
be allowed in the corresponding location.
Address
Required. An address in the range 0 .. 127 or an SFR address in the range 128 .. 255.
Sample:
LcdDataPort DATA P1
BIT
The symbol definition directive BIT allows the definition of symbols which represent individual bit
addresses (individual bits of bit-addressable memory locations).
Definition:
Symbol BIT Bit Address
Components
Symbol
Required. The name of the symbol to be defined. Each occurrence of Symbol in the source
code is replaced with the defined bit address during assembly. The use of the address type
must be allowed in the corresponding location.
Bit-Address
Required. The bit address of a bit-addressable memory location.
Sample:
LABEL
A label defines a name for a program address. With this name the address can be used in an
instruction.
Definition:
Label:
Components
Label
Required. The name of the label to be defined. Each occurrence of Label in the source code
is replaced with the defined program address during assembly. The use of the address type
must be allowed in the corresponding location.
Sample:
LJMP Start
Org 000Bh
Start:
;[...]
ADDRESS CONTROL
ORG
The ORG instruction sets the program address for the following code instructions.
Definition:
ORG Expression
- or -
(Expression):
Components
Expression
Required. A standard expression which may also contain other symbols. Forward
references are not allowed.
Sample:
;Alternative Syntax:
DS
The DS assembler instruction reserves a specified number of bytes in the program memory.
Definition:
DS Number of bytes
Components
Number of Bytes
Required. The number of bytes by which the current program counter should be incremented
from the current program address.
Sample:
INITIALIZE MEMORY
DB
Definition:
Label: DB Expression[, Expression][, ...]
Components
Label
Optional. This symbol indicates the starting address for the initialized memory space.
Expression
Required. One or more comma-separated standard expressions which may also contain
symbols or strings, forward references are not allowed.
Sample:
DW
Definition:
Label: DW Expression[, Expression][, ...]
Components
Label
Optional. This symbol indicates the starting address for the initialized memory space.
Expression
Required. One or more comma-separated standard expressions which may also contain
symbols or strings, forward references are not allowed.
Sample:
The Batronix assembler supports a selection of high-level language elements to simplify the
development of assembler programs and short the timeline for the development process.
DO
Definition:
Do { While | Until } condition
[ statements ]
Loop
- or -
Do
[ statements ]
Components
While
Required unless Until is used. The loop is repeated until condition is False.
Until
Required unless While is used. The loop is repeated until condition is True .
condition
Required. Boolean Expression. Termination or continuation conditions.
Statements
Optional. One or more assembler instructions that are repeated as long as condition is True or
respectively until condition is True.
Loop
Required. Terminates the definition of the Do-loop.
Notes:
An endless loop can be created if an incorrect termination condition is used. The carry bit can be
overwritten by the condition check.
Sample:
MOV index, #5
CLR done
Do
DEC index
Do
INC index
SETB done
End If
Do
DEC index
CLR done
Do
INC index
SETB done
End If
WHILE
Definition:
While condition
[ statements ]
End While
Components
condition
Statements
Optional. One or more assembler instructions following While that are always executed when
condition is True.
End While
Notes:
An endless loop can be created if an incorrect termination condition is used. The carry bit can be
overwritten by the condition check.
FOR
Definition:
For counter = start To end [ Step step ]
[ statements ]
Next
Components
counter
Required for the For instruction. Numeric variable such as accu, register or direct. The control
element variables for the loop.
Start:
Required. Variable such as accu, register or direct or a constant number (beginning with a #).
Starting value for counter.
end
Required. Variable such as accu, register or direct or a constant number (beginning with a #).
Final value for counter.
step
Optional. Constant Number. The value by which counter is incremented or decremented for
each iteration of the loop.
statements
Optional. One or more assembler instructions between For and Next that are executed for the
specified number of times.
Next
Notes:
An endless loop can be created if an incorrect termination condition is used. The carry bit can be
overwritten by the condition check.
Ensure that the counter has a value in the byte range. Therefore the maximal number of iterations
with a For-loop is limited to 256. To create a higher number of repetitions for-loops can be nested.
Sample:
;[Instructions]
Next
;[Instructions]
Next
;[Instructions]
Next
IF
Definition:
If [ [ NOT ] BIT ] condition Then
[ statements ]
[ elseifstatements ] ]
[ Else
[ elsestatements ] ]
End If
- or -
Components
condition
Required. Expression Must be True or False or of a data type that can be implicitly converted
to Boolean.
If BIT Or NOT BIT Keywords are used, only a direct bit addressable memory address or pointers
to such addresses are allowed as condition.
statements
Optional. One or more assembler instructions following If...Then that are always executed
when condition is True.
elseifcondition
Required if ElseIf is present. Expression Must be True or False or of a data type that can be
implicitly converted to Boolean.
elseifstatements
Optional. One or more assembler instructions following ElseIf...Then that are executed when
elseifcondition is True.
elsestatements
Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com
77
This document is protected by German and international copyright laws. The incomplete or partial use, sale or reproduction, publishing – including
excerpts – of any kind requires the written permission of the author.
78 Batronix – Prog-Studio User Manual
Optional. One or more assembler instructions that are executed if none of the preceding
condition expressions is True.
End If
Notes:
The one-line variation can be applied for simple, short tests. In comparison the multi-line variation is
more structured and flexible and generally easier read, maintain and debug.
Sample:
SETB Port3.0
SETB Port3.1
Else
SETB Port3.2
End If
End If