Skip to content

Commit

Permalink
Merge pull request #1 from markdryan/markdryan/v2
Browse files Browse the repository at this point in the history
Version 2 of Specasm
  • Loading branch information
markdryan authored Mar 18, 2022
2 parents 0f8133d + 793e697 commit 7b317d7
Show file tree
Hide file tree
Showing 55 changed files with 1,223 additions and 781 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.o
*.zip
unittests
salink
saimport
saexport
SAIMPORT
Expand All @@ -14,3 +15,4 @@ SAEXPORT.X
build.sh
compile.sh
build/specasm
.DS_Store
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,14 @@ Download the latest release of Specasm, and unzip the contents of the file into

Now navigate to the INSTALL file, which is a BASIC program, and press **ENTER** to execute it. This will use ESXDOS's **.launcher** command to set up some command line short cuts for the tap files in the SPECASM directory.

You may noticed from the screenshot that there are some other files in the SPECASM folder, namely two dotx commands called saimport and saexport. These commands allow you to convert between Specasm's internal file format, .x files, and assembly language text files, .s files. I couldn't work out how to install these dotx commands cleanly in BASIC so this needs to be done manually.
## Reinstalling Specasm

```
.mkdir /bin/extra
.cp SAIMPORT /bin
.cp SAIMPORT.X /bin/extra/SAIMPORT.X
.cp SAEXPORT /bin
.cp SAEXPORT.X /bin/extra/SAEXPORT.X
```
To upgrade to a new version of Specasm perform the following steps.

Note this step is optional and only necessary if you need to convert between .x and .s files on the spectrum itself.
1. Manually remove the old /Specasm directory on your SD card, e.g., rm -rf /Specasm
2. Download the latest release and unzip its contents to /Specasm on the SD card
3. Execute the REMOVE BASIC program. This can be done from the ESXDOS file browser or by loading it from the BASIC prompt. This will remove the old version of Specasm stored under the /bin folder, and will also de-register the old **.launcher** shortcuts.
4. Run the INSTALL BASIC program. This will install the new version of Specasm.

## Assembling your First Program

