Giter VIP home page Giter VIP logo

a56's Introduction

Based on "a56 - a DSP56001 assembler - version 1.3"

/*
 * Copyright (C) 1990-1998 Quinn C. Jensen
 *
 * Permission to use, copy, modify, distribute, and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  The author makes no representations
 * about the suitability of this software for any purpose.  It is
 * provided "as is" without express or implied warranty.
 *
 */

Overview

This program was written as a vehicle to learn the intricacies of the DSP56001 instruction set, and to provide a tool for Unix-based DSP code development (for those of us without a NeXT machine.)

The assembler probably generates bogus code here and there, and no doubt does not handle all of the syntax. We welcome all comments, fixes and enhancements.

Building

Type make.

The resulting program, a56, is used as follows:

a56 [-b] [-l] [-o output-file] file [...]

An assembler listing is sent to the standard-output and an ascii-formatted object file (a56.out) is produced. The -b option adds binary to the listing. -l causes included files to be listed. -o directs the output to the specified file rather than the default, a56.out.

A separate program, toomf, converts a56.out into "OMF" format suitable for downloading to the 56001 via the sloader.a56 program.

toomf < a56.out > file.omf

Syntax

The intent was to provide compatibility with Motorola assembler's syntax. But since the author did not have Motorola's assembler or its documentation, it is no doubt far from compatible. Only a few pseudo-ops are implemented-- probably only partially.

Macros are not supported, except through the use of an external macro preprocessor, such as /lib/cpp. To facilitate cpp macro expansion, multiple assembler statements on a single input line are delimited with an @, e.g.:

#define JCHEQ(c,label)	move #c,x0 @cmp x0,a @jeq label

#define JCHNE(c,label)	move #c,x0 @cmp x0,a @jne label

Supported pseudo-ops

The following is a list of the pseudo-ops that are recognized:

<symbol> = <expression>                         ;assign a symbol
<label> EQU <expression>                        ;ditto

ALIGN <number>                                  ;set location pointer
                                                ;to next integral
                                                ;multiple of <number>

ORG <space:> <expression>                       ;new location pointer
ORG <space:> <expression>, <space:> <expression>

DC <dc_list>                                    ;declare constants

DS <number>                                     ;reserve <number>
                                                ;words of space

<label> DSM <number>                            ;reserve space for
                                                ;properly aligned
                                                ;modulo-addressed
                                                ;buffer of size
                                                ;<number>, assigning
                                                ;the aligned starting
                                                ;address to <label>

PAGE <number>, <number>, <number>, <number>     ;ignored

INCLUDE <file>                                  ;file inclusion

END                                             ;end

In addition, a PSECT pseudo-op was implemented. It allows program sections to be defined and bopped in and out of, each with its own location counter and space. The Motorola assembler probably does not have this pseudo-op, but no doubt supports the concept in some way.

PSECT <name> <space:><begin_addr>:<end_addr>    ;define

PSECT <name>                                    ;switch to psect <name>

Examples

Example assembly can be found in the "examples" folder.

a56's People

Contributors

gxtx avatar jayfoxrox avatar libbers avatar strikerx3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

a56's Issues

Fix broken examples

We had reports, that most example code does not work (crashes a56 if I remember correctly). It is not known what causes this.

[examples]$ make
cpp -Uicon caltone.a56 > tmp.a56
../a56 -o caltone.out tmp.a56 > caltone.lis
/bin/sh: line 1: 13393 Segmentation fault      (core dumped) ../a56 -o caltone.out tmp.a56 > caltone.lis
make: *** [Makefile:21: caltone.omf] Error 139

a56 should always provide meaningful output instead of just crashing.

We should identify those cases, fix the examples and fix a56.
Because this could be a lengthy task, it would already be good if someone reviewed all examples and created an issue for each broken one, unless a common issue can be identified (which can be discussed here).

Improve CI artifacts

Some minor issues with #12:

  • keybld should not be included
  • torom should be included
  • Should include the examples

test

This is a test issue for webhooks. Please ignore.

Improve release distribution

a56 does have CI artifacts since #12, but they are not stored permanently.

We should set-up GitHub releases, because updates for a56 will likely be months apart, so artifacts might not survive.

Move to C11

The current code is very K&R C heavy and hard to read with a modern mindset.

I'm not sure if clang-format or something could do this job for us.

Get rid of `gets`

My linker keeps warning me about this:

toomf.c:(.text+0x9e): warning: the `gets' function is dangerous and should not be used.

It's easy enough to replace with fgets(buf, sizeof(buf), stdin)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.