├── .gitignore ├── Makefile ├── README.md ├── a56.h ├── a56.key ├── a56.y ├── appveyor.yml ├── examples ├── Makefile ├── README ├── caltone.a56 ├── caltone.inc ├── chorus.a56 ├── defs.inc ├── disp.a56 ├── flange.a56 ├── intequ.inc ├── ioequ.inc ├── memtest.a56 ├── pink.a56 ├── reverb.a56 ├── sixcomb.a56 ├── sloader.a56 ├── tdsg.a56 ├── test-dac.a56 ├── test-int.a56 └── thru.a56 ├── frac2int.c ├── getopt.c ├── keybld.c ├── lex.c ├── main.c ├── subs.c ├── tok.awk ├── toomf.c └── torom.c /.gitignore: -------------------------------------------------------------------------------- 1 | # Compilation results 2 | *.o 3 | /keybld 4 | /toomf 5 | /a56 6 | 7 | # Auto-generated files 8 | /toktab.c 9 | /gram.c 10 | /gram.h 11 | /kparse.c 12 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ####################################################### 2 | # 3 | # a56 - a DSP56001 assembler 4 | # 5 | # Written by Quinn C. Jensen 6 | # July 1990 7 | # 8 | ####################################################### 9 | 10 | # environment definitions 11 | # uncomment the ones you like 12 | 13 | # generic unix 14 | CC = cc 15 | HOSTCC = cc 16 | YACC = yacc 17 | CCDEFS = -DLDEBUG 18 | MV = mv 19 | YTABC = y.tab.c 20 | YTABH = y.tab.h 21 | POSTPROCESS = echo 22 | 23 | # gcc & bison 24 | #CC = gcc 25 | #HOSTCC = gcc 26 | #YACC = bison -y 27 | #CCDEFS = 28 | #MV = mv 29 | #YTABC = y.tab.c 30 | #YTABH = y.tab.h 31 | #POSTPROCESS = echo 32 | 33 | # Delorie's DOS gcc (from ftp://omnigate.clarkson.edu/pub/msdos/djgpp) 34 | #CC = gcc 35 | #HOSTCC = gcc 36 | #YACC = bison -y 37 | #CCDEFS = 38 | #MV = ren 39 | #YTABC = y_tab.c 40 | #YTABH = y_tab.h 41 | #POSTPROCESS = coff2exe 42 | 43 | # gcc cross-compile to go32 environment 44 | #CC = i386-go32-gcc 45 | #HOSTCC = cc 46 | #YACC = yacc 47 | #CCDEFS = 48 | #MV = mv 49 | #YTABC = y.tab.c 50 | #YTABH = y.tab.h 51 | #POSTPROCESS = echo 52 | 53 | ####################################################### 54 | 55 | # -O or -g 56 | #DEBUG = -O -Olimit 3000 57 | DEBUG = -O 58 | 59 | SRCS = main.c a56.y lex.c subs.c getopt.c kparse.key 60 | OBJS = main.o gram.o lex.o toktab.o subs.o getopt.o kparse.o 61 | 62 | DEFINES = $(CCDEFS) 63 | #DEFINES = -DYYDEBUG -DLDEBUG $(CCDEFS) 64 | 65 | CFLAGS = $(DEBUG) $(DEFINES) 66 | 67 | all: keybld a56 toomf 68 | 69 | a56: $(OBJS) 70 | $(CC) $(CFLAGS) -o a56 $(OBJS) -lm 71 | @$(POSTPROCESS) a56 72 | 73 | keybld: keybld.o ksubs.o 74 | $(HOSTCC) $(CFLAGS) -o keybld keybld.o ksubs.o 75 | @$(POSTPROCESS) keybld 76 | 77 | keybld.o: keybld.c 78 | $(HOSTCC) $(CFLAGS) -c keybld.c 79 | 80 | ksubs.o: subs.c 81 | $(HOSTCC) $(CFLAGS) -c subs.c 82 | $(MV) subs.o ksubs.o 83 | 84 | lex.o: lex.c gram.h 85 | 86 | kparse.c: a56.key keybld 87 | $(abspath keybld) < a56.key > kparse.c 88 | 89 | gram.c gram.h: a56.y 90 | @echo "[expect 2 shift/reduce conflicts here]" 91 | $(YACC) -d a56.y 92 | $(MV) $(YTABC) gram.c 93 | $(MV) $(YTABH) gram.h 94 | 95 | toktab.c: gram.h 96 | awk -f tok.awk < gram.h > toktab.c 97 | 98 | y.output: a56.y 99 | $(YACC) -v a56.y 100 | 101 | toomf: toomf.o 102 | $(CC) -o toomf $(CFLAGS) toomf.o 103 | @$(POSTPROCESS) toomf 104 | 105 | torom: torom.o subs.o 106 | $(CC) -o torom $(CFLAGS) torom.o subs.o 107 | 108 | tape: toktab.c 109 | csh -c 'tar cvbf 1 - `cat files` | gzip > a56.tar.gz' 110 | 111 | main.o gram.o lex.o: a56.h 112 | 113 | clean: ; rm -f a56 toomf y.output *.o *.out tmp *.bak a56.tar.gz keybld 114 | 115 | spotless: clean 116 | rm -f gram.c lexyy.c gram.h toktab.c kparse.c 117 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | *Based on "a56 - a DSP56001 assembler - version 1.3"* 3 | 4 | ```C 5 | /* 6 | * Copyright (C) 1990-1998 Quinn C. Jensen 7 | * 8 | * Permission to use, copy, modify, distribute, and sell this software 9 | * and its documentation for any purpose is hereby granted without fee, 10 | * provided that the above copyright notice appear in all copies and 11 | * that both that copyright notice and this permission notice appear 12 | * in supporting documentation. The author makes no representations 13 | * about the suitability of this software for any purpose. It is 14 | * provided "as is" without express or implied warranty. 15 | * 16 | */ 17 | ``` 18 | 19 | # Overview 20 | 21 | This program was written as a vehicle to learn the intricacies 22 | of the DSP56001 instruction set, and to provide a tool for Unix-based 23 | DSP code development (for those of us without a NeXT machine.) 24 | 25 | The assembler probably generates bogus code here and there, and no doubt 26 | does not handle all of the syntax. We welcome all comments, fixes and 27 | enhancements. 28 | 29 | 30 | # Building 31 | 32 | Type `make`. 33 | 34 | The resulting program, a56, is used as follows: 35 | 36 | ``` 37 | a56 [-b] [-l] [-o output-file] file [...] 38 | ``` 39 | 40 | An assembler listing is sent to the standard-output and an ascii-formatted 41 | object file (a56.out) is produced. The `-b` option adds binary to the listing. 42 | `-l` causes included files to be listed. `-o` directs the output to the 43 | specified file rather than the default, a56.out. 44 | 45 | A separate program, toomf, converts a56.out into "OMF" format suitable for 46 | downloading to the 56001 via the sloader.a56 program. 47 | 48 | ``` 49 | toomf < a56.out > file.omf 50 | ``` 51 | 52 | 53 | # Syntax 54 | 55 | The intent was to provide compatibility with Motorola assembler's syntax. 56 | But since the author did not have Motorola's assembler or its documentation, 57 | it is no doubt far from compatible. Only a few pseudo-ops are implemented-- 58 | probably only partially. 59 | 60 | Macros are not supported, except through the use of an external macro 61 | preprocessor, such as /lib/cpp. To facilitate cpp macro expansion, multiple 62 | assembler statements on a single input line are delimited with an `@`, e.g.: 63 | 64 | ```C 65 | #define JCHEQ(c,label) move #c,x0 @cmp x0,a @jeq label 66 | 67 | #define JCHNE(c,label) move #c,x0 @cmp x0,a @jne label 68 | ``` 69 | 70 | 71 | ## Supported pseudo-ops 72 | 73 | The following is a list of the pseudo-ops that are recognized: 74 | 75 | ```Assembly 76 | = ;assign a symbol 77 |