Inbound 9027578700386596128

Download as pdf or txt
Download as pdf or txt
You are on page 1of 78

PROG-STUDIO

Manual
2 Batronix – Prog-Studio User Manual

TABLE OF CONTENTS

TABLE OF CONTENTS ............................................................................................................ 2

SYSTEM REQUIREMENTS...................................................................................................... 6

MINIMUM SYSTEM CONFIGURATION ............................................................................. 6

RECOMMENDED SYSTEM CONFIGURATION .................................................................... 6

LICENSING OPTIONS FOR PROG-STUDIO .............................................................................. 7

COMMUNITY .................................................................................................................. 7

PERSONAL ...................................................................................................................... 7

PROFESSIONAL ............................................................................................................... 7

EDUCATIONAL ................................................................................................................ 8

INSTALLATION, REGISTRATION, ACTIVATION ...................................................................... 9

INSTALLATION ................................................................................................................ 9

REGISTRATION ............................................................................................................. 13

GENERAL ACTIVATION NOTES ............................................................................... 13

AUTOMATICALLY ACTIVATING YOUR BATRONIX PRODUCT.................................... 14

MANUALLY ACTIVATING YOUR BATRONIX PRODUCT............................................. 15

ACTIVATION CONFIRMATION AND ERROR RESOLUTION ........................................ 16

AUTOMATIC ACTIVATION FAILURE ........................................................................ 17

MANUAL ACTIVATION FAILURE ............................................................................. 17

THE DEVELOPMENT ENVIRONMENT .................................................................................. 18

APPLICATION STRUCTURE ............................................................................................ 18

MENU BAR ................................................................................................................... 18

USAGE OF THE MENU BAR .................................................................................... 18

FILE MENU ............................................................................................................ 19

EDIT MENU ........................................................................................................... 19

VIEW MENU .......................................................................................................... 20

VIEW->DEBUG SUBMENU................................................................................. 20

PROJECT MENU ..................................................................................................... 21

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

EXTRA MENU ........................................................................................................ 21

FENSTER MENU ..................................................................................................... 22

HILFE MENU .......................................................................................................... 22

THE TOOLBARS ............................................................................................................. 22

POSITIONING THE TOOLBARS ................................................................................ 22

SHOW AND HIDE TOOLBARS ................................................................................. 23

STANDARD ............................................................................................................ 23

FORMAT................................................................................................................ 25

HEX-EDITOR .......................................................................................................... 25

TEXT EDITOR ......................................................................................................... 26

DEBUG .................................................................................................................. 26

STOPWATCH ......................................................................................................... 27

WORKSPACE................................................................................................................. 27

WINDOWS ............................................................................................................ 27

PROJECT MANAGER .............................................................................................. 28

SYMBOL EXPLANATION .................................................................................... 28

CONTEXT MENU: .............................................................................................. 29

ASM MNEMONIC .................................................................................................. 29

WATCH LISTS......................................................................................................... 29

LOCALS LIST........................................................................................................... 30

RAM LIST ............................................................................................................... 31

EXRAM LIST ........................................................................................................... 31

OUTPUT LOG ......................................................................................................... 31

ERROR LIST ............................................................................................................ 32

THE SOURCE CODE EDITOR ........................................................................................... 33

VISUALISING OF CHANGES IN THE SOURCE CODE EDITOR...................................... 33

BREAKPOINTS........................................................................................................ 34

BOOKMARK LIST.................................................................................................... 34

VISUALIZING OFF DEBUG INFORMATION ............................................................... 35

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


3
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.
4 Batronix – Prog-Studio User Manual

DRAG & DROP ....................................................................................................... 35

CODE-FOLDING ..................................................................................................... 36

SPLIT-VIEWS (WINDOWS 2000|XP|2003|VISTA) ................................................... 38

THE HEX-EDITOR .......................................................................................................... 40

THE HEX-EDITOR TOOLBAR ........................................................................................... 41

THE HEX-EDITOR CONTEXT MENU ......................................................................... 42

WORKING WITH SELECTED DATA .................................................................................. 42

THE MONITOR .............................................................................................................. 44

