Software by Andrew Turnquist

Software Home asm1825 Me Photography

asm1825

Latest version: 0.8.3

What Is asm1825?

asm1825 is a lightweight standalone assembler for PIC microcontrollers, specifically the PIC16(L)F1825 and similar variants. It is a two pass command line based assembler with support for macros, file inclusion, and arithmatic evaluation of operands. It follows the opcode definitions in the '1825 datasheet and makes no explicit attempt at full compatibility with other specific assemblers (such as mpasm), but tries not to be intentionally incompatible without good reason. Speed of assembly is one of its primary goals.

asm1825 is freely distributable under the MIT license.

Part of the motivation for creating asm1825 was the lack of speed in developing code for PIC microcontrollers on older hardware using the MPLAB X development environment (it takes several minutes just to open MPLAB X on my system). Code assembly with asm1825 on a 1GHz AMD Athlon 64 running Fedora Core 18 is roughly 22,000 instructions/second total CPU time. With only 8,192 words of program memory on the '1825, most programs will assemble in under 1 second even with other processes running.

Several chips are supported, including the PIC12F1840, PIC16F1825, PIC16F18325, PIC16F18345, PIC16F18346, and PIC12F683. It is hoped that, as development continues, support for more PIC12 and PIC16 series microcontrollers will be added.

Also included in the distribution is a simple disassembler, dasm1825, for easier verification of assembler output and, of course, disassembly of other existing code.

Development Status

asm1825 0.8.3 is currently an early beta, released November 29th, 2021. It is possible to write complete, functional and non-trivial programs with it (one of my recent projects is a multi-chip organ console MIDI conversion), even though there are still some features to be added before a 1.0 release. Feedback from others--including problem reports, bugfixes, and feature requests--are welcome and requested.

Version 0.8.3 added an include_once directive similar to what exists in PHP. It also fixed a potential NULL dereference case, added symbol size data to .sym file output and improved source documentation some.

Version 0.8.2 added an expression substitution and concatenation operator ({}) for substituting an expression to be re-evaluated as a whole (i.e., STACKPTR EQU FSR{STACKNUM}L, where STACKNUM would evaluate to either 0 or 1)

Version 0.8.1 finally fixes far calls to forward references. New features include support for some older chips with a smaller instruction set (warning are issued for invalid opcodes), a BANKANY program section (psect) class to allocate memory from any avaliable bank, and introduction of local, file, and globally scoped symbols allowing for symbol hiding and reuse.

Version 0.8.0 updates the expression evaluation code to use GNU flex for token parsing (flex is only needed if you need to rebuild the parser code). An array of new operators have been implemented allowing for more complex expressions to be evaluated. A SET directive has been added for changeable data (EQU defines constant data). See the included ChangeLog file for more details.

Version 0.7.3 fixed severe bugginess with local labels in macros. They are now properly serialized into unique labels for each invocation. A few other bugs were fixed and the listing output improved.

Version 0.7.2 added Smart BSR management, elminating the need for most manual BANKSEL directives. Default assembly mode has been changed to psect model.

Version 0.7.1 fixed some significant bugs related to far calls and gotos.

Version 0.7.0 fixed several bugs, improved memory usage summary in .psl file, added more standard fcall and lgoto pseudo-opcodes. Added a 'pragma {smallmem|largemem}' to control default assembler behavior when assembling gotos and calls to not-yet-defined labels. Also added a processor directive to configure memory parameters from a processor data file.

Version 0.6.1 expands psect support, adding DW and DS directives. Memory usage statistics are now generated, and messages are now output with current file name and line number. Several bugfixes.

Version 0.6.0 added support from program sections (psects). Until more thorough testing is completed, it is off by default. Enable it with the -p option and see the included manual for usage.

asm1825 has been developed under Linux (Devuan Ascii/amd64, previously under Fedora Core 18/amd64) and also tested on FreeBSD 11.0, but it should work on most any Unix flavor. It has also been built successfully against musl libc, both dynamically and statically. There are currently no library dependencies other than libc. It is possibly portable, with some hacking, to Windows (though this is only speculation).

Downloads

The current version of asm1825 is 0.8.3. The gzipped source tarball may be downloaded here.

Previous releases and bzip2 tarballs can be found here.

Contact/Bug Reports

If/when you find bugs, please report them to me, Andrew Turnquist at andrew@turnquist.name. Bug fixes, patches, and feature requests are also welcome, as are reports of systems the program works on. If you submit a bug fix or patch, I will credit your authorship here and in the package's AUTHORS file, unless you wish to remain anonymous.

Mailing List

If you would like to keep up with the latest updates and discussion about asm1825, you may subscribe to it's shiny new mailing list, asm1825-users.

To Do

URL: https://www.turnquist.name:443/software/asm1825/
Retrieved: Mar 19, 2024 2:02:24 am EDT
$Revision: 1.11 $
$Id: index.php,v 1.11 2021/09/20 01:24:20 andrew Exp andrew $

Site designed by and copyright © 2010–2017 Andrew Turnquist