home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
A
/
6502DASM.LZH
/
6502DASM.MAC
next >
Wrap
Text File
|
1991-01-16
|
3KB
|
85 lines
;
; Program: DASM
; Version: 1.5
; Author: Richard Conn
; Date: 16 Aug 82
; Previous Versions: 1.3 (23 May 82), 1.4 (12 June 82)
; Previous Versions: 1.0 (1 May 82), 1.1 (8 May 82), 1.2 (15 May 82)
; Derivation: ZZSOURCE and RESOURCE
;
; DASM is a TDL/ZILOG Disassembler derived from Dave Barker's
; ZZSOURCE and Ward Christensen's RESOURCE by Richard Conn. Refer to
; the documentation on RESOURCE and the built-in HELP data for information
; on the commands used for DASM. A Help file is also being planned for DASM.
;
; This version is a 6502 Disassembler by virtue of the inclusion of
; DASM6502.MAC, created by W.F. Dudley (10 Dec 82).
; The changes in this fragment are marked with: ;###6dasm
;
VERS equ 15 ; Version Number
.Z80 ; USE ZILOG MNEMONICS
ASEG ; USE ABSOLUTE SEGMENTS
; Values for TRUE and FALSE
FALSE equ 0
TRUE equ NOT FALSE
; Set one and ONLY one of the following to TRUE
ZILOG equ false
TDL equ FALSE
c6502 equ true ;###6dasm
; Initial Values for DASM
RDCOMQ EQU FALSE ;TRUE OF QUERY USER TO READ COM FILE
; WHEN 'ALL' IS FILE TYPE
CTLTBL EQU ENDALL ;BEGINNING OF CONTROL TABLE
SYMTAB EQU CTLTBL+600H ;BEGINNING OF SYMBOL TABLE
INITOFF EQU SYMTAB+2000H ;INITIAL OFFSET VALUE
COMTBL EQU INITOFF+4000H ;BEGINNING OF COMMENTS
SYMMAX EQU 12 ;MAX NUMBER OF CHARS/SYMBOL (<= 12)
INITLCNT EQU 20 ;NUMBER OF LINES TO DISPLAY VIA L, A, B
INITDLEN EQU 80H ;NUMBER OF BYTES TO DISPLAY VIA D
INITPC EQU 100H ;INITIAL VALUE OF PC
INITELST EQU 0FFFFH ;INITIAL END OF LIST VALUE
IBUFLEN EQU 80 ;LENGTH OF INPUT LINE BUFFER
; CP/M Constants
WBOOT EQU 00H
BDOS EQU 05H
FCB EQU 5CH
FCBNR EQU 7CH
FCBTYPE EQU 65H
RECLEN EQU 80H
;
; Beginning of Program
;
ORG 0100H
JP START
JP GETCMD ;This is an easy entry point for a restart.
;
; The following INCLUDE is used to include the appropriate file defining
; the Mnemonics for the desired language. Choices at this time are:
; DASMZLG.MAC -- ZILOG-Standard Mnemonics
; DASMTDL.MAC -- TDL Mnemonics
; DASM6502.MAC -- 6502 Mnemonics ;###6dasm
;
IF ZILOG
INCLUDE DASMZLG.MAC ;Include ZILOG Mnemonic File
ENDIF
IF TDL
INCLUDE DASMTDL.MAC ;Include TDL Mnemonic File
ENDIF
IF c6502 ;###6dasm
INCLUDE DASM6502.MAC ;Include 6502 Mnemonic File ;###6dasm
ENDIF ;###6dasm
;
; PRINT HEADERS
;
START:
LD SP,OLDST ;SET STACK
CALL PSTRNG
DEFB 0DH,0AH,'DASM, Version '
DEFB VERS/10+'0','.',(VERS MOD 10)+'0',0DH,0AH,0
;
; PERFORM REENTRANT INITIALIZATION
;
CALL INIT0 ;INITIALIZE BUFFERS SO DASM IS REENTRANT
CALL INIT ;CLEANUP INITIALIZATION
; etc. etc. etc...