SUMMARY ............................................................................................................ 44

RECORDING........................................................................................................... 45

CHANNEL SETTINGS .............................................................................................. 45

TRACE LINES .......................................................................................................... 47

THE MONITOR TOOLBAR ....................................................................................... 48

PROJECT 49

CREATING A NEW PROJECT .......................................................................................... 49

PRE-PROCESSOR................................................................................................................. 51

MACROS....................................................................................................................... 51

DEFINING MACROS ............................................................................................... 51

CALL MACRO .................................................................................................... 52

$SET ............................................................................................................................. 52

$INCLUDE ..................................................................................................................... 55

$IF, $ELSEIF, $ELSE, $ENDIF .......................................................................................... 56

ASSEMBLER LANGUAGE DEFINITION.................................................................................. 58

ENTERING MULTIPLE INSTRUCTIONS ON ONE LINE ....................................................... 58

COMMENTS ................................................................................................................. 58

EXPRESSIONS ............................................................................................................... 59

OPERATORS:................................................................................................................. 60

HIGH OPERATOR ................................................................................................... 60

LOW OPERATOR .................................................................................................... 60

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


4
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 5

NUMBERS..................................................................................................................... 61

DECIMAL NUMBERS .............................................................................................. 61

HEXADECIMAL NUMBERS ...................................................................................... 61

OCTAL NUMBERS .................................................................................................. 62

BINARY NUMBERS ................................................................................................. 62

SYMBOL DEFINITION .................................................................................................... 63

EQU ...................................................................................................................... 63

DATA ..................................................................................................................... 64

BIT ........................................................................................................................ 65

LABEL .................................................................................................................... 66

ADDRESS CONTROL ...................................................................................................... 67

ORG ...................................................................................................................... 67

DS ......................................................................................................................... 68

INITIALIZE MEMORY ..................................................................................................... 69

DB ......................................................................................................................... 69

DW........................................................................................................................ 70

ASSEMBLER HIGH-LEVEL LANGUAGE COMPONENTS..................................................... 71

DO ........................................................................................................................ 71

WHILE ................................................................................................................... 74

FOR ....................................................................................................................... 75

IF........................................................................................................................... 77

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


5
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.
6 Batronix – Prog-Studio User Manual

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.

MINIMUM SYSTEM CONFIGURATION

 Windows 98SE/ME, Windows 2000/XP, Windows Server 2003, Windows Vista

 500 MHz Processor

 256 MB RAM

 200MB free hard disc space

 Screen resolution 1024x768 pixel or better

 Microsoft .NET Framework 2.0

RECOMMENDED SYSTEM C ONFIGURATION

 Windows XP Service Pack 2, Windows Vista

 800 MHz processor or better

 512 MB RAM

 300 MB free hard disc space

 Screen resolution 1280x1024 or better

 Microsoft .Net Framework 2.0

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


6
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 7

LICENSING OPTIONS FOR PROG-STUDIO

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.

 Developed programs may NOT be used for commercial purposes.

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:

 Developed programs may NOT be used for commercial purposes.

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:

 Developed programs may NOT be used for commercial purposes.

RECOMMENDED FOR:

 School

 Any institution of learning

 university

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


8
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 9

INSTALLATION, REGISTRATION, ACTIVATION

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.

Select English and click on “OK”

Click on “Next”

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


9
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.
10 Batronix – Prog-Studio User Manual

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.

Select your installation folder and click on “Next”

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


10
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 11

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


11
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.
12 Batronix – Prog-Studio User Manual

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


12
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 13

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.

GENERAL ACTIVATION NO TES

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


13
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.
14 Batronix – Prog-Studio User Manual

A Batronix product can be activated automatically over the internet or as an alternative manually by
sending an email or calling Batronix-Support.

AUTOMATICALLY ACTIVATING YOUR BATRONIX PRODUCT

To activate your product automatically please proceed as follows:

1. Ensure that your computer is connected to the internet.

2. Check that you have selected the activation method "Over the Internet".

3. Automatic activation is initiated by clicking on the “Activate Now” button.

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


