Showing with 1,183 additions and 158 deletions.
  1. +0 −13 .github/workflows/ccpp.yml
  2. +24 −0 .github/workflows/main.yml
  3. +19 −1 ChangeLog
  4. +4 −4 Makefile
  5. +5 −6 README
  6. +2 −1 doc/dasm.txt
  7. +4 −4 machines/atari2600/macro.h
  8. +141 −0 machines/atari7800/7800.h
  9. +68 −0 machines/atari7800/macro.h
  10. BIN snapshot-builds/dasm-20200219162658-linux-x64.tar.gz
  11. BIN snapshot-builds/dasm-20200219162658-linux-x86.tar.gz
  12. BIN snapshot-builds/dasm-20200219162658-osx-x64.tar.gz
  13. BIN snapshot-builds/dasm-20200219162658-osx-x86.tar.gz
  14. BIN snapshot-builds/dasm-20200219162658-win-x64.tar.gz
  15. BIN snapshot-builds/dasm-20200219162658-win-x86.tar.gz
  16. +19 −13 src/asm.h
  17. +6 −0 src/exp.c
  18. +1 −0 src/globals.c
  19. +178 −101 src/main.c
  20. +16 −1 src/ops.c
  21. +2 −2 src/version.h
  22. +4 −2 test/Makefile
  23. +54 −0 test/addressexpression.asm
  24. BIN test/addressexpression.bin.ref
  25. +2 −0 test/addressexpression.hex.ref
  26. +8 −0 test/atari7800/Makefile
  27. +8 −0 test/atari7800/README
  28. +440 −0 test/atari7800/spritesample.asm
  29. BIN test/atari7800/spritesample.bin.ref
  30. +8 −0 test/badopcode1.asm
  31. 0 test/badopcode1.fail
  32. +7 −0 test/badopcode2.asm
  33. 0 test/badopcode2.fail
  34. +4 −4 test/broken6303hack.hex.ref
  35. +15 −0 test/doublemacro.asm
  36. BIN test/doublemacro.bin.ref
  37. 0 test/doublemacro.fail
  38. +2 −0 test/doublemacro.hex.ref
  39. +48 −0 test/labelchanges.asm
  40. BIN test/labelchanges.bin.ref
  41. +43 −0 test/labelchanges.hex.ref
  42. +31 −6 test/run_tests.sh
  43. +8 −0 test/toobigbyte.asm
  44. BIN test/toobigbyte.bin.ref
  45. 0 test/toobigbyte.fail
  46. +2 −0 test/toobigbyte.hex.ref
  47. +8 −0 test/toobigword.asm
  48. BIN test/toobigword.bin.ref
  49. 0 test/toobigword.fail
  50. +2 −0 test/toobigword.hex.ref
13 changes: 0 additions & 13 deletions .github/workflows/ccpp.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,24 @@
name: Build, Test and Package Snapshots
on:
push:
paths-ignore:
- 'snapshot-builds/**'
jobs:
build_test_package_job:
runs-on: ubuntu-latest
name: Job
steps:
- uses: actions/checkout@v1
- name: Build and Test
run: make test
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Package Snapshots
id: snapshotbuild
uses: dasm-assembler/dasm-snapshot-builder@v1
with:
branch: ${{ steps.extract_branch.outputs.branch }}
username: ${{ secrets.GITHUB_USERNAME }}
password: ${{ secrets.GITHUB_PASSWORD }}
20 changes: 19 additions & 1 deletion ChangeLog
Expand Up @@ -4,12 +4,30 @@ closely related files (Makefile, test cases) only, this
is *not* a complete record of every single change ever
made. Check the GitHub commit history for that. :-)

DASM version 2.20.13:

* longstring segfault fix
* fix for non-symbol-compliant unquoted filenames
* address expression fix
* makefile portability fixes
* added atari 7800 support
* allow labels to shift between multiple passes
* fix for silenced single pass non-abort errors
* adjust .byte and .word negative range check
* duplicate macro fix
* reduce gcc Wall option build warnings
* added 'strict' syntax check mode (+ added to docs)
* enable .word size check for strict-mode only
* dynamic buffers for pass-output update

DASM version 2.20.12:

* Fix for handling linux linefeeds under Windows
(fix by msaarna)

* Support using constants for include files
* Fix for segfault on long lines

* Supports using constants for include files
(enhancement by SpiceWare)

