SB-Projects On Line

Navigation

Home

SB-Assembler
News
Download
Installing
Quick Start
Source Files
Running SBASM
Expressions
Labels
Directives
Macros
Error Messages
Howto?
History
Known Bugs
DIY Cross Overlays

Cross Overlays





Installing SB-Assembler Version 3

Installing on Linux/Unix/MAC

Most computers running Linux, Unix and MAC have the Python interpreter language already installed. You can simply check if this is true by typing the command python in a terminal. If it is installed you'll see the Python version printed followed by the Python prompt >>>.
You may exit the Python interpreter again by typing Ctrl-D.
If it is not installed you need to install the Python programming language first, before you continue installing the SB-Assembler version 3. The SB-Assembler needs at least Python version 2.4 in order to run. If yours is less than 2.4, try to upgrade first.

You may choose to install the SB-Assembler for the current user only (easiest), or system wide for all users. Usually it will be sufficient to install it for the current user only. Simply start by unpacking all files from the download package into a temporary directory.

For an installation for the current user only, copy the file sbasm and the entire directory sbapack into the directory ~/bin . For the less experienced Linux users, the ~/bin directory is the directory /home/you/bin, where you is the user name you used during logon. If the directory ~/bin doesn't exist, create it before copying the files into it. Ubuntu will automatically add the directory ~/bin to your PATH, the next time you start a new bash shell. If your Linux/Unix version doesn't do that, include ~/bin yourself to the PATH variable in your ~/.profile file. Different shells have different ways to add a directory to the PATH, Google is your friend if you use another shell than bash.
All remaining directories from the unpacked zip file can be copied into your projects directory. If you don't have one, create one in a convenient place, wherever you like.
You can throw away the one remaining file sbasm.bat, which is only used for Microsoft users.

System wide installation of the SB-Assembler requires you to be able to become the super user, or root. The process is much the same as for current user only installations. The main difference is the destination of the file sbasm and the directory sbapack. They must be copied to the directory /usr/bin, which requires root privileges. Make sure everyone has the right to execute the file sbasm and read access to all the files in the directory sbapack.
All other directories from the distribution package go, like before into your project directory, wherever you like that to be. There's no need to do that as super user, or root. If all users are interested in having these files at hand you could copy these directories to a shared directory.
In order to speed up startup times, and hence execution times, it is also recommended to pre-compile all the files inside in the directory sbapack. Normally this process is done whenever you run a program for the first time. However this will fail on a system wide installation because a simple mortal doesn't have the rights to write the .pyc files to a system directory.
The following instructions will do that for you:

cd /usr/bin/sbapack
sudo ./precompile.sh

Installing newer releases of the SB-Assembler requires you to overwrite exisiting files with the newer versions. And don't forget to run the precompile script if you installed your copy to the /usr/bin directory.

Final note: On most systems the pyhton interpreter can be found in the directory /usr/bin/. However, on some systems (e.g. FreeBSD) the python interpreter is located in /usr/local/bin/. In that case you will have to change the first line of the sbasm file so that it points to the proper directory. The same is true for the first line of the precompile.sh script, if you need that for system wide installation.
If you don't know where the python interpreter is located on your system, simply type whereis python in a shell and the system will tell you where it is located.


Installing on Windows

Windows doesn't come standard with a Python interpreter. You can simply download it from www.python.org/download/. There you can download version 2.4 or higher for your Windows version, which is usually the first link you can click on the download page.
After downloading the file you can start it. Simply accept all default settings the installer proposes. As a result you will end up with a new directory in your C: drive, called Python24 (or higher). Please make a note of the version number of your Python directory, because you'll need that in a minute.

Now it's time to download the SB-Assembler package, if you haven't done so already. After that you can unpack it all into a temporary directory of your choice.
Then you can move the files sbasm and sbasm.bat and the entire directory sbaspack into a newly created directory placed wherever you prefer (e.g. C:\sbasm3). The remaining directories can be copied into your projects directory, wherever that may be.

You may have to change the contents of the file sbasm.bat, which you have moved to the directory of your choice. The default content is shown below:

C:\Python26\python c:\sbasm3\sbasm %1 %2 %3

Here you may have to change the path to your python directory and the path to the program sbasm. If your python interpreter is indeed located at C:\Python26, and your copy of the SB-Assembler is located in C:\sbasm3, then you don't have to change anything.

Finally you should include the path to sbasm.bat into your path. An example of how to add a directory to the path is shown below.

Installing SB-Assembler Version 2

The SB-Assembler doesn't really require an installation process. All you need to do is copy some files into the right locations. But I can give you some tips to make life as comfortable as possible while working with the SB-Assembler.

  • Create a directory with the name SBASM somewhere on any of your hard disks.
  • Unpack all files from the download package into this directory. The most important files are the program SBASM.COM and all *.SBA Cross-Overlay files.
    It is important that all *.SBA files remain in the same directory as the SBASM.COM program. Otherwise the program could fail to locate them.
  • The directory OPCODE.TST contains files that were used to test all possible opcodes known to the different cross overlays. They are not really necessary but can be used as a reference because all specific SB-Assembler features are highlighted in these files.
  • Edit the PATH parameter in your AUTOEXEC.BAT file and add the path ;.. at the end of it. This will allow MS-DOS to find the SBASM.COM program in the directory directly above your current directory, one step back towards the root directory.
    You'll have to restart the computer to activate this new path. If you don't want to restart the computer now you can start the assembler by typing ..\SBASM filename.
  • Create a separate directory for each one of your projects inside the SBASM directory.
    Make one of the project directories your current directory.
    Edit your source files as needed. Then start the SB-Assembler by typing the command SBASM filename at the MS-DOS prompt. Because of the path ;.. you've added in your AUTOEXEC.BAT the program SBASM.COM will be found in the parent directory of your current directory.

    This way you don't have to worry about paths during your assembly work. All your project files are grouped together per project and the SBASM directory won't grow full of garbage leftovers from old projects.

Don't worry about your projects when updating the assembler after a previous installation. Only the original files from the download package will be overwritten by a new version or the same version. Your own work will be unaffected.

Please note that I am not suggesting that you don't have to make backup copies of your work!

Changing The Path On Windows XP

Here's the procedure to add the ;..\ path to machines running Windows XP:

Right-click on "My Computer" and select "Properties" to open the System Properties window.
Select the "Advanced" tab and click on the "Environment Variables" button.

System Properties

This will open the next screen.
Now select (highlight) the PATH variable in the bottom list and press the "Edit" button.

Environment Variables

Now you can add the string ;..\ at the end of the Path.

Edit System Variable

 

Last Updated: 06 June 2012
© 2002, San Bergmans, Oisterwijk, The Netherlands
http://www.sbprojects.com