14
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 15

MANUALLY ACTIVATING YOUR BATRONIX PRODUC T

For manual activation select “by Email or by Telephone” in the activation dialog and then click on
“Activate Now”.

This brings up the following dialog (without black bars):

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


15
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.
16 Batronix – Prog-Studio User Manual

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.

ACTIVATION CONFIRMATION AND ERROR RESOLU TION

Upon successful activation Prog-Studio displays the following message.

After closing this dialog box the development environment starts, and no further messages are
displayed when starting Prog-Studio.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


16
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 17

AUTOMATIC ACTIVATION FAILURE

The following message is displayed if the automatic activation fails.

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.

MANUAL ACTIVATION FAILURE

The following message is displayed if the manual activation fails.

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


17
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.
18 Batronix – Prog-Studio User Manual

THE DEVELOPMENT ENVIRONMENT

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.

USAGE OF THE MENU BAR

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


18
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 19

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.

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.

Close Project The current project is closed.

Close File Closes the current document window

Save (CTRL+S) Saves the file currently displayed in the editor.

Save As … Saves the file currently displayed in the editor with a new
name.

Save All Saves all open documents.

Print (CTRL+P) Prints the file currently displayed in the editor.

Print Preview Shows a preview of the printed document.

Recent Projects … Submenu: Contains the last used projects.

Recent Files … Submenu: Contains the last used files.

Exit (ALT+F4) Closes the Prog-Studio software.

EDIT MENU

Undo (CTRL+Z) Reverses the last change made in the editor.

Redo (CTRL+SHIFT+Z) Redoes the last change made in the editor.

Cut (CTRL+X) Cuts out the selected content and copies it to the clipboard.

Copy (CTRL+C) Copies the selected content to the clipboard.

Paste (CTRL+V) Pastes data from the clipboard selection.

Delete (Del) Deletes the selected content.

Select All (CTRL+A) Selects all content.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


19
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.
20 Batronix – Prog-Studio User Manual

Additional Submenu: Contains additional commands, to modify the


content of documents.

Find (CTRL+F) Opens the find dialog.

Replace (CTRL+H) Opens the replace dialog.

Find Next (F3) Searches the next match.

VIEW MENU

Project Manager (CTRL+SHIFT+P) Opens the project manager or sets the focus to this
window.

Debug Submenu: Contains menu items to open debug windows.

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

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

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


20
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 21

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.

Add … Submenu: Contains elements, that could be added to an


system.

Assemble active system Assembles the active system of the 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

Start (F5) Starts a debug session.

Pause (F6) Pauses the running debug session, execution can be


continued with Start Debugging or with Step Into

Stop (F7) Stops the active debug session.

Single Step (F8) Executes one statement and sets the debugger to pause
mode.

Toggle Breakpoint (F9) Toggles the breakpoint fort he current line.

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).

Goto Previous Statement The current program position is moved up by one


instruction, without executing the current command (only
during a debug session).

EXTRA MENU

Language Submenu: Contains all supported languages for quick


access.

IDE Theme Submenu: Contains all supported Themes of for quick


access..

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


21
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.
22 Batronix – Prog-Studio User Manual

ISP Flip (F12) Sends the output file (program segment) of the active
system via ISP to the microcontroller.

Options … Opens the options dialog.

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

Contents (F1) Opens this Help document.

Technical Support Opens the installed email client and inserts a standard
body. You can add your request and send it directly to our
service.

About Prog-Studio Opens an about dialog..

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

All Symbols in the Toolbars will be shortly described in this chapter.

POSITIONING THE TOOLBARS

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


22
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 23

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.

To move a toolbar follow these steps.

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.

SHOW AND HIDE TOOLBARS

Toolbars can be shown or hidden in two different ways.

1. Check or uncheck the corresponding menu item in the View->Toolbars Submenu.

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.

Save (CTRL+S) Saves the file currently displayed in the editor.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


23
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.
24 Batronix – Prog-Studio User Manual

Save All Saves all open documents.

Cut (CTRL+X) Cuts out the selected content and copies it to the clipboard.

