About

bkasm is a powerful, extensible, retargetable cross-assembler. It is intended for use with small embedded processors, particularly digital signal processors. It currently supports the AL3101 "1K" DSP from Wavefront Semiconductor (nee Alesis Semiconductor), and additional targets may be accommodated easily.

bkasm is beta software, but is feature-complete. The manual is about 60% complete, and is under development.

 
______
 
Download

You may visit bkasm's SourceForge project page, or download directly from here:

Full package: bkasm.zip (1095 Kb), v0.904, Tue Jul 8 23:15

User's Guide: bkasm.pdf (549 Kb), v0.104, Tue Jul 8 22:51

Readme: readme.txt (5 Kb), v0.904, Tue Jul 8 23:11

Changelog: changelog.txt (1 Kb), v0.904, Sun Jul 6 23:13

 
______
 
Features

bkasm provides everything you would expect from a professional-quality assembler, plus:

  • Algebraic expressions.
     a = (b + 2)*(b - 2)
  • Advanced math functions and complex numbers.
     a = 1/sqrt(2) + sin(pi*7/4) + e^(pi*i)
  • C-style flow control.
     if ((a > 0) && (b < 2)) {
       a = [foo]
     }
    
  • Optimizations and smart combination of parallel operations.
     b = [foo]   ; piggybacks below
     a += 2      ; generates:  l1ac  2  foo
    
  • Assembly-style macros with either traditional or pattern-matching syntax.
     mymacro .macro "Multiply by $multiplier and add $addend."
       a = $multiplier*a + $addend
       .endm
    
     Multiply by 2 and add 7.   ; expands to:  a = 2*a + 7
    
  • C-style text-substitution macros.
     #define AVERAGE(x,y) ((x+y)/2)
  • Locally-scoped symbols and variables.
     { myvar  .ls         ; allocate temp variable
       [myvar] = a        ; use variable
       a = [myvar]^2 + 7
     }                    ; deallocate variable
    
  • Directives for iterative and conditional assembly.
     .for FOO = 0 .. 15
       .if BAR < BAZ - 2
         .repeat 4
           a += [FOO+BAR]
         .endloop
       .endif
     .endloop
    
  • Numeric precision tracking and enforcement.
     FOO .equ  p(24,    1/3)  ; FOO = 1/3, but must be given
                              ; at least 24 fractional bits
     BAR .equ ep(0.001, 1/3)  ; BAR = 1/3, but must have less 
                              ; than 0.001 relative error
    
  • Pervasive support for embedded Perl, for complicated expressions, custom functions, and dynamic code generation.
  • Hierarchical sections, with extensive linking options and overlay support.
  • Several output formats, including ones that generate C or assembly code to be directly compiled in with the host software.
  • Precise, descriptive error messages and warnings.
  • Backwards-compatiblity with 1kasm.
  • Extensiblity through conventional Perl modules.
  • A free, open-source license.
  • An overwheming amount of documentation.
  • Much more.
 
______
 
Sample Code

More coming soon, hopefully...

  • dtmf.asm: A DTMF (touch-tone) decoder for the 1K.
  • dtmf.lst: Listing file after assembling the above source.
 
______
 
Author

Bret Victor
email: bret, at, ugcs.caltech.edu
website: http://www.ugcs.caltech.edu/~bret


SourceForge