* 64-bit versions of DASM are now part of the release for
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Expand Up @@ -38,13 +38,13 @@ install: build
# just run all the tests
test: build
echo "Running tests..."
(cd test; make; cd ..)
(cd test; $(MAKE); cd ..)
echo "Tests were run, but testing is not fully automated yet."
echo "In other words, don't rely on what you saw too much."

# just build everything and copy binaries to trunk/bin/
build:
(cd src; make; cd ..)
(cd src; $(MAKE); cd ..)
mkdir -p bin
cp src/dasm bin/dasm
cp src/ftohex bin/ftohex
Expand Down Expand Up @@ -114,6 +114,6 @@ beta:
# regular build from this Makefile; don't delete the
# "real" distribution archives
clean:
(cd src; make clean; cd ..)
(cd test; make clean; cd ..)
(cd src; $(MAKE) clean; cd ..)
(cd test; $(MAKE) clean; cd ..)
-rm -rf dasm-beta-*.tar.gz bin/
11 changes: 5 additions & 6 deletions README
@@ -1,6 +1,6 @@
===================
DASM 2.20.12 readme
===================
============================
DASM 2.20.13 readme
============================

Welcome to DASM, a versatile macro assembler with support for several
8-bit microprocessors including MOS 6502 & 6507; Motorola 6803, 68705,
Expand All @@ -9,8 +9,7 @@ DASM 2.20.12 readme
This file describes the DASM distribution, how to compile and install
DASM, and where to get more information about DASM.

DASM's homepage is https://dasm-assembler.github.io/ since release
2.20.12.
DASM's homepage is https://dasm-assembler.github.io/

----------------
The Distribution
Expand Down Expand Up @@ -118,7 +117,7 @@ Legalese
Copyright (c) 1995 by Olaf "Rhialto" Seibert.
Copyright (c) 2003-2008 by Andrew Davie.
Copyright (c) 2008-2015 by Peter H. Froehlich.
Copyright (c) 2019 by the DASM team.
Copyright (c) 2019-2020 by the DASM team.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
3 changes: 2 additions & 1 deletion doc/dasm.txt
Expand Up @@ -25,7 +25,7 @@ LEGALESE
Copyright (c) 1995 by Olaf "Rhialto" Seibert.
Copyright (c) 2003-2008 by Andrew Davie.
Copyright (c) 2008 by Peter H. Froehlich.
Copyright (c) 2019 by the DASM team.
Copyright (c) 2019-2020 by the DASM team.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -119,6 +119,7 @@ COMMAND LINE:
-T# symbol table sorting (default 0 = alphabetical,
1 = address/value)
-E# error format (default 0 = MS, 1 = Dillon, 2 = GNU)
-S strict syntax checking

Example: dasm master.asm -f2 -oout -llist -v3 -DVER=4

Expand Down
8 changes: 4 additions & 4 deletions machines/atari2600/macro.h
@@ -1,7 +1,7 @@
; MACRO.H
; Version 1.06, 3/SEPTEMBER/2004
; Version 1.07, 19/January/2020

VERSION_MACRO = 106
VERSION_MACRO = 107