Copy (CTRL+C) Copies the selected content to the clipboard.

Paste (CTRL+V) Pastes data from the clipboard selection.

Delete (Delete) Deletes the selected content.

Find (CTRL+F) Opens the find dialog.

Undo (CTRL+Z) Reverses the last change made in the editor.

Redo (CTRL+SHIFT+Z) Redoes the last change made in the editor.

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

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


24
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 25

FORMAT

The Format toolbar contains functions that can be used for formatting text in the text editor (not in
the source code editor).

Font selection Chooses the font of then current selection.

Font size selection Chooses then font size for the current selection.

Bold Turns bold for then selection on or off.

Italic Turns italic for the selected text on or off.

Underline Turns underline for the selected text on or off.

Strikeout Turns strikeout for then selected text on or off.

Align left Aligns the selected lines to the left side.

Align center Centers the selected text.

Align right Aligns the selected text to the right side.

Text color Sets the text fore-color.

Back color Sets the text back-color.

Bullets Turns the enumeration off.

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.

Word length 1 byte Shows the data in byte format.

Word length 1 byte Shows the data in word format.

Word length 4 byte Shows the data in double-word format.

Word length 8 byte Shows the data in quad-word format.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


25
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.
26 Batronix – Prog-Studio User Manual

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.

Comment lines Comments the selected lines out.

Uncomment lines Uncomments the selected lines.

Increase Indent Increases the indent of the selected lines.

Decrese Indent Reduces the indent of the selected lines.

DEBUG

The Debug toolbar contains functions necessary for controlling the debug session.

Program counter Displays the current program counter.

Machine cycles Displays the machine cycles.

Start (F5) Starts the debug session.

Pause (F6) Pauses the debug session, the location is shown in the editor.

Stop (F7) Ends the debug session.

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).

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


26
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 27

STOPWATCH

The stopwatch toolbar contains functions for measuring times and machine cycles during a debug
session.

Display Shows the current Value of the display..

Start Stopwatch Starts an measure.

Pause Stopwatch Paused the measure.

Stop Stopwatch Stops the measure.

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.

Output Displays status and system messages..

Monitor Displays variables in relation to time.

Mnemoics Informationen Displays information on Mnemonics.

Start page Offers a recent projects list and displays general information.

Breakpoints Displays a list of all indicator breakpoints.

Locals Displays and offers modification abilities for all local variables.

Watch 1-3 Displays and manipulates program variables

RAM Displays and offers modification abilities of the Debugger RAM.

Externes RAM Displays and offers modification abilities of the Debugger RAM.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


27
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.
28 Batronix – Prog-Studio User Manual

PROJECT MANAGER

Prog-Studio supports you through its comfortable project


management system and allows for an optimal overview even
with large projects.

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.

Config Controller Hardware Configuration (clock frequency)

out Contains all the assembler output files

doc Contains all the documentation files

src Contains all the source code files

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


28
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 29

CONTEXT MENU:

With a click of the right mouse button a context menu with the
following functions can be displayed in the project manager.

- Opens the selected file in the editor.

- Adding systems, files and folders

- Cuts the selected objects(s)

- Copies the selected object(s)

- Pastes the clipboard contents at the current cursor position.

- Renaming systems, files and folders

- Starts the assembly process

- 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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


29
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.
30 Batronix – Prog-Studio User Manual

With this button you can toggle the display format for the entire list between hexadecimal and
decimal form.

This button erases the entire list.

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


30
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 31

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


31
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.
32 Batronix – Prog-Studio User Manual

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


32
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 33

THE SOURCE CODE EDITOR

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”).

VISUALISING OF CHANGES IN THE SOURCE COD E 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.

This provides a quick overview of lines that where changed.

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


33
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.
34 Batronix – Prog-Studio User Manual

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


34
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 35

VISUALIZING OFF DEBUG INFORMATION

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.

DRAG & DROP

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


35
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.
36 Batronix – Prog-Studio User Manual

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).

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


36
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 37

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


37
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.
38 Batronix – Prog-Studio User Manual

SPLIT-VIEWS (WINDOWS 2000|XP|2003|VISTA)

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

