Skip to content

tmikov/a51

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

a51

  • a51 is a portable assembler for 8051, written in C.

  • link51 is the companion linker capable of producing .bin and .hex files.

  • objdump5 decodes an object file into human-readable form.

Building

a51 builds under Linux and Windows using CMake. It can also be built for DOS with Borland C 3.1 and Borland Make.

The build produces several executables:

  • a51 is the assembler.

  • link51 is the linker

  • mlink is a minilinker used to test the assembler - it produces a usable binary from a single object file.

  • objdump5 is self explanatory

Linux and Windows

You will need CMake 2.6 or later. Bison is optionally required for generating the parser, but a pre-generated parser is included in the source.

To build, enter the project directory and execute the following commands:

mkdir build
cd build
cmake -DGENERATE_SRC=0 ..
make

To re-generate the Bison parser (and other internal tables), change the cmake command line above to -DGENERATE_SRC=1.

On Windows, omit the last make. CMake on Windows generates a Visual Studio project file, which can be open it with Visual Studio and built normally normally from there. CMake can also generate an NMake makefile and other formats (see the CMake documentation).

DOS

The source includes makefiles for Borland C 3.1 for DOS. They will likely also work with different Borland C versions, but as of this writing have only been tested with that version (inside DOSBOX).

To build, enter the project directory. Examine and possibly change lib/common/makefile.bc - it contains a reference to the installation directory of Borland C, which may be different. Then execute the following commands:

cd lib/common
make -f makefile.bc
cd ..
cd mlink
make -f makefile.bc
cd ..
cd a51
make -f makefile.bc
cd ..
cd link51
make -f makefile.bc

The option to re-generate the parser and other tables has been disabled in the DOS build because of practical inability to test it. It requires installing DJGPP and Bison for DOS, which goes beyond this author’s pain threshold.

objdump51 can easily be compiled for DOS, but at this time there is no makefile.

Assembling The Examples

The directory examples/ contains simple examples to demonstrate the usage of the assembler and linker. There is a GNU Makefile to assemble and link them. It needs the variable BUILD to point to the project build directory.

From the project root:

export BUILD=$PWD/build
cd examples
make

On non-Unix OSes the examples can be assembled manually by directly invocing a51 and link51.

License

  • link51 is licensed under BSD 3-clause license. See LICENSE-BSD

  • Everything else is licensed under GPL v2. See LICENSE-GPLv2

Copyright (c) 1997-2014 Tzvetan Mikov <tmikov@gmail.com>

Copyright (c) 1997 Petar Marinov <efravia@gmail.com>

About

8051 Assembller

Resources

License

Unknown, GPL-2.0 licenses found

Licenses found

Unknown
LICENSE-BSD
GPL-2.0
LICENSE-GPLv2

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published