Expand Down Expand Up @@ -69,7 +66,7 @@ Specasm is built with [z88dk](https://github.com/z88dk/z88dk) and GNU Make. Ins

```
cd build
make -j -f Makefile.spec
make -j
```

And then wait. All the tap and dotx files will be created in the build directory.
Expand Down
Binary file modified bas/INSTALL
Binary file not shown.
Binary file modified bas/REMOVE
Binary file not shown.
Binary file added bas/SPECLD.TAP
Binary file not shown.
36 changes: 18 additions & 18 deletions build/Make.include
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
error.o: ../../src/error.c ../../src/error.h
state_base.o: ../../src/state_base.c ../../src/peer.h ../../src/error.h ../../src/peer_zx.h \
../../src/line.h ../../src/state_base.h ../../src/strings.h
state.o: ../../src/state.c ../../src/state.h ../../src/state_base.h ../../src/line.h ../../src/error.h \
../../src/strings.h
line.o: ../../src/line.c ../../src/peer.h ../../src/error.h ../../src/peer_zx.h ../../src/line.h \
../../src/state.h ../../src/state_base.h ../../src/strings.h
editor.o: ../../src/editor.c ../../src/editor.h ../../src/peer.h ../../src/error.h \
../../src/peer_zx.h ../../src/line.h ../../src/state.h ../../src/state_base.h ../../src/strings.h
saimport.o: ../../src/saimport.c ../../src/peer.h ../../src/error.h ../../src/peer_zx.h \
../../src/line.h ../../src/peer_file.h ../../src/state.h ../../src/state_base.h ../../src/strings.h
saexport.o: ../../src/saexport.c ../../src/peer.h ../../src/error.h ../../src/peer_zx.h \
../../src/line.h ../../src/peer_file.h ../../src/state.h ../../src/state_base.h ../../src/strings.h
salink.o: ../../src/salink.c ../../src/peer.h ../../src/error.h ../../src/peer_zx.h ../../src/line.h \
../../src/peer_file.h ../../src/state_base.h ../../src/strings.h
peer_zx.o: ../../src/peer_zx.c ../../src/peer.h ../../src/state.h ../../src/state_base.h ../../src/line.h \
../../src/strings.h ../../src/error.h
peer_file_zx.o: ../../src/peer_file_zx.c ../../src/error.h ../../src/peer_file.h
error.o: ../src/error.c ../src/error.h
state_base.o: ../src/state_base.c ../src/peer.h ../src/error.h ../src/peer_zx.h \
../src/line.h ../src/state_base.h ../src/strings.h
state.o: ../src/state.c ../src/state.h ../src/state_base.h ../src/line.h ../src/error.h \
../src/strings.h
line.o: ../src/line.c ../src/peer.h ../src/error.h ../src/peer_zx.h ../src/line.h \
../src/state.h ../src/state_base.h ../src/strings.h
editor.o: ../src/editor.c ../src/editor.h ../src/peer.h ../src/error.h \
../src/peer_zx.h ../src/line.h ../src/state.h ../src/state_base.h ../src/strings.h
saimport.o: ../src/saimport.c ../src/peer.h ../src/error.h ../src/peer_zx.h \
../src/line.h ../src/peer_file.h ../src/state.h ../src/state_base.h ../src/strings.h
saexport.o: ../src/saexport.c ../src/peer.h ../src/error.h ../src/peer_zx.h \
../src/line.h ../src/peer_file.h ../src/state.h ../src/state_base.h ../src/strings.h
salink.o: ../src/salink.c ../src/peer.h ../src/error.h ../src/peer_zx.h ../src/line.h \
../src/peer_file.h ../src/state_base.h ../src/strings.h
peer_zx.o: ../src/peer_zx.c ../src/peer.h ../src/state.h ../src/state_base.h ../src/line.h \
../src/strings.h ../src/error.h
peer_file_zx.o: ../src/peer_file_zx.c ../src/error.h ../src/peer_file.h

%.o: %.c
zcc $(CFLAGS) -o $@ -c $<
77 changes: 61 additions & 16 deletions build/Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,68 @@
VPATH=../src

.PHONY: all
all: tap dot
all: specasm.tap salink.tap SAEXPORT SAIMPORT

CC=zcc
CFLAGS=+zx -SO2 --opt-code-size --max-allocs-per-node200000 -Cs "--disable-warning 85" -clib=sdcc_iy

include Make.include

SPECASM = \
specasm.o \
line.o \
error.o \
state_base.o \
state.o \
editor.o \
peer_zx.o

SALINK = \
salink.o \
error.o \
state_base.o \
peer_file_zx.o \
peer_zx.o

SAEXPORT = \
error.o \
state_base.o \
line.o \
state.o \
peer_file_zx.o \
peer_zx.o \
saexport.o

SAIMPORT = \
error.o \
state_base.o \
line.o \
state.o \
peer_file_zx.o \
peer_zx.o \
saimport.o

specasm.tap: $(SPECASM)
$(CC) $(CFLAGS) -zorg=24550 -startup=31 -o specasm $^ -create-app -Cz--merge=../bas/SPECLD.TAP

salink.tap: $(SALINK)
$(CC) $(CFLAGS) -zorg=24000 -startup=31 -o salink $^ -create-app

.PHONY: tap
tap:
$(MAKE) -C tap
SAEXPORT: $(SAEXPORT)
$(CC) $(CFLAGS) -startup=30 -o $@ $(SAEXPORT) -subtype=dotx -Cz"--clean" -create-app

.PHONY: dot
dot:
$(MAKE) -C dot
SAIMPORT: $(SAIMPORT)
$(CC) $(CFLAGS) -startup=30 -o $@ $(SAIMPORT) -subtype=dotx -Cz"--clean" -create-app

clean:
rm -rf specasm specasm.zip
- $(MAKE) -C tap clean
- $(MAKE) -C dot clean
- rm -rf specasm *.zip
- rm *.X *.o *.bin *.tap SAIMPORT SAEXPORT

.PHONY: release
release:
- rm -rf specasm
mkdir specasm
cp tap/*.tap specasm
cp dot/SAIMPORT dot/SAEXPORT dot/*.X specasm
cp ../bas/* specasm
zip -r specasm.zip specasm
- rm -rf release
mkdir -p release/specasm
cp *.tap release/specasm
cp SAIMPORT SAEXPORT *.X release/specasm
cp ../bas/* release/specasm
cd release && zip -r specasm.zip specasm
39 changes: 0 additions & 39 deletions build/dot/Makefile

This file was deleted.

35 changes: 0 additions & 35 deletions build/tap/Makefile

This file was deleted.

Binary file modified docs/install.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/salink.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7b317d7

Please sign in to comment.