Vertical 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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


38
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 39

The source code editor after an additional vertical split of the window.

Deactivating the window split

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


39
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.
40 Batronix – Prog-Studio User Manual

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


40
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 41

THE HEX-EDITOR TOOLBAR

This toolbar contains functions for navigating and manipulating the data in the hex editor.

Erases the buffer contents

Opens an existing file

Saves the current buffer contents

Cuts the selected data

Copies the selected data

Pastes copied data at the cursor position

Erases the selected data

Rolls back the last operation (undo)

Rolls forward the last operation that was rolled back (redo)

Reduces the number of bytes displayed in one row of the editor

Increases the number of bytes displayed in one row of the editor

Shows the data in byte format

Shows the data in word format

Shows the data in double-word format

Shows the data in quad-word format

Jumps to the first byte in the data that is not FFh

Jumps to the next byte in the data that is not FFh

Jumps to the last byte in the data that is not FFh

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


41
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.
42 Batronix – Prog-Studio User Manual

THE HEX-EDITOR CONTEXT MENU

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.

WORKING WITH SELECTED DATA

These options can also be selected via the selection box in the
upper right corner of the hex editor.

Set Manually

Here you can specify exactly what data should be selected.

Fill by Value*

Fills the selected area with a specified value

Fill by Random Values*

Fills the selected area with random values

Fill Sequential*

Fills the selected area with a specified range of values

Increase/Decrease Selection*

Increases or decreases all values in the selected area by a specified amount or percentage value.

Swap Selection Content*

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

Copy Selection To…*

Copies the selected data to a specified address. You can select whether the target range should be
expanded or overwritten.

Calc Selection Checksum

Calculates a checksum value for the selected range using a selectable algorithm (sum, MD5, SHA-1
or CRC32).

Warning! All steps marked with a * can not be reversed!

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


43
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.
44 Batronix – Prog-Studio User Manual

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

 Turn monitor recording on and of.

 Record the last 10 000 machine cycles.

 Automatically set the reference line on the grid.

 Show the channels as line graphs or peeks.

 Erase the channel buffer (start new recording)

 Remove all channels

 Add channels by entering a variable or with drag & drop for the watch list or source code
editor.

 Removes an individual channel

 Selecting a channel via a combo box or through selection with the mouse

 The scale of the selected channel is settable

 Display of the channel is settable

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


44
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 45

 Deactivating a channel (recording continues but the channel is not displayed).

 Moving the reference line of a channel with the mouse

 Freely settable time scale using the mouse wheel

 Easy reading of the values and the differences at particular points in time via 2 traces that can
be freely positioned with the mouse

 Adapting the display colors of the monitor (themes)

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.

Adding variables for tracking

New channels can be added using different methods.

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.

Deleting a channel or all channels

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.

Deleting a channel has absolutely no impact on the existing source code.

Moving the Reference Line

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


46
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 47

The Channel Display

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


47
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.
48 Batronix – Prog-Studio User Manual

THE MONITOR TOOLBAR

Summary of the monitor toolbar buttons.

This button (in the upper left of the toolbar) activates the recording of values for the
created channels during a debug session.

This button cancels the recording.

Toggle for the snap to grid function (reference line setting)

Toggles the channel representation (continuous line or individual values).

Clears the values stored for all channels (Reset)

This button deletes all channels

Prompts for a variable and then creates a new channel for it.

This button deletes the selected channel

Drop-down list for channel selection

Drop-down list for y-axis scale

Color selection for the selected channel

Show/Hide the selected channel

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


48
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 49

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.

For projects with one system this is always activated.

CREATING A NEW PROJECT

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


49
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.
50 Batronix – Prog-Studio User Manual

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.

Clicking OK creates the project in the specified folder.

Additional systems, assembly files or documentation can be added to the project in the project
manager.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


50
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 51

PRE-PROCESSOR

MACROS

DEFINING MACROS

Definition:
macroname MACRO [ param1[ [ , param2 ] … ] ]

[ LOCAL labelname ]

[ statements ]

ENDM

Components:
Macroname

