GENERAL CONCEPTS FOCAL-2D is a programming language mounted on top of SIM41. The commands are the same of sim41 but programs could be written in four directions (down, top , left or right). There is a programming grid with 10 columns (version 1.0) A typical program could change the direction of evaluation using \\ and // If evaluation is from top to down \\ changes direction to right. If evaluation is from down to top \\ changes direction to left. If evaluation is from top to down // changes it to left. If evaluation is from down to top // changes it to right. Evaluation from left to right \\ changes it to down. If right to left \\ changes it to direction up. If left to right // changes it to up. If right to left // changes it to down. If a program finds an empty cell the program stops. GTOs and LBLs. A program could jump to another cell on the grid. The Label's name must be unique on the grid ( Focal-2d Version 1.0) Oriented LABELS LBL> nn Receives a jump and set direction to right LBL< nn Receives a jump and set direction to left LBL^ nn Receives a jump and set direction to up LBL nn Receives a jump and set direction to down The separator MUST BE a single space. REVERSE programming command allows change the direction of evaluation to the opposite direction. XEQ and RTN. (6 levels. The direction of each level is saved) NOP : No operation is a dummy instruction. It does not execute anything. NULL : The same thing. To write a program: Open the program auxiliary window and write manually your programs on the grid. There is a combo box to control the current direction. Activate a programming cell with mouse left click. Choose the direction with the Combo box and press R/S on the calculator. Also, it is possible run a program selecting an arrow around the word "run" located on the auxiliary program window. -------------------------------------------------------------------- FOCAL-2D is based on SIM41. -------------------------------------------------------------------- SIM41 is a user code emulator with a main window (the calculator) and several child windows for viewing and editing programs, memory, flags and the stack. Only one child window of each type may be loaded at a time. For example, if you press the P button twice you will see a single child program window. In earlier test versions it was possible to load several windows of the same type, but I disabled this option to improve usability. The child windows are fully editable. For example, all values of X, Y, Z, T , ALPHA or LASTX may be changed by typing directly into the edit boxes of the stack window. Example 1: Open the stack window. Go to the X register and click with the mouse within the edit box. Suppose that the edit box has the number 9.0000000000000 Use the PC key "delete" to erase the number completely. Now enter 5 and press the PC keyboard TAB. The display of the calculator changes showing the number 5 formated with the current Fix. Now enter 1E3 [TAB] within the edit box. The display of the calculator shows the new value: 1000.0000 (if FIX 4 is set). Example 2: Open the Flags Window, go to flag number 9, edit the cell status, enter 1, go to the calculator window, press the gold key, then [FS?], and the keys [0] and [9] . The calculator display should say "YES". Now, go to the flags window and change the status value of the flag 09 to 0. If you press [gold] FS? 09 on the calculator, the answer in the display is "NO" Example 3: Open the memory window, scroll the grid down to memory register 20. Go to the calculator window, press the keys [8] [STO] [2] [0] and the value in the memory window changes immediately. Now, change the value in the memory window grid to 6. If you press [RCL] [2] [0] in the calculator window you will see the new value in the calculator display. PROGRAMMING THE CALCULATOR. As in SIM41 for DOS, you can use any text editor to write your programs. The programs are ASCII files with a PRG extension. Currently, I am working on compatibility with the instruction set in Leo Duran's HP41UC utility. SIM41 for Windows allows you to edit or write your programs within the child program window. You can still write programs in the calculator window in PRGM mode. To execute a program from file: [XEQ] [ALPHA] program_name [ALPHA] in run mode. You do not need to include the .PRG in the program name. [CATALOG] 1 shows all programs located in the current directory. You can easily change the current step using the child program window. Go into the grid of the child program window, scroll until you find the new step. Press the mouse over the cell with the step, then it will be the new current step. Check out this: go to the calculator window, activate program mode with the key [PRGM]. The step is the same that you previously chose in the child window. The calculator understands programs written in uppercase or lowercase. (I prefer lowercase. The eyes are less tired when you read programs in lowercase) There are two buttons in the child window for changing from uppercase to lowercase: [A to a] changes from uppercase to lowercase, [a to A] from lowercase to uppercase. A simple way for executing a program is to open the child program window, scroll up until you reach step 1, press the mouse over that line. Then go to the calculator window and press [R/S] If you wish to run your program from a later point, first click upon that step in the child program window and then press [R/S] Also, you can put the calculator in program mode, open the child program window and press the SST key. Then, you can see the step change in the child window. If you edit an instruction in the program window, when you finish editing and press the [TAB] key of your computer, you will see the changes in the calculator display (if program mode is active). Try this: put the calculator in program mode, open the child program window. Go to any instruction in the current program using [SST]. Insert a new instruction by clicking the left mouse button on the calculator keys. You will see the program window immediatelly updated with the new instruction. Then, use the key [<-] to delete some step. The program step vanishes in the calculator display and from the program window. SAVING AND LOADING OBJECTS. You can save the SIM41 flags in a .flg file, memory in a .mem file and the current program into a .PRG file. These files are ASCII. Use the SAVE and LOAD buttons in the child windows. You can edit these files with any text editor and reload them in SIM41. The format is straightforward: A .flg file has a 0 or a 1 in each line. The first line is flag 00, the second line is flag 01 and so on. A memory file has Memory 00 in the first line, Memory 01 in the second line and so on. Don't worry about the format, you can write a line as 5.0000000000000 or 5; it's the same thing. A program file has the first program instruction in the first line and so on. You may begin the program with an alpha label. For example: LBL "HELLO". The END instruction in the last line is also optional. So, a program can be of only a line. For example: + You save this program with a name. For example: ADD.PRG Note that currently there are several versions of SIM41 with different skins. The .41c files provided with each skin are mutually exclusive. If you install all versions in the same directory you may only load a single version at a time. If you wish to load several SIM41 instances at the same time, you need to install them in different places. DISTRIBUTION Focal-2D is freeware. I am not responsible for anything you do with this software. If something goes wrong I am not responsible for that. Use this software at your own risk! I hope you like it and you will send me some comments. It is currently under development. Some commands are not implemented yet but will be implemented soon. Cheers: Alvaro Gerardo Suarez. algesuar@yahoo.com https://sim41.webcindario.com