B.A.L. SYSTEM for À Plus/4

by S\_/S of [FIRE]

Release 1.2

Send comments / bugs signal / applications / etc. to: svs_fire@inwind.it

Publishing support by JamesC

Official beta tester: NightBird

SUMMARY:

0 Introduction

    1. The machine
    2. Advanced features

  1. User utilization
    1. Get started
    2. Keyboard
    3. Mass storage
    4. Error managing
    5. Stop a running program

  2. Programmer utilization

    1. System enviroments
    2. Keyboard for service
    3. Program keys
    4. BAL language
    5. Data and memory organization
    6. Addressing modes
    7. Pseudo commands
    8. Manual loading of a program file
    9. Editing a program file
    10. Comments inside the code
    11. Saving a program file
    12. Table of commands BAL (mnemonics)
    13. Map of nibbles of Condition-Register
    14. Table of icons for consolle lights
    15. Table of [Return]-like keys
    16. Table of console lights
    17. Programming notes
    18. Debugging tools
    19. Labels table
    20. Example of a BAL program

  1. Error messages

0 - Introduction

BAL SYSTEM is a new development system package designed for À Plus4. Based on the B.A.L. (Business Assembler Language), an already existing standard for business machines, the enviroment has been improved with many high-level new commands and features. These improvements can easy manage Plus/4 memory and ports, so that BAL SYSTEM is candidated to become the ideal enviroment to run any program, expecially external applications and monitoring like devices and electronic cards.

The package is a complete all-in-one tool: Editor/Debugger/Executer. As I’m a coder J I designed inside it some additional tools to better (and easily) perform testing and debugging. I hope you all enjoy with it, by executing programs under BALSYS, but also by writing your own code.

0.1 - The machine

Original BAL machines had a memory RAM of 1 Kb, expandable to 4 Kb. The standard machines were sold 2 Kb expanded. With BALSYS you can set any memory amount between 1 to 4096 bytes.

Mass storage was a magnetic-cards system (read/write). The user could insert one or more magnetic cards on the reader, and the data went onto/from the memory. Each card could contain till 256 bytes. In this way you could have individual cards (for example one for each customer) or cards-packs programs to be loaded and executed. In BALSYS I’ve maintained the "cards" only as an animation during I/O operations. The real mass storage is now modern disk/tape files.

The output monitor was an integrated two-color printer that could print on any of its three sectioned platen. The output of BALSYS is a screen-window with paper simulation (scrolled); but you can also print (on a real printer) the listing of the program in memory.

For monitoring and signalling there is a console with operating/warning lights. Apart the system lights (Magnetic card request, Keyboard enable, CPU error) the user is enabled to manage (see/set) 8 different programmable lights. With BALSYS you can even show on them icons, to better indicate special status’s or warnings.

 

0.2 - Advanced features

To have an idea of the powerful of this package, run the sample program "MC-POWER" on the D64 disk-image. It does a math calculation of the power of a number you input (x^y). The elaboration is done without any specific function but only using basic operations (+, -, *, /). All the input requests, the controls, the calcoulus’s and the printing (formatted) of result occupy only 76 bytes of code!

But I added new hi-level commands in BAL-SYS, to easy obtain hi-level special performances. For example, there are 3 lines of IRQ available, to monitor the status of a location, or if/when an event happens. This feature works while the program is running, processing something else. Furthermore there are a timer/clock to easily measure times, show it as a watch, or determine timings (stop-watch features can be obtained with only 2 commands).

And many other of course… be curious and read on.

 

1 - USER UTILIZATIONS:

1.1 - GET STARTED:

Just as with a real machine, when you run the BALSYS, O.S. resets all the settings and goes into RUN mode (that is: ready to execute a program). If the file "PREFERENCES.BAL" is found on disk, system will use its data to an autoset (see chapt. 2.18 .SET for more info).

OR

1.2 – KEYBOARD

The keyboard is similar to a normal QWERTY keyboard, but instead of the [Function-Keys] and [RETURN], BAL machines have 6 different RETURN-like keys named S0 S1 S2 S3 S5 S6. These multiple [RETURN]s are used to express the user’ wills (for example: inputing 123 [S0] if datum is to print black; inputing 123 [S1] to print it red; inputing [S6] to cancel). This means that easy the user can choose between 6 possibilities at cost of a single key pressing.

Since we have a Plus4 keyboard (or a PC keyboard if we’re using an emulator) the BALSYS [Return]-like keys are emulates by: r (=S0), or f (=S1) , or g (=S2) , or h (=S3) , or j (=S5) , or k (=S6).

Program keys:

There are also 4 special "program-keys":

c 1 (=p1), c 2 (=p2), c 3 (=p3), c 4 (=p1). (See chapter 2.3)

1.3 - MASS STORAGE

Before the machine is turned off, data should be saved into "Magnetic cards" (maximum 256 bytes each) simulated by a file. Programs can be stored onto series of cards, in order to store programs larger than 256 bytes. But data too, can be saved onto magnetic cards, for example a card for a customer, containing: name, address, balance, etc.

BAL-SYSTEM emulates the cards by an USR file named "MC-…" on floppy or on tape. The management of multiple cards is automatic: it is signaled by a flashing icon on the reader. During I/O operations, [M.C.]-key turns on. To see the BAL-files inside the online disk, type .DIR pseudo from Service-Mode of from StepRun-Mode.

1.4 - ERROR MANAGING

When an error is detected by the system, the condition is signalled by the [ERR]-light on the console and by a beep, then the proper description is shown on the display panel (see table at paragraph 3 to obtain deeper info about each specific error-message). Hit À E to clear the error condition. Be informed that you do not lose any memory datum or pointer set, by clearing the error status.

Before to exec the cleaning through À E, you could hit ? r to obtain extra info:

If the error condition appears while you are in Run-mode (execution of a program), be informed that after the cleaning operation, system will attempt to execute again the same mnemonic. Then, in order to exit from this situation, you could need to change Mode (entering for example into Service-Mode) instead of cleaning the error: Simply press À -S (for Service-mode) or À -T (for StepRun-Mode).

1.5 – STOP A RUNNING PROGRAM

To stop the program running (but while it’s waiting for an input), keep pressed [STOP] until you are deviated onto SERVICE mode. Running is stopped too, when any "halt" command is met during code execution (WAIT / HLT / ON), or when an Error is detected.

 

2 - PROGRAMMER UTILIZATION:

2.1 - SYSTEM ENVIROMENTS

When BALSYS is running, please wait until the [KEYB]-light on console becomes on: it means that an input is requested. This applies also to choose one of the enviroments as following:

À S SERVICE mode, allows:

À T STEP RUN mode, allows:

À R RUN mode, allows:

À E CLEAR executing, allows:

