6502/Microlab Assembler

There are two ways to get the assembler, either as a precompiled binary for Linux 2.x (libc 5) or as C source. As soon as I find out what an 'EMT trap' is it will be possible to compile the assembler on an Amiga using the port of gcc as found in Geekgadgets.

Brian Devey has kindly compiled this for DOS. This version can be found here: asm65.zip

A cross assembler designed for the EPE Microlab.
Written by David Jordan (dave@lassie.demon.co.uk)

This program is still in beta, if you find any bugs just let me know. It's
worked with everything I've tested it with but I'm sure I've missed something.

Do you really need documentation? Just point it to a source file...

   -a <address> changes the defualt output address. If your souce file
                doesn't include an ORG statement then the assembler will use
                this address.
   -d           Displays a four column hex dump of the code. This is only
                really useful when you want to type the program in by hand
		as the four column layout mimics the Microlab's display.
   -o <file>    Outputs raw data into 'file', useful for the transmit program.
   -v           Prints formatted source code:
                     $0221: SETIN:
                     $0221: $A9 $02        LDA #$02
                     $0223: $8D $43 $80    STA $8043       == (DDRA)
                     $0226: $A9 $00        LDA #$00
                     $0228: $8D $42 $80    STA $8042       == (DDRB)
                     $022B: $A2 $00        LDX #$00
                     $022D: $A0 $00        LDY #$00
                     $022F: $60            RTS 

   -V           Prints too much information, I only put it in for debugging
                the assembler. Somebody may find it useful though...

Stuff it can do:

#  Multiple bases: $=Hexadecimal, %=Binary, Nothing is needed for decimal

#  #DEFINE's

#  Comments start with ';'

#  Labels end with ':'. You can have a label followed by a mnemonic on the
   same line

#  You can branch to either a label or you can specify the offset yourself
   so long as you precede the offset with a hash

#  You can select upper and lower bytes of a label by using '<' and '>'

   LABEL = $4952,  <LABEL = $52,  >LABEL = $49

#  Calculated operands. Eg LDA LED+1. These are calculated strangely:

   23+45-67+56-2 is calculated as 23+(45-(67+(56-2)))

#  DFB, DFW, DFL. Anything longer than a byte is stored in a little-endian
   order. You can use labels or defines and they will be translated to their
   value. If the value is too large the upper bytes will be truncated. Data
   can be entered as a sequence of comma separated numbers, letters
   enclosed in single quotes or strings enclosed in double quotes. 
   ORG $200
   DFB 12,56,$67,%111011,FOO,'c','A',"Hello!"
   produces the following assembler output (in verbose mode):

        Define: FOO $45
        Change Address:      $0200

        Opcode (1 bytes):    $0200: $EA            NOP 
        Item: '12'
        Item: '56'
        Item: '$67'
        Item: '%111011'
        Item: 'FOO'
        Item: ''c''
        Item: ''A''
        Item: '"Hello!"'

        Occupies: $0200 -> $020E

        $0200:   EA  0C  38  67
        $0204:   3B  45  63  41
        $0208:   48  65  6C  6C
        $020C:   6F  21  FF  FF

   DFM is also supported for backwards compatability.

#  Changing addresses. Eg DATASEG $700, ORG $200 and @=$2FF

Stuff it can't do yet but might someday:

#  I'm working on a way to do #INCLUDE's of source code and #INCLUDEBIN's of
   binary data.

#  Anything else anybody can think of! Send any suggestions to

If you need any more information about anything on this page or have any suggestions just EMail me at dave@lassie.demon.co.uk