Required. Specifies the name of the macro to be defined.

paramX

Optional. Defines parameters for the macro. These can be used locally in the

Labelname

Required if Local is present. Defines the specified label as a local label.

ENDM
Required, terminates the macro definition.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


51
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.
52 Batronix – Prog-Studio User Manual

CALL MACRO

Definition:
macroname [ param1[ [ , param2 ] … ] ]

Components:
Macroname

Required. Specifies the name of the macro that should be called.

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

LoadMinToAccu MACRO par1, par2

LOCAL Par2Lesser ; Declares Par2Lesser as local Label

LOCAL CompareFinished ; Declares CompareFinished as local Label

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

Required. Specifies the name of the variable.

number

Optional. Specifies the value of the variable.

Sample:

$SET (VERSION = Plus)

$IF VERSION = Plus

; Instruction for the Plus-Version

$ELSE

; Instruction for other Versions

$END IF

$SET (DEBUGMODE)

$IF DEBUGMODE

; Instruction if the DEBUGMODE flag is set

$ELSE

; Instruction if the DEBUGMODE flag is not set

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


53
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.
54 Batronix – Prog-Studio User Manual

$END IF

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


54
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 55

$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

$INCLUDE "C:\Path with spacesigns\math.asm"

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


55
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.
56 Batronix – Prog-Studio User Manual

$IF, $ELSEIF, $ELSE, $ENDIF

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

Terminates the $IF … $ELSE Block.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


56
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 57

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)

$IF DEBUGVERSION AND TARGET=8051

; Special debug version for the 8051

$ELSEIF DEBUGVERSION AND TARGET=8031 ; Optional

; Special debug version for the 8031

$ELSE ; Optional

; General release version

$ENDIF

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


57
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.
58 Batronix – Prog-Studio User Manual

ASSEMBLER LANGUAGE DEFINITION

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.

ENTERING MULTIPLE INSTRUCTIONS ON ONE LI NE

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

AccuDJNZ: DEC A : JNZ ContinueWaiting ; DJNZ for the Accu

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!

MOV A, #10h ' Generates a syntax error

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


58
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 59

EXPRESSIONS

A sequence of operators and parameters is viewed by the Batronix assembler as a complete


expression and always generates a value as a result. The parameters for an expression can be
numbers, constant references, character strings or further expressions.

Expressions can be used in all locations where a parameter can be specified.

The order that operations are calculated in follows mathematical rules, i.e. multiplication and division
before addition and subtraction, etc…..

Sample:

String1 EQU "Hello" & ", World!"

OFFSET EQU 10

Pointer1 DATA 20h+OFFSET

Const1 EQU 5+9

MOV A, #16^(1/2)

ADD A, #HIGH (13*43)

SUBB A, #00001111B AND 0DEH

DB string1 & " Sample"

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


59
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.
60 Batronix – Prog-Studio User Manual

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.

Priority Operand Description

0 () Brackets

1 ^ Exponent operator

2 HIGH LOW High-Byte, Low-Byte extraction