À X RESET executing, allows:

 

2.2 – KEYBOARD FOR SERVICE

Besides the À combinations here above discussed, the keyboard utilization is very similar to standard use. Only the so-called [Return]-like keys (used to end an input) are substituted as below:

r (=S0), f (=S1) , g (=S2) , h (=S3) , j (=S5) , k (=S6).

The Condition-code is affected by the pressed [Return]-like key, so that you can test it and decide a different program path.

Pattern of [Return]-like keys can be enabled/disabled to guide the user inside legal choices (see table 2.15).

I reserved n/[HELP] key to reset standard characters-font in case of error/bug causing an unreadable screen (please advise me if/when this happens J ).

2.3 – PROGRAM KEYS

They are special keys on a real BAL machine, that are here substituted by the following combinations:

c 1 (=p1), c 2 (=p2), c 3 (=p3), c 4 (=p1).

They are used to directly set flags on BALSYS system memory. When enabled, the user can set till 4 flags, following program execution requirements. A Program-key hit does not end the input because it is not a [RETURN]-like key.

For example, if system is waiting for an input:

Hitting: 1 3 c1 5 r

you enter the value 135, but you also set Program-key #1 to inform program of something to remember. The program could take a decision later on the grounds of it.

The nice aspects of Program-keys is that you could press more then one (for example [p1] then [p3]) and that they never affect the input operation. Program keys are normally disabled: only the command KEP inside a BAL program can enable some of them (or all them). When an enabled Program-key is pressed, its bit is stored (set to 1) in a nibble of Condition Register (see table below), so that it can be tested (by mnemonic TIC), or manipulated (ANDed, ORed, XORed or even forced).

CONDITION REGISTER

Nibble

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

¯ Content

Programma-

ble 4 bits

Console

white lights status

(1=on)

Program keys set memory

Last Enter-like

key pressed

Near end-of page memory

I/O functions from peripherals unities

Bits à

3

2

1

0

Program key

À 4

À 3

À 2

À 1

Table of correspondance between Program-keys and the bits of nibble 10 in the Condition Register

2.4 - B.A.L. Language

BAL is a middle level language. It can be put at midway between BASIC and Assembler.

Main features:

For example: you have to multiply 12,34 by 56,7. The values stored in registers are 1234 and 567. When you execute MP (multiply) command you can set its second parameter as 3 (MP 1,3) to shift right the result (699678) of 3 places in a way that it will become the correct size (699) truncated.

 

2.5 - DATA AND MEMORY ORGANIZATION

BALSYS’ memory RAM can be utilized:

Internal representation of values: All values inside registers are BCD coded ($0…$9 for numbers). For example, the value 123456 is stored in a register as 000000000123456C, but be informed that this is automatically done by system.

The sign of a value inside a Register is indicated by its righter nibble. If it is $D then the value is negative, if it is different than $D (typically $C) it is considered positive.

Addresses

of memory

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

 

Nibbles of the register

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

 

Registers #

Register #0

Register #1

 
       

Examples

0

0

0

0

0

0

0

3

5

7

5

2

1

8

9

D

0

0

0

0

0

0

0

0

4

8

9

7

1

0

6

C

 
 

Value here stored: 35.752.189-

Value here stored: 4.897.106+

 

Registers organization in memory

2.6 - ADDRESSING MODES

All Pointers, Registers and Data have to be input as decimal values. Only when specifically necessary you have to input a hexadecimal datum: in this case datum has to be single quoted (See table of Mnemonics below). Registers can easy be indicated by their number (0 is the first Register, 1 the second Register, and so on). In this way you can specify Registers from #0 to #15.

Indirect addressing mode is allowed to aim Registers out that range (#16, #17,…#218, and so on). To refer to one of these Registers, you only have to put its number (as index-value) into one of the direct Registers (0…15) and refer to it by placing as prefix a point "."

Example: we have to use mnemonic ARI x,nn to add 10 to the content of Register #30:

step 1: Insert value 30 into one of the direct Register (say #7);

step 2: Refere to ".7" into statement (it becomes: ARI .7,10)

 

2.7 - PSEUDO COMMANDS (Service-mode or StepRun-mode)

They are commands to be executed immediately. Their names always start by a dot "."

Þ Warning: All the pseudos filling/deleting data in memory do not perform any RAM shifting [see chapt. 2.9] (for example: .DST, .DCC, etc.), then possible following codes/data are overwritten.

[Color Blue means non-standard BAL commands)

Name

Operand

Description

Range

.B

xxx

Transfers PC (Program Counter) to the address of

Label xxx

xxx=0…255

.BP

xxxx

Transfers PC to address xxxx

Xxxx=0…4095

.DCC

xxx…

Writes on memory the alpha-numerical string xxxxxx….

Lenght of xxxx…: 1… 255

.DCN

xxxx…

Stores in the current register the value xxxx…

Xxxx… max 15 digits (positive)

.DCX

xxxx…

Writes in memory the hex string xxxx…

Lenght of xxx: 2 …16 hex

.DST

xxx

Clears following xxx bytes of memory

xxx=1…256

.LRZ

xx

Clears (=zero) xx+1 registers

xx=0…15

.PAS

xxx

Prints on screen xxx alpha-numerical characters

xx=1…256

.PR

xx

Prints the contents of xx+1 registers

xx=0..15 (default = 0)

.PS

xxx

Disassembles and prints on screen xxx+1 mnemonics of the program in memory

xxx=0…255 (default = 0)

.PX

x

Prints from memory as hex and character (Plus4 monitor like)

x=1…256

.RMC

xxx

Loads xxx bytes from magnetic card (file) to memory

starting from PC

xxx=1…256

.TSL

xxx

Transfers SC (Service counter) to the address of label

xxx

xxx=0…255

.TSP

xxxx

Transfers SC to address xxxx

xxx=0…4095

.WMC

xxx

Saves xxx bytes of memory (starting from SC) onto

magnetic card (file)

xxx=1…256

Other non-standard new Pseudo commands

.CON

xxxx

Converts xxxx value into DEC, HEX, and BIN

xxxx=(dec) or $xxxx=(hex)

.DEV

xx

Sets default I/O device (and initializes it)

xx=1 (tape) or 8…15 (disk)

.DIR

 

Shows diskname and MC-FILES from the on-line floppy disk driver

 

.IC

 

Shows all the allowed icons and their id numbers

 

.LIS

xxx

Lists on printer xxx mnemonics from the program in memory

1…256

.MEM

xxxx

Sets memory size

xxxx=1…4096

.MNE

 

Prints the list of all BAL-language mnemonics

 

.PNT

 

Shows the pointers and other system settings

 

.PSE

 

Shows the list of all pseudo commands

 

.SP1

xxxx

Set value of Pointer 1

0…4095

.SP2

xxxx

Set value of Pointer 2

0…4095

.SET

 

Set/unset debug and other emulator settings

Please follow the incoming menu (see chapt. 2.18)

.SVS

 

Greetings message :)

 

.TSR

xxx

Transfers SC to register xxx

xxx=0…255

.?

xxxx

Help to xxx mnemonic

xxxx=any mnemonic name

2.8 – MANUAL LOADING A PROGRAM FROM FILE

After a BALSYS reset (and when just turned it on), you are asked to hit a key to perform autoloading, from autodetected device, of the a BAL program file. You can write a filename or accept the prompt (see chapt. 1.1), or do change mode (see chapt. 2.1) by entering À -S (Service mode), À -T (Step-run mode).

To perform a manual load, you have first to set the Pointer 1 to the address in memory (loading address, normally 0) by using .TSP xxxx (where xxxx is the address), then enter .RMC xxx where xxx is the amount of bytes to load from file. You will be requested for a filename (starting by "MC-"; wildcards accepted). If you don’t remember the name of your files, just hit .DIR to see all them.

If the file is larger than 256 bytes, you must repeat the .RMC xxx command as many times it is necessary.

2.9 – EDITING A PROGRAM FILE

When a program is in memory (loaded or typed), you can edit it. This can be done only by SERVICE mode (À -S). The main operations are:

  1. INSERT new mnemonics: simply type the mnemonic and its operands, then [r]. The new statement will be inserted in memory at the address indicated by SC (Service Counter). All the other code in memory is automatically shift up. SC will automatically increased by 2.
  2. ERASE existing statements: allign the SC to the statement to be erased, then pressg. All the other code in memory is automatically shift down to fill the gap.
  3. MODIFY existing statements: to do modifications, please erase and re-enter the statements.

To navigate inside the code, you can utilize the bi-directional listing: press [CRSR]-[DOWN] to view the next statement(s); press [CRSR]-[UP] to view previous one(s). Service Counter follows the movements.

To view what mnemonic is pointed by the PC, hit [SHIFT]+[=] that is the left-arrow key. For example this is necessary when you want to see which mnemonic is "under" the PC, while you are inserting new mnemonics, because in this case the PC is always aiming the next address.

To skip to a specific location, please use one of the following pseudos:

EDITING KEYS are the normal alphabetical/numerical keys, the [DEL] key to backspace, the e key to erase current line. There is no cursor.

2.10 – COMMENTS INSIDE THE CODE

Even if B.A.L. is not a hi-level language considering that each mnemonic always occupies 2 bytes only, I made it able to accept comments inside the (machine) code. How is this possible? J Well: to insert a comment, many characters long as you wish, you only have to hit ";" then a space, and your comment. For example:

LAB 255 32

; This is a comment inside the code.

TL 1,1 70

PA 1,36 72

The comments will be saved with the program and then will be automatically present inside the listing.

2.11 – SAVING A PROGRAM FILE

To save a program to file, first you have to set the Service Counter to start of area to be saved (by .TSP). If you accept the current device (see icon at top left corner of screen), you only have to hit .WMC xxx (where xxx is the number of bytes to save). If you want to change the device, please utilize the pseudo .DEV x (where x is the device number; 1 for tape, 8…15 for disk drivers). When prompted enter the filename starting by prefix "MC-".

If you wish to save further bytes appending them to previous ones, you can do it, simply by typing further .WMC xxx how many times you want. Please watch the "multiple cards" icon on the I/O device-card, flashing on the screen (bottom-right). If there is, then you can continue the appending operations. When it disappears, then the file is closed and you can not append anymore. Be sure to not execute any command between a .WMC and another one in order to not stop the appending chain operation.

If an already existing file with the same name was found, you are asked to confirm its overwriting: if yes, the previous file is backed up with the name "MC-OLD.USR" and your saved program acquires the name you entered plus ".USR".

 

2.12 - TABLE OF COMMANDS (MNEMONICS)

( * stands for one of the possible condition-code values: 0, 1, 2, or 3)

(this color means non-standard B.A.L. mnemonics)

Name

Ope-rands

Description

Range

Oper. 1

Range

Oper. 2

Di

0

Resulting

1

Condition

2

code

3

API

x,nnn

Pointer x = Pointer x + nnn

1…2

1…256

-

-

-

-

ALRM

x,nnn

During running of program, it

does perform a branch to LAB nnn if and when an event happens.

x=0 Cancel Alarm;

x=1 Event: Plus4 RAM addressed by Pointer1 (2 bytes packed) equals to a value (specified by Register#0);

x=2 Event: Plus4 RAM addressed by Pointer1 (2 bytes packed) has one or more set

bits as specified by a specified mask (specified by Register#0);

x=3 Event: timer achieves or exceeds a value (specified by Register #0)

0…3

0…255

-

-

Value specified

by Regi-

ster #0

was <0

and then was normalized

Value specified

by Regi-

ster #0

was >255 and then was normalized

AR

x,y

Register x = Register x + Register y

0…15

0…15

Res.=0

Res.<0

Res.>0

-

ARI

x,nnn

Register x = Register x + nnn

0…15

0…15

Res.=0

Res.<0

Res.>0

-

B

nnn

Branch to label nnn

0…255

-

-

-

-

-

B*

nnn

Branch to label nnn if Condition=*

0…255

-

-

-

-

-

BEEP

x

Signal sound

x=1 Low frequency long beep; x=2 High frequency short beep

1…2

-

-

-

-

-

BN*

nnn

Branch to label nnn if Condition<>*

0…255

-

-

-

-

-

BRA

nn

End a subroutine and return to call location skippping following nn bytes (0= no skip)

0…62

-

-

-

-

-

BS

nnn

Branch to subroutines starting from Lab nnn

0…255

-

-

-

-

-

CBC

nnn

Compare nnn bytes addressed by Pointer1 and Pointer2

1…256

-

Field on Pointer1 = Field on Pointer2

Field on Pointer1< Field on Pointer2

Field on Pointer1 > Field on Pointer2

-

CBI

x,’hh’

Compare the byte addressed by Pointer x with hex value ‘hh’

1…2

00…FF

Mem=’hh’

Mem<‘hh’

Mem>‘hh’

-

CI

nn,’h’

Compare the nibble nn of Register #0 with the hex value ‘h’

0…15

0…F

Nibble=‘h’

Nibble<‘h’

Nibble>‘h’

-

CIC

nn,’h’

Compare the nibble nn of Condition-Register with the hex value ‘h’ (see table 2.13 below)

0…15

0…F

Nibble=‘h’

Nibble<‘h’

Nibble>‘h’

-

CR

x,y

Compare Register x with Register y

0…15

0…15

Res.=0

Res.<0

Res.>0

-

CRI

x,nn

Compare Register x with value nn

0…15

0…15

Res.=0

Res.<0

Res.>0

-

DE1

-

Define the European editing format (#.##0,00)

-

-

-

-

-

-

DE2

-

Define the English editing

format (#,##0.00)

-

-

-

-

-

-

DE3

-

Define the American editing format (#,###.00)

-

-

-

-

-

-

DFC

‘hh’

Define the filling (hex) character for editing format

20…FF

-

-

-

-

-

DFP

‘h’,y

Set printer’ page parameter ‘h’ with content of Register y

0…3

0…15

-

-

-

-

DIV

x,nn

Divide Register #0 by Register x, and Shift left the result of nn positions.

0…15

0…15

-

-

-

-

DRD

-

Invert print color (red/black)

-

-

-

-

-

-

ED

nn,k

Print onto memory addressed by Pointer 1, nn characters from Register #0 (k cyphers will be after comma)

0…15

0…3

Register

#0 = 0

Register

#0 < 0

Register

#0 > 0

-

EDD

nn

Print onto memory addressed by Pointer 1, nn characters from Register #0 in date-using format (##.##.##)

0…15

 

Register

#0 = 0

Register

#0 < 0

Register

#0 > 0

-

EDE

nn,k

Print onto memory addressed by Pointer 1, nn characters from Register #0 in default-using format (k cyphers will be after comma) -> [see mnemonics DE1 DE2 DE3]

0…15

0…3

Register

#0 = 0

Register

#0 < 0

Register

#0 > 0

 

F

nn

Skip forward of nn bytes

0…62

(an even value)

-

-

-

-

-

F*

nn

Skip forward of nn bytes if

Condition=*

0…62

(an even value)

-

-

-

-

-

FD

nnn

Insert value nnn onto Register #0

0…999

-

-

-

-

-

FDS

nnn

Insert value nnn onto Register #0 with shift left of previous content (3 positions)

0…999

-

Any

cypher

cut-off

-

-

Cut-off cypher(s)

FFE

1

Expel the paper sheet

1

-

-

-

-

-

FFP

1

Bore the allignment notch

1

-

-

-

-

-

FFS

1

Open the sheet inserting tub

1

-

-

-

-

-

FI

nn,’x’

Put the hex value x into nibble nn onto Register #0

0…15

0…F

-

-

-

-

FIC

nn,’x’

Put the hex value x into nibble nn Onto Condition-Register (see table 2.13 below)

0…15

0…F

-

-

-

-

FN*

nn

Skip forward of nn bytes if

Condition<>*

0…62

(an even value)

-

-

-

-

-

HLT

-

Stop execution (and enter onto ERROR condition)

-

-

-

-

-

-

HT

nnn

Horizontal tabulation of printing on screen

-

-

-

-

-

-

ICON

xx,y

Set icon #xx to be shown on console light y (see tables

2.14 and 2.16 below).

y= 0 means all icons off

1…16

0…8

-

-

-

-

IDEF

xx,nn

Set a new pattern for an icon.

xx= Icon number (see table

2.14 below)

nn= Label addressing the bitmap definition area (8 bytes)

1…16

0…15

-

-

-

-

K

nn,k

Input a positive value and store it onto Register#0 (nn=max number of cyphers of which k are decimal)

0…15

0…3

Key S0 (Enter)

Key S1

Key S2

Key S3,

S5, or S6

KAC

n

Input an alphanumerical character and store it onto memory addressed by Pointer n( (without echo on screen)

1…2

-

-

-

-

-

KC

nn,k

Input a positive value and store it onto Register#0 (nn=exact number of total cyphers of which k are decimal)

0…15

0…3

Key S0 (Enter)

Key S1

Key S2

Key S3,

S5, or S6

KCS

nn,k

Input a positive/negative value and store it onto Register#0 (nn=exact number of cyphers of which k are decimal)

0…15

0…3

Key S0 (Enter)

Key S1

Key S2

Key S3,

S5, or S6

KEP

‘hh’

Enable program keys (see table)

00…0F

-

-

-

-

-

KES

‘hh’

Enable function keys (see table 2.13 below)

01…6F

-

-

-

-

-

KP

nnn

Input alphanumerical string with printing

1…256

-

Key S0 (Enter)

Key S1

Key S6

Key S2,

S3, or S5

KPM

x,nnn

Input of nnn characters with storing

in memory addressed by Pointer x

1…2

1…256

Key S0 (Enter)

Key S1

Key S6

Key S2,

S3, or S5

KS

nn,k

Input a positive/negative value and store it onto Register#0 (nn=max number of cyphers of which k are decimal)

0…15

0…3

Key S0 (Enter)

Key S1

Key S2

Key S3,

S5, or S6

LAB

nnn

Set a Label point inside a program

0…255

-

-

-

-

-

LAX

x

Retrieve value from auxiliary register to Register x

0…15

-

-

-

-

-

LCR

x,y

Exchange values between Register x and Register y

0…15

0…15

-

-

-

-

LI

x,nn

Insert value nn onto Register x

0…15

0…15

-

-

-

-

LPD

x,yy

Set Pointer x with content of Register y

1…2

0…15

-

-

-

-

LR

x,y

Register x = Register y

0…15

0…15

-

-

-

-

LZ

x,nn

Clear (set zero) content of Register x and nn following Registers

0…15

0…15

-

-

-

-

MDD

x

Modify the second byte (operand[s]) of following mnemonic with content of Register x

0…15

 

Operand x OK

-

-

Operand x was >255

or <0 and was nor- malized

MP

x,nn

Multiply Register #0 with Register x (result goes on Register #0); result will be truncated of nn cyphers

0…15

0…15

-

-

-

-

MPR

x,nn

Multiply Register #0 with Register x (result goes on Register #0); result will be rounded and truncated of nn cyphers

0…15

0…15

-

-

-

-

MVC

nnn

Transfer nnn bytes in memory from address set by pointer 2 to address set by Pointer 1

1…256

-

-

-

-

-

MVI

x,’hh’

Store the hex value ‘hh’ on memory addressed by Pointer x

1…2

00…FF

-

-

-

-

NI

nn,’h’

AND between hex value ‘h’ and nibble nn of Register #0

0…15

0…F

Result = 0

Result

<> 0

-

-

NIC

nn,’h’

AND between hex value ‘h’ and nibble nn of Condition Register (see table 2.13 below)

0…15

0…F

Result = 0

Result

<> 0

-

-

NL

‘h’,nn

Perform nn linefeed on printer device ‘h’

1…7

0…15

Near endpage achieved

Near endpage not achieved

-

-

NLF

1,nnn

Perform nnn linefeeds on AFF device (printer)

1

0…255

-

-

-

-

OI

nn,’h’

OR between hex value ‘h’ and nibble nn of Register #0

0…15

0…F

Result = 0

Result

<> 0

-

-

OIC

nn,’h’

OR between hex value ‘h’ and nibble nn of Condition Register (see table 2.13)

0…15

0…F

Result = 0

Result

<> 0

-

-

ON

‘hh’

hh=00: Error red light on

hh=01: Green light on

hh=02: Green light off

00…02

-

-

-

-

-

P

nn,k

Print nn cyphers of Register #0, of which k as decimal

0…15

0…3

Reg.#0=0

Reg.#0<0

Reg.#0>0

-

PA

x,nnn

x=0: Reserved for future (now the same as x=1)

x=1 or x=2: Print nnn+1 characters from memory addressed by Pointer x

x=3: Print a string located at LABEL nnn, of any lenght, until a $00 value is met

1…2

1…255

-

-

-

-

PD

nn

Print nn cyphers of Register #0, using date-format (##.##.##)

0…15

0…3

Reg.#0=0

Reg.#0<0

Reg.#0>0

-

PE

nn,k

Print nn cyphers of Register #0, of which k as decimal, using extended-format (#.###,## or #,###.##)

0…15

0…3

Reg.#0=0

Reg.#0<0

Reg.#0>0

-

PEU

nn,k

Print nn cyphers of Register #0, of which k as decimal, using extended-format (#.###,## or #,###.##) and coloring negative values red.

0…15

0…3

Reg.#0=0

Reg.#0<0

Reg.#0>0

-

PI

‘hh’

Print the hex character ‘hh’

20…7F

-

-

-

-

-

PI*

‘hh’

Print hex character ‘hh’ if

Condition=*

20…FF

-

-

-

-

-

PK

x,nn

Move nn ASCII characters from memory addressed by Pointer 2, and store them into Register x (performing a BCD packing)

1…15

1…15

All characters are

numeric

At least a character

was not numeric (it is skipped)

At least a character was hex (it is conver-ted)

-

POP

-

Pop-up one level of subroutine return-addresses stack

-

-

-

-

-

-

PU

nn,k

Print nn cyphers of Register #0, of which k as decimal, and coloring negative values red.

0…15

0…3

Reg.#0=0

Reg.#0<0

Reg.#0>0

-

R

nn

Skip back of nn bytes

0…62

(an even value)

-

-

-

-

-

R*

nn

Skip back of nn bytes if Condition=*

0…62

(an even value)

-

-

-

-

-

RAND

nnn

Generate a random value, between 0 and nnn, on Register# 0

0…255

-

-

-

-

-

READ

nnn

Move to Register#0 the content of the Plus4 memory RAM cell, which address is specified after LABEL nnn (packed into 2 bytes)

0…255

-

Value is

= 0

-

Value is

> 0

-

RMC

nnn

Read nnn bytes from Magnetic Card (file) and store them on memory addressed by Pointer 1

1…256

-

Nnn=total bytes on MC

Nnn>total bytes on MC

-

-

RN*

nn

Skip back of nn bytes if Condition<>*

0…62

(an even value)

-

-

-

-

-

SHL

x,nn

Shift left of nn cyphers inside

Register x

0…15

0…15

Any

cypher

cut-off

-

-

Cut-off cypher(s)

SHOW

x,nnn

Show by the 8 cursor lights the bits’ status of a specific Plus4 location (which address is indicated by LAB nnn)

x=0: Clear all lights (and possible IRQ)

x=1: Set

x=2: Show by "Visa" icons the previous status, and by turning on the bits of current status;

x=3: Continuous updated show (IRQ)

0…3

0…255

All the bits are zero (any light on)

-

One or more bits are 1

(when x = 2): Previous pattern had one or more bits on, while current pattern has not any bit on

SHR

x,nn

Shift right of nn cyphers inside

Register x

0…15

0…15

Any

cypher

cut-off

-

-

Cut-off cypher(s)

SPI

x,nnn

Move backward the pointer x of nnn bytes

1…2

1…256

-

-

-

-

SR

x,y

Register x = Register x – Register y

0…15

0…15

Result=0

Result<0

Result>0

-

SRI

x,nn

Register x = Register x – nn

0…15

0…15

Result=0

Result<0

Result>0

-

TCP

-

Cross exchange between pointers values (Pointer1 = Pointer2; Pointer2 = Pointer1)

-

-

-

-

-

-

TEST

x,‘hh’

Compare value of Plus4 RAM addressed by Pointer x (packed in 2 bytes) with hex value hh

1…2

00…FF

Memory = hh

Some set bits in hh result set

in Memory

too

All the set bits in hh are set in Memory

too

Any of previous cases

TI

nn,’h’

Test nibble nn of Register #0 with bitmask h (4 bits hex)

0…15

0…F

Any tested bit is set (=1)

Some tested bits are set (=1)

-

All the tested bits are set (=1)

TIME

x

x= 0 Reset timer to 0 and starts counting

x= 1 Set timer (start value is took from Register #0)

x= 2 Current timer value is moved onto Register #0

x= 3 Shows on display current timer (counting continues)

x= 4 Timer is continuously shown on display (IRQ)

x= 5 Stops and Clear timer showing on display (after choice 4)

0…5

 

Clock

value is

= 0

(not performed during IRQ mode)

-

Clock

value is

> 0

(not performed during IRQ mode)

-

TIC

nn,’h’

Test nibble nn of Condition-Register with bitmask h (4 bits hex) (see table 2.13 below)

8…15

0…F

Any tested bit is set (=1)

Some tested bits are set (=1)

-

All the tested bits are set (=1)

TL

x,nnn

Pointer x = Label nnn

1…2

0…255

-

-

-

-

TRD

x,y

Pointer x = content of Register y

1…2

0…15

-

-

-

-

UPK

nn,x

Move nn cyphers from Register x, to memory addressed by Pointer1 (converting BCD nibbles to ASCII bytes)

1…16

0…15

-

-

-

-

VT

1,nnn

Vertical tabulation on paper

1

0…255

Near endpage achieved

Near endpage not achieved

-

-

WAIT

-

Suspend programm running

and wait for a key or a Mode-change (À +key)

-

-

-

-

-

-

WRIT

nnn

Poke the value of Register #0 into Plus4 memory RAM cell, which address is specified after LAB nnn (2 bytes packed)

0…255

-

Value to

be poked

is = 0

-

Value to

be poked

is > 0

Value to

be poked was >255

or <0 and was norma-lized

WMC

nnn

Write nnn bytes to Magnetic Card (file) by reading from memory addressed by Pointer 2

1…256

-

Nnn=total bytes on MC

Nnn>total bytes on MC

-

-

XI

nn,’h’

XOR between hex value ‘h’ and nibble nn of Register #0

0…15

0…F

Result = 0

Result

<> 0

-

-

XIC

nn,’h’

XOR between hex value ‘h’ and nibble nn of Condition Register (see table 2.13)

0…15

0…F

Result = 0

Result

<> 0

-

-

;

kkkk

Insert the comment "kkkk…." Inside the code

any string (lenght must be lower than 256)

-

-

-

-

-

 

 

2.13 – Map of nibbles of Condition-Register:

CONDITION REGISTER

Nibble

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

Content

Programma-

ble 4 bits

Console

white lights status

(1=on)

Program keys set memory

Last Enter-like

key pressed

Near end-of page memory

I/O functions from peripherals unities

For utilizations with mnemonics CIC, FIC, KEP, NIC, OIC, TIC, XIC

2.14 - Table of icons for the 8 programmable console lights:

(lamps status is mapped at nibbles 12, 13 of Condition-Register)

Number

Icon draw

ASCII codee

1

Space (any icon)

32

2

Filled box

160

3

Visa sign

162

4

Exclamation mark

33

5

Question mark

63

6

Commodore mark

64

7

Up arrow

30

8

Electric lamp

69

9

Ramp

102

10

Denied signal

125

11

Ball

119

12

House

176

13

Flash

174

14

Danger signal

165

15

Hammer

173

16

Documents

126

Icons can be managed by mnemonics ICON, IDEF or pseudo .IC

 

2.15 - Table of [RETURN]-like keys (to finish an input):

(To enable a pattern use KES mnemonic)

Keys à

F6

F5

--

F3

F2

F1

Returnr

 

Bits à

6

5

4

3

2

1

0

 

First nibble

Second nibble

Examples:

             

Result: $01 (KES ‘01’)

           

X

Only [Return] key is enabled

Result: $02 (KES ‘02’)

         

X

 

Only [F1] key is enabled

Result: $21 (KES ‘21’)

 

X

       

X

Enabled keys: [Return], [F5]

Result: $0C (KES ‘0C’)

     

X

X

   

Enabled keys: [F2], [F3]

Last [RETURN]-like key is stored in nibble 9 of Condition-Register

 

2.16 - Table of console lights:

CONDITION REGISTER

Nibble

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

¯ Content

Programma-

ble 4 bits

Console

white lights status

(1=on)

Program keys set memory

Last Enter-like

key pressed

Near end-of page memory

I/O functions from peripherals unities

Bits à

7

6

5

4

3

2

1

0

Position No. for icons

1

2

3

4

5

6

7

8

Use bit value for mnemonics FIC, NIC, OIC, TIC, XIC.

Use position value for menmonic ICON.

 

2.17 - PROGRAMMING NOTES:

To write a program you must operate as follow:

If you plan to use Registers (as often it happens), you must reserve memory room to avoid writing code over the memory used by them, then skip on another higher address. Each Register emploies 8 bytes then, for example, if you plan to use Registers #0, #1, #2 you have to skip 8 x 3 = 24 bytes and start inputing code from address 24, as here shown:

Register #: locations:

    1. 0…7
    2. 8…15
    3. 16…23

TL 1,1 34 is OK, because 34 is an even-number

TL 1,1 35 is wrong, because 35 is an odd-number

Remember this when you list menmonics (with .PS pseudo for example), because if you wrongly attempt to decode starting from an odd-number address, the system could give you unpredictable results (but anyway it does not crash).

If you have this segment already in memory:

LAB 255 32

TL 1,1 34

PA 1,36 36

and you wish to insert a new mnemonic (say API 1,10) between LAB 255 and TL 1,1 you just have to locate at address 34 (.TSP 34) and input API 1,10. Result will be:

LAB 255 32

API 1,10 34

TL 1,1 36

PA 1,36 38

Be warned that only mnemonics inputing performs memory shifting. If you insert data with pseudo commands (i.e. .DCC or .DCX) existing data under the locations are overwritten. Furthermore beware that by inserting new mnemonics, the skip references are not updated, then if the area when you insert a new mnemonic is to be skip over by a skip-mnemonic (i.e. F or R) you have to manually adjust it. See example:

LAB 255 32


F 4 34 ;skips next 4 bytes

TL 1,1 36

LAB 10 38


PA 1,36 40

Now figure you insert a new menmonic (say DE1) before PA 1,36; result will be:

LAB 255 32


F 4 34 ;skips next 4 bytes

TL 1,1 36

LAB 10 38


DE1
40

PA 1,36 42

That is wrong because we wanted to aim the PA 1,36 mnemonic with the skip from address 34. Well: we must adjust F 4 to F 6: result will be:

LAB 255 32


F
6 34 ;skips next 6 bytes

TL 1,1 36

LAB 10 38


DE1 40

PA 1,36 42

 

LAB 255 32

TL 1,1 34

PA 1,36 36

If you wish to delete menmonic "TL 1,1", just locate the SC to address 34 (.TSP 34) and press [F2]. Result will be:

LAB 255 32

PA 1,36 34

Notice that mnemonic PA 1,36 has assumed the address 34 instead of 36.

Shifting down needs manual adjustmensts of possible skips references, as discussed above for shifting-up.

 

 

2.18 - DEBUGGING TOOLS

When not in RUN-mode, the system is on a debug-like status, and you could use all the tools at disposal, in particular the pseudo commands, to test memory, insert data, change pointers, etc. All these pseudo commands (starting by a dot ".", see pseudo table 2.7) are at disposal of coder in STEPRUN-mode too, so that you can test (and modify) the values at any step of processing.

Furthermore there are the following tools:

.SET pseudo command. When you hit .SET r system replies showing a menu of settings with these meanings:

L Enable/Disable duplicated-labels warning on diplay, while building labels table. See chapt. 2.19 to learn how to operate and which choices you have at disposal (default = disabled)

M Shows debugging messages during inputing and running (default = disabled)

S Enable/Disables RAM shifting after insert/delete a mnemonic (default = enabled)

A RAM size = 100 bytes only (from 0 to 99) (default = off)

R View Registers’ values (from #0 to #8) and pointers. If on, this feature allows you to watch in run-time the modifications of values of first 9 Registers and 2 pointers. Run speed results slowed. (default = off)

E When in Error-status, system will automatically do a [CLEAR] without pressing [CBM]-[E]. If this feature is on, you can not view the error messages. (default = off), but only hear the beep.

C When an I/O error is detected during an I/O (MC-CARD file) operation, system attempts again to redo it. This feature is useful if you are using 64HDD, but could enter a neverending loop if you are using a normal drive. (default = on)

D Enables a separate display with many self-updating programming info. This frees the normal display to show only error and system messages. The separate display is able to show the current executable mnemonic (or comment), the Stack level, and Alarm status, in addition of the normal info (Program counter, Service Counter, Condition code). (default = on). The visualization is depending from [N] flag (see next paragraph).

e Exits from menu.

Press the keys (one or more) you wish to set / reset any of the above features, and [ESC] when finished, to return.

Each time you set/reset a flag, you are informed of current updated status of all settings.

An important feature of .SET pseudo is that when you exit from it, the PREFERENCES.BAL file is automatically updated, with current sets, current memory amount, current I/O device, and last filename used. Next time you run BalSys (or even if you reset it) system will use these data to be self configurated.

 

[?]-key while in Error-status. When [E]-light is turned on in the console, system is in Errror Status. The display shows the description of the error. Before clearing it with [CBM]-[E], you may press [?] + [Return] to view more info, as values of pointers, stack deep, enabled keys, alarms, and the mnemonic whose execution caused the error. The error condition will remai, until you clear it by [CBM]-[E], or change mode.

.PSE pseudo command Lists all the pseudos supported by BAL-SYSTEM

.MNE pseudo command Lists in alphabetic order, all the mnemonics of BAL-SYS language.

.? xxxx pseudo command. This is the help to any mnemonic (xxx=mnemonic name). By typing it you can easy know:

    1. if that mnemonic exists J ;
    2. what is its binary code to store it in memory;
    3. if the data (operands and/or values) fits the second byte only, or a part of the first byte too;
    4. format of data;

Furthermore if the mnemonic has two forms (absolute or conditioned), you are showed the 2 forms with their separate values. For example: F mnemonic are shown as F alone (unconditioned skip) and as F+ (conditioned skip – F0, F1, F2, F3 according to Condition-Register value).

WAIT mnemonic. It is a break-point like instruction. When RUN process meets this mnemonic, execution is paused and on display you’ll see a message telling you "WAIT AT: xxxx" where xxxx is the address in memory where processing is arrived. You can press [Return] to continue running by executing next mnemonic, or press [À ]+key to switch to other modes (SERVICE / STEPRUN / CLEAR / RESET).

.LIS pseudo command Allows you to have a list of your program, on a real printer.

2.19 – LABELS TABLE

In order to speed up the running of a BAL program, system compiles a table of the labels that are used by the program in memory. This is performed automatically before the launch of first running, and all the times a following modification affects the code, since the last time the labels-table was compiled.

The user has not care about it, being automatic and fast, he only see a blinking system message during the processing.

The programmer could make a good use of it too, in order to check if there are Labels that are duplicated. To do this, please set the warning-option by .SET L. After this if a duplicate label is found, a proper message is shown on the panel, waiting for:

this is the right way, if a new program was loaded overlaying a previous one, longer.

found);

the double occurences (after seen, you can choice to continue or to stop).

2.20 - EXAMPLE OF A BAL PROGRAMM

POWER CALCULATOR (by S\_/S 2003)

We plan: Register#0 for calcoluses and result

Register#1 number to be powered

Register#2 power

Register#3 (future expansions :)

Address Mnemonic Comments

….. Room for Registers 0, 1, 2, 3 (4 x 8 = 32 bytes; addresses: 0…31)

32 LAB 255 -------------------- Entry point (start of executing)

34 TL 1,1 Pointer1 aims Label 1 (Messages area)

36 PA 1,36 Print 36 characters from address pointed by Pointer1 (clear, home and title)

38 LAB 100 ------------------------ Main cycle

40 TL 1,2 Pointer1 aims Label2

42 PA 1,13 Print 13 characters from address pointed by Pointer1 (request message for number)

44 K 5,0 Accepts input of max 5 number-characters (any decimal, any negative). They are stored as value

into Register #0.

46 LR 1,0 Copy value of Register #0 onto Register #1 (Number to be powered)

48 API 1,13 Advances Pointer1 by 13 bytes (P1=P1+13)

50 PA 1,13 Print 13 characters from address pointed by Pointer1 (request for power - message)

52 K 3,0 Accept input of max 3 number-characters (any decimal, any negative). They are stored as

value into Register #0.

54 LR 2,0 Copy value of Register #0 into Register #2 (Power)

56 CRI 2,0 Compare Register #2 with "0" (this affects the "Condition-code")


58 FN0 4 If Condition-code is not zero (power<>0) then skip forward next 4 bytes

60 FD 1 Let Register #0 = 1 (set result as 1)

62 B 102 Goto LAB 102 (Print result)


64 CRI 2,1 Compare Register #2 with "1" (power is 1?)


66 FN
0 4 If not, then skip forward next 4 bytes (Condition-code is 0 when values are equals, after CRI)

68 LR 0,1 If yes, Register #0 (result) will be loaded by Register #1 (number)

70 B 102 Goto LAB 102 (Print result)


  1. LAB 103 ------------------------ Processing

74 LR 0,1 Let Register #0 = Register #1


76 MP 1
,0 Multiply Register #0 for Register #1, with no (,0) shifting of result. Result goes into Register

#0 (Register #0 = Register #0 * Register #1)

78 SRI 2,1 Subtract "1" from Register #2 (power)

80 CRI 2,1 Compare Register #2 with "1" (power = 1?)


82 RN
0 8 If not then skip backward 8 bytes (à address 76)

  1. LAB 102 ------------------------- Print result

86 API 1,13 Advance Pointer1 by 13 bytes (P1=P1+13)

88 PA 1,12 Print 12 characters from address aimed by Pointer1

90 DE1 Enable European using for number (#.###,##)

92 PE 9,0 Print using of value of Register #0 (9 cyphers, 0 decimal)

94 API 1,12 Advance Pointer1 by 12 bytes (P1=P1+12)

96 PA 1,20 Print 20 characters from address pointed by Pointer1

98 KAC 2 Accept 1 character from keyboard without to print it and storing it on address aimed by Pointer2 (0 in this case)

100 CBI 2,’59’ Was it "Y"? (ASCII code 56) Compares byte aimed by Pointer2 with $59 ("Y")

102 API 1,20 Advances Pointer1 by 20 bytes (P1=P1+20)

104 B0 100 If Condition–code is 0 then branch to LAB 100 (Condition-code was affected by CBI 2,’59’

execution; any modification is never done by API)

106 PA 1,6 Else print 6 characters from address aimed by Pointer1 (bye message)

108 WAIT End of program

110 LAB 1 --------------------------- Titles messages area

(you can see them by .PAS or .PX)

148 LAB 2 --------------------------- Other messages area

(you can see them by .PAS or .PX)

214 LAB 0 --------------------------- End of code

(not necessary to BalSys)

 

 

3 – ERROR MESSAGES

Number

Error message on display

Description

0

MNEMONIC [HLT] OR [ON]

Running have met one of the halting mnemonics. Press [?] to know where on memory it stays.

1

MISSING LABEL 255

Label 255 is not present inside the program in memory. Since it determines the entry point of the running, the program cannot be executed.

2

NOT EXISTING LABEL

The mnemonic or pseudo command refers to a Label that does not exist inside the program.

3

OUT-RANGE VALUE

The value you’ve supplied to the mnemonic or to the pseudo command is outer the allowed range. Press [?] to know what mnemonic caused this error and its value.

4

UNKNOWN PSEUDO

The name of the pseudo you attempt to execute is wrong. (Do not insert space between the dot and the pseudo-name. On the contrary insert a space between pseudo-name and the operand).

5

MISSING DATUM

The mnemonic or the pseudo needs a datum that you have not supplied (insert a space between pseudo/mnemonic and the operand).

6

DISABLED FUNCT.KEY

The function key you’ve pressed is not enabled on BalSys. Remember that only F1, F2, F3, F5, F6 are enabled (to accomplish BAL machines emulation.). F8/Help key is programmed to re-enable the screen in case of a crash causing garbage; it works only when system is not running.

7

ODD NUMBER OF DATA

The number of data must be even (typically when requested couples of hex values) For example: pesudo .DCX hhhh

8

NO REGISTER POINTED

Before to execute this pseudo you must aim to one register in memory. Registers used areas of 8 bytes of memory (for example 0…7 is belonging to Register#0, 16…23 is belonging to Register#2). If you want execute a pseudo affecting registers, please set Service Counter to the start of one of them (by .TSR, or .TSP or using bidir listing)

9

NOT HEX CHAR(S)

One or more characters are not a valid hexadecimal number (0…9 or A…F) then it can not be managed.

10

MC-FILE NOT READY

A problem happens by opening the USR file you specified as file-name for the requested I/O operation. Try .DIR pseudo to view the list of valid BAL files on disk. Check also the device number, as shown in the icon at top left of screen. (Device number can be changed by :DEV pseudo)

11

NOT ENOUGH DATA ON MC

".RMC xxx" psudo or "RMC xxx" mnemonic had requested to load xxx bytes from MC-FILE, but the file contains less data than xxx.

12

WRITE ERROR

The saving operation on I/O device went into error. Possible causes can be: drive not ready, disk not ready, disk protect on, etc. In case you’re using 64HDD connection, this problem could often happen: please use pseudo .SET E to obtain an automatic redo when error.

13

POINTER OUT OF MEMORY

Pointer 1 or Pointer 2 attempt to be set beyond the top memory border.

14

UNKNOWN DEVICE

As standard I/o device, you can set: 1 for tape, or 8, 9, …15 for disk drives

15

NO DRIVE CONNECTED

You attempted to do a disk operation while no disk-drive is logical connected (devices no. 8, 9, …15)

16

NON-NUMERIC CHAR

System was requested to perform a math operation or a numerical convertion, in a memory area where there is a non-numerical character. For example you cannot use a register if in its area was stored an alphabetic letter.

17

READ ERROR

The reading operation from MC-FILE went into error. Possible causes can be: device not ready, file corruption, device fault. In case you’re using 64HDD connection, this problem could often happen: please use pseudo .SET E to obtain an automatic redo when error.

18

NOT A MNEMONIC

The code in memory is not belonging to any legal mnemonic, then it can not be executed as a BAL command. This error appears when PC was wrongly aimed to an area with data (table, strings, etc.).

19

VALUE MUST BE EVEN

The operand cannot be an odd number. (For example to examine as hexadecimal an area of memory with pseudo .PX, you have to view the data as couples)

20

UNKNOWN STATEMENT

The running does not understand the current code the PC is aiming. It is possible the PC wrongly points to a data area. Remember that not all the possible 256 values of a bytes correspond to command codes.

21

END OF MEMORY

You cannot continue the current operation because you’ve already achieved the top of BAL memory. Be informed that you can set a greater amount of memory, but the .MEM pseudo (maximum is 4096). The possible program in memory is not affected by the enlargement.

22

OUT OF MEMORY

The mnemonic or the pseudo caused a pointer, or PC, or SC to go beyond the top memory border. If this error appear, then system was not able to link the start of memory (for example if you have memory size of 300, and you hit ".PX 30" from address 290, system will show the 10 bytes till the end of memory, then it will continue from 0 to 19 and the error does not happen)

23

WRONG ADDRESSING

The mnemonic does not support that addressing mode. Type in the pseudo ".? XXX" (where XXX stands for the mnemonic name) to obtain help about the supported addressing mode by that mnemonic. The error appears also when you set an indirect register, if the mnemonic only supports direct registers (see chapt. 2.6).

24

UNKNOWN STEP-RUN COM.

When in Step-run mode you are not allowed to insert / deleting mnemonics.

25

DIVISION BY ZERO

The register specified by the operand of mnemonic DIV contains a null value.

26

INVALID INDIRECT VALUE

When use indirect addressing mode, the value of the indirect register must specify an existing register. For example if you have a memory size of 800, then you can not refer to a register number greater than 99 because it is not existing inside the memory map (the register# 99 is the last one, being located from 792 to 799).

27

OVERFLW VALUE >999.999.999

The maximum value to be processed, stored or load is that one (a billion less one)

28

INCOHERENT DATA

The two operand you set are incoherent between themselves (for example "KC 3,5" you can not set 5 decimal ciphers while you ask for a max of 3 inputing ciphers)

29

DATA VALUE MUST BE POSITIVE

No value lower then 0 is allowed here

30

STACK OVERFLOW

The maximum level of nesting is 4. You did attempt to insert a further level. Maybe you’ve forgotten to return from a subroutine by mnemonic BRA (or cancel a level step by mnemonic POP)

31

ANY DATUM IN STACK

The system was requested to return from a subroutine, while it is not inside a subroutine. This error can happen when you write more BRA mnemonics (end of subroutine and return) than BS (go subroutine). It could also appear running POP mnemonic (cancel subroutine level),

32

RET.-LIKE KEY DISABLED

You did finish the input with one Return-like key (that are: [Return], [F1], [F2], [F3], [F5] or [F6]), but that one was disabled. The program did process a KES mnemonic by which the key was deliberately disabled.

33

PRINTER NOT READY

You’ve requested to print the listing of the BAL program in memory, but the printer does not reply. It could be not turned on, not connected, or fault.

34

PROGRAM-KEY DISABLED

You did hit one of the so-called Program-keys (that are: [CTRL-1], [CTRL-2], [CTRL-3], [CTRL-4]), but that one was disabled. The program did process a KEP mnemonic by which the key was deliberately disabled.