;
; THIS FILE IS EXPLICITLY SUPPORTED AS A DASM-PREFERRED COMPANION FILE
Expand All @@ -17,8 +17,8 @@ VERSION_MACRO = 106
; (atari2600@taswegian.com) with your contribution.
;
; Latest Revisions...
;
; 1.06 03/SEP/2004 - nice revision of VERTICAL_BLANK (Edwin Blink)
; 1.07 19/JAN/2020 - correction to comment VERTICAL_SYNC
; 1.06 03/SEP/2004 - nice revision of VERTICAL_SYNC (Edwin Blink)
; 1.05 14/NOV/2003 - Added VERSION_MACRO equate (which will reflect 100x version #)
; This will allow conditional code to verify MACRO.H being
; used for code assembly.
Expand Down
141 changes: 141 additions & 0 deletions machines/atari7800/7800.h
@@ -0,0 +1,141 @@
; 7800.h
; Version 1.0, 2019/12/13

; This file defines hardware registers and memory mapping for the
; Atari 7800. It is distributed as a companion machine-specific support package
; for the DASM compiler. Updates to this file, DASM, and associated tools are
; available at https://github.com/dasm-assembler/dasm


; ******************** 7800 Hardware Adresses ***************************
;
; MEMORY MAP USAGE OF THE 7800
;
; 00 - 1F TIA REGISTERS
; 20 - 3F MARIA REGISTERS
; 40 - FF RAM block 0 (zero page)
; 100 - 11F TIA (mirror of 0000-001f)
; 120 - 13F MARIA (mirror of 0020-003f)
; 140 - 1FF RAM block 1 (stack)
; 200 - 21F TIA (mirror of 0000-001f)
; 220 - 23F MARIA (mirror of 0020-003f)
; 240 - 27F ???
; 280 - 2FF RIOT I/O ports and timers
; 300 - 31F TIA (mirror of 0000-001f)
; 320 - 33F MARIA (mirror of 0020-003f)
; 340 - 3FF ???
; 400 - 47F unused address space
; 480 - 4FF RIOT RAM
; 500 - 57F unused address space
; 580 - 5FF RIOT RAM (mirror of 0480-04ff)
; 600 - 17FF unused address space
; 1800 - 203F RAM
; 2040 - 20FF RAM block 0 (mirror of 0000-001f)
; 2100 - 213F RAM
; 2140 - 21FF RAM block 1 (mirror of 0140-01ff)
; 2200 - 27FF RAM
; 2800 - 2FFF mirror of 1800-27ff
; 3000 - 3FFF unused address space
; 4000 - FF7F potential cartridge address space
; FF80 - FFF9 RESERVED FOR ENCRYPTION
; FFFA - FFFF 6502 VECTORS


;****** 00-1F ********* TIA REGISTERS ******************

INPTCTRL = $01 ;Input control. In same address space as TIA. write-only
VBLANK = $01 ;VBLANK. D7=1:dump paddle caps to ground. write-only
INPT0 = $08 ;Paddle Control Input 0 read-only
INPT1 = $09 ;Paddle Control Input 1 read-only
INPT2 = $0A ;Paddle Control Input 2 read-only
INPT3 = $0B ;Paddle Control Input 3 read-only

; ** some common alternate names for INPT0/1/2/3
INPT4B = $08 ;Joystick 0 Fire 1 read-only
INPT4A = $09 ;Joystick 0 Fire 1 read-only
INPT5B = $0A ;Joystick 1 Fire 0 read-only
INPT5A = $0B ;Joystick 1 Fire 1 read-only
INPT4R = $08 ;Joystick 0 Fire 1 read-only
INPT4L = $09 ;Joystick 0 Fire 1 read-only
INPT5R = $0A ;Joystick 1 Fire 0 read-only
INPT5L = $0B ;Joystick 1 Fire 1 read-only

INPT4 = $0C ;Player 0 Fire Button Input read-only
INPT5 = $0D ;Player 1 Fire Button Input read-only

AUDC0 = $15 ;Audio Control Channel 0 write-only
AUDC1 = $16 ;Audio Control Channel 1 write-only
AUDF0 = $17 ;Audio Frequency Channel 0 write-only
AUDF1 = $18 ;Audio Frequency Channel 1 write-only
AUDV0 = $19 ;Audio Volume Channel 0 write-only
AUDV1 = $1A ;Audio Volume Channel 1 write-only

;****** 20-3F ********* MARIA REGISTERS ***************

BACKGRND = $20 ;Background Color write-only
P0C1 = $21 ;Palette 0 - Color 1 write-only
P0C2 = $22 ;Palette 0 - Color 2 write-only
P0C3 = $23 ;Palette 0 - Color 3 write-only
WSYNC = $24 ;Wait For Sync write-only
P1C1 = $25 ;Palette 1 - Color 1 write-only
P1C2 = $26 ;Palette 1 - Color 2 write-only
P1C3 = $27 ;Palette 1 - Color 3 write-only
MSTAT = $28 ;Maria Status read-only
P2C1 = $29 ;Palette 2 - Color 1 write-only
P2C2 = $2A ;Palette 2 - Color 2 write-only
P2C3 = $2B ;Palette 2 - Color 3 write-only
DPPH = $2C ;Display List List Pointer High write-only
P3C1 = $2D ;Palette 3 - Color 1 write-only
P3C2 = $2E ;Palette 3 - Color 2 write-only
P3C3 = $2F ;Palette 3 - Color 3 write-only
DPPL = $30 ;Display List List Pointer Low write-only
P4C1 = $31 ;Palette 4 - Color 1 write-only
P4C2 = $32 ;Palette 4 - Color 2 write-only
P4C3 = $33 ;Palette 4 - Color 3 write-only
CHARBASE = $34 ;Character Base Address write-only
CHBASE = $34 ;Character Base Address write-only
P5C1 = $35 ;Palette 5 - Color 1 write-only
P5C2 = $36 ;Palette 5 - Color 2 write-only
P5C3 = $37 ;Palette 5 - Color 3 write-only
OFFSET = $38 ;Unused - Store zero here write-only
P6C1 = $39 ;Palette 6 - Color 1 write-only
P6C2 = $3A ;Palette 6 - Color 2 write-only
P6C3 = $3B ;Palette 6 - Color 3 write-only
CTRL = $3C ;Maria Control Register write-only
P7C1 = $3D ;Palette 7 - Color 1 write-only
P7C2 = $3E ;Palette 7 - Color 2 write-only
P7C3 = $3F ;Palette 7 - Color 3 write-only


;****** 280-2FF ******* PIA PORTS AND TIMERS ************

SWCHA = $280 ;P0+P1 Joystick Directional Input read-write
CTLSWA = $281 ;I/O Control for SCHWA read-write
SWACNT = $281 ;VCS name for above read-write
SWCHB = $282 ;Console Switches read-write
CTLSWB = $283 ;I/O Control for SCHWB read-write
SWBCNT = $283 ;VCS name for above read-write

INTIM = $284 ;Iterval Timer Read read-only
TIM1T = $294 ;Set 1 CLK Interval (838 nsec/interval) write-only
TIM8T = $295 ;Set 8 CLK Interval (6.7 usec/interval) write-only
TIM64T = $296 ;Set 64 CLK Interval (63.6 usec/interval) write-only
T1024T = $297 ;Set 1024 CLK Interval (858.2 usec/interval) write-only
TIM64TI = $29E ;Interrupt timer 64T write-only

;XM
XCTRL = $470 ; 7=YM2151 6=RAM@6k 5=RAM@4k 4=pokey@450 3=hsc 2=cart 1=RoF_bank1 0=RoF_bank2

; Pokey register relative locations, since its base may be different
; depending on the hardware.
PAUDF0 = $0 ; extra audio channels and frequencies
PAUDC0 = $1
PAUDF1 = $2
PAUDC1 = $3
PAUDF2 = $4
PAUDC2 = $5
PAUDF3 = $6
PAUDC3 = $7
PAUDCTL = $8 ; Audio Control
PRANDOM = $A ; 17 bit polycounter pseudo random
PSKCTL = $F ; Serial Port control
68 changes: 68 additions & 0 deletions machines/atari7800/macro.h
@@ -0,0 +1,68 @@
; MACRO.H

; Based on the 2600 macro.h file.
; Macros irrelevant to the 7800 have been removed, and the sleep macro
; has been adapted to give accurate results on the 7800.

; Version 1.0 2019/12/11 (based on the 2600 Version 1.05, 13/NOVEMBER/2003)

; Available macros...
; SLEEP n - sleep for n cycles
; SET_POINTER - load a 16-bit absolute to a 16-bit variable

;-------------------------------------------------------------------------------
; SLEEP duration
; Original author: Thomas Jentzsch
; Inserts code which takes the specified number of cycles to execute. This is
; useful for code where precise timing is required.
; ILLEGAL-OPCODE VERSION DOES NOT AFFECT FLAGS OR REGISTERS.
; LEGAL OPCODE VERSION MAY AFFECT FLAGS
; Uses illegal opcode (DASM 2.20.01 onwards).

MAC SLEEP ;usage: SLEEP n (n>1)
.CYCLES SET {1}

IF .CYCLES < 2
ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1"
ERR
ENDIF

IF .CYCLES & 1
IFNCONST NO_ILLEGAL_OPCODES
nop $80
ELSE
bit $80
ENDIF
.CYCLES SET .CYCLES - 3
ENDIF

REPEAT .CYCLES / 2
nop
REPEND
ENDM

;-------------------------------------------------------
; SET_POINTER
; Original author: Manuel Rotschkar
;
; Sets a 2 byte RAM pointer to an absolute address.
;
; Usage: SET_POINTER pointer, address
; Example: SET_POINTER SpritePTR, SpriteData
;
; Note: Alters the accumulator, NZ flags
; IN 1: 2 byte RAM location reserved for pointer
; IN 2: absolute address

MAC SET_POINTER
.POINTER SET {1}
.ADDRESS SET {2}

LDA #<.ADDRESS ; Get Lowbyte of Address
STA .POINTER ; Store in pointer
LDA #>.ADDRESS ; Get Hibyte of Address
STA .POINTER+1 ; Store in pointer+1

ENDM

; EOF
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.