3 /* Division, Multiplication

4 MOD Modulo

5 + - Addition, Subtraction

6 & Concatenation Operator

7 << >> Bit shifting operator

8 NOT logical negation

9 AND ANDALSO logical AND operator

10 OR ORELSE logical OR operator

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


60
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 61

NUMBERS

DECIMAL NUMBERS

Definition:
Number sequences that have no terminate character are interpreted as decimal numbers.

Optionally a decimal number can be terminated with a D to improve legibility.

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

6638D ; Decimal Number OK

%34883 ; Generates a syntax error

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

0DAH ; Hexadecimal Number OK

DAH ; Generates a syntax error (does not begin with a number)

$34H ; Generates a syntax error

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


61
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.
62 Batronix – Prog-Studio User Manual

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

274O ; Octal number OK

777 ; Will be interpreted as decimal number!!!

069O ; Generates a syntax error (outside of valid value range)

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

!10101010 ; Generates a syntax error

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


62
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 63

SYMBOL DEFINITION

EQU

The symbol definition directive EQU allows the definition of symbols which represent registers or
numbers.

Definition:
Symbol EQU Expression

Symbol EQU Register

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

MaxValue EQU 100

CalcRegLow EQU R0

CalcRegHigh EQU R1

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


63
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.
64 Batronix – Prog-Studio User Manual

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 90h

LcdDataPort DATA P1

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


64
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 65

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:

SerOut1 BIT 90h.0

SerOut2 BIT SerOut1 + 1

LedGreen BIT P0.0

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


65
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.
66 Batronix – Prog-Studio User Manual

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

;Instruction for Timer Interrupt 0

Start:

MOV DPTR, DataTable

;[...]

DataTable: DB 5, 10, 15, 80h, 11111110b, "A", "Abc"

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


66
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 67

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:

Org 000Bh ;Start address for Timer 0

Org $ + 16 ;Current program address ($) + 16 Bytes

;Alternative Syntax:

(000Bh): ;Start address for Timer 0

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


67
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.
68 Batronix – Prog-Studio User Manual

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:

Org 000Bh ;Start address for Timer 0

Ds 20 ;20 Bytes reserved

;The next machine instruction is written to this location


(0BH+20=1FH).

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


68
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 69

INITIALIZE MEMORY

DB

The DB instruction initializes the program memory with 8-bit values.

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:

LcdText: DB "Hello World!"

LcdTextLen: DB LcdTextLen - LcdText

DataTable: DB 5, 10, 15, 80h, 11111110b, "A", "Abc"

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


69
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.
70 Batronix – Prog-Studio User Manual

DW

The DW instruction initializes the program memory with 16-bit values.

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:

DataTable: DW 5, 2310, 65535

DataTable2: DW 323h, 1234h, 0FFFFh

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


70
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 71

ASSEMBLER HIGH-LEVEL LANGUAGE COMPONENTS

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 ]

Loop { While | Until } condition

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


71
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.
72 Batronix – Prog-Studio User Manual

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:

index DATA 50h

done BIT 20h.0

MOV index, #5

CLR done

; do loop while variable index is greater than 0

Do

DEC index

Loop While index > #0

; do loop while done = False

Do

INC index

If index >= #5 Then

SETB done

End If

Loop While done = False

; do loop until index = 0

Do

DEC index

Loop Until index = #0

CLR done

; do loop until done = True

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


72
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 73

Do

INC index

If index >= #5 Then

SETB done

End If

Loop Until done = True

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


73
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.
74 Batronix – Prog-Studio User Manual

WHILE

Definition:
While condition

[ statements ]

End While

Components
condition

Required. Boolean Expression. Termination or continuation conditions.

Statements
Optional. One or more assembler instructions following While that are always executed when
condition is True.

End While

Required. Terminates the definition of the While-block.

Notes:
An endless loop can be created if an incorrect termination condition is used. The carry bit can be
overwritten by the condition check.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


74
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 75

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

Required. Terminates the definition of the For-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.

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.

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


75
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.
76 Batronix – Prog-Studio User Manual

Sample:

MinVal EQU #10

MaxVal EQU #20

For A = #0 To #99 Step 3

;[Instructions]

Next

For R0 = MaxVal To MinVal Step -1

;[Instructions]

Next

For R0 = Port1 To Port3 Step 5

;[Instructions]

Next

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


76
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 77

IF

Definition:
If [ [ NOT ] BIT ] condition Then

[ statements ]

[ ElseIf elseifcondition Then

[ elseifstatements ] ]

[ Else

[ elsestatements ] ]

End If

- or -

If condition Then [ statements ] [ Else [ elsestatements ] ]

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

Terminates the If...Then...Else block.

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:

MaxVal EQU #100

TooMuch BIT 20h.0

If A > MaxVal Then SETB TooMuch Else CLR TooMuch

If Port1 > MaxVal Then

If Port2 > MaxVal Then

SETB Port3.0

ElseIf Port2 < MaxVal Then

SETB Port3.1

Else

SETB Port3.2

End If

End If

Prog-Studio User Manual – © 1998 - 2012 by Batronix, www.Batronix.com


78
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.

You might also like