Compusense. Dasm/Demon

Looking for a Dragon or CoCo game not already in the archive - Then request it here and hopefully it will either be uploaded to the archive or another member can upload it to this forum.
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Compusense. Dasm/Demon

Post by zephyr »

I discovered the EXEC address of the assembler, and worked out the syntax by disassembly of the cart. The only thing I couldn't work out for now, is how to get the assembler to display the end address of the assembled code (EDIT: learnt - source code updated). The following code gives a basic idea of how to use the assembler. Type it in, run it, and type EXEC to start the assembled machine code program.

Code: Select all

10 CLEAR1000
20 EXEC&HCFFA
30 ALL
40 ORG $5000
50 @START CLRB
60 @L1 LDX #$0400
70 @L2 STB ,X+
80 CMPX #$0600
90 BLO @L2
100 LDY #$1000
110 @L3 JSR $BBE5
120 CMPA #3
130 BEQ @BASIC
140 LEAY -1,Y
150 BNE @L3
160 INCB
170 BNE @L1
180 @BASIC LEAX -32,X
190 STX >$88
200 @END RTS
210 END @START
220 '
230 'DISPLAY SYMBOL TABLE
240 '
250 PRINT:FOR I=PEEK(33)*256+PEEK(34) TO PEEK(39)*256+PEEK(40) STEP 10
260 IF PEEK(I+4)<>0 THEN PRINT"@"; ELSE IF PEEK(&H0600)<>0 THEN PRINT"ERRORS":END ELSE END
270 FOR J=I+4 TO I+9:PRINT CHR$(PEEK(J));:NEXT J
280 PRINT,HEX$(PEEK(I)*256+PEEK(I+1)):NEXT I
Last edited by zephyr on Sun Sep 19, 2010 2:04 pm, edited 7 times in total.
Alastair
Posts: 669
Joined: Fri Jul 18, 2008 11:33 pm

Re: Compusense. Dasm/Demon

Post by Alastair »

You could wait until I upload PDFs of the manuals. In the mean time you may wish to try out the sample program from the DASM manual (page image attached).
Attachments
DASM_Sample_Program.zip
(126.69 KiB) Downloaded 328 times
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Compusense. Dasm/Demon

Post by zephyr »

Thanks Alastair. I updated my example code with the BASIC routine at the end to display the symbol table.
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Compusense. Dasm/Demon

Post by zephyr »

The text at the top of that page reads "DASM - Two Pass Symbolic Assembler for DRAGON/TANDY". This statement seems to indicate that DasmDemon is compatible with both Dragon and CoCo machines, but that's not the case with the version you uploaded because it calls Dragon specific ROM routines. I assume that Compusense must have given customers the option to buy either Dragon or Tandy compatible versions.

I have patched the Dragon compatible version that you uploaded so that it is compatible with all Tandy CoCo 1/2 machines. I have also updated my source code to make it compatible for use on the CoCo. Both are added below...

Code: Select all

10 CLEAR1000
20 EXEC&HCFFA
30 ALL
40 ORG $5000
50 @START CLRB
60 @L1 LDX #$0400
70 @L2 STB ,X+
80 CMPX #$0600
90 BLO @L2
100 LDY #$0300
110 @L3 JSR [$A000]
120 CMPA #3
130 BEQ @BASIC
140 LEAY -1,Y
150 BNE @L3
160 INCB
170 BNE @L1
180 @BASIC LEAX -32,X
190 STX >$88
200 @END RTS
210 END @START
220 '
230 'DISPLAY SYMBOL TABLE
240 '
250 PRINT:FOR I=PEEK(33)*256+PEEK(34) TO PEEK(39)*256+PEEK(40) STEP 10
260 IF PEEK(I+4)<>0 THEN PRINT"@"; ELSE IF PEEK(&H0600)<>0 THEN PRINT "ERRORS":END ELSE END
270 FOR J=I+4 TO I+9:PRINT CHR$(PEEK(J));:NEXT J
280 PRINT,HEX$(PEEK(I)*256+PEEK(I+1)):NEXT I
Attachments
DasmDemon - Patched for CoCo.zip
(6.06 KiB) Downloaded 312 times
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Compusense. Dasm/Demon

Post by zephyr »

This version is patched to make it compatible with both Dragon and Tandy CoCo 1/2 machines. 8-)

EDIT: Attached an improved version. This version removes some protection from the DEMON monitor which was intended to prevent the cartridge from being run in MAP1 (64K RAM) mode. The routine which identifies the machine type and calls the correct ROM routines has also been improved.
Attachments
DasmDemon - Patched for CoCo and Dragon v2.zip
(6.09 KiB) Downloaded 328 times
Last edited by zephyr on Tue Sep 21, 2010 8:48 pm, edited 1 time in total.
prime
Posts: 267
Joined: Fri Apr 10, 2009 1:40 am

Re: Compusense. Dasm/Demon

Post by prime »

zephyr wrote:This version is patched to make it compatible with both Dragon and Tandy CoCo 1/2 machines. 8-)
Cool what did you need to do to make it compatible ?

cheers.

Phill.
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Compusense. Dasm/Demon

Post by zephyr »

Thanks Phill! :) For some ROM calls I had to write a small (but fast) routine to identify the machine type and call the correct ROM routines. The machine type is identified by looking for $B4 at the ROM address $BFFF (Reset vector LSB). For the %POLCAT% and %OUTCHR% I simply added some indirect JMPs (JMP [$A000], JMP [$A002]) utilising the indirect jump table.

Regards,
Steve
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Compusense. Dasm/Demon

Post by zephyr »

This is a cassette version of DasmDemon which is compatible with any 64K CoCo or Dragon machine. It works by copying the BASIC ROM and DasmDemon cartridge ROM to RAM in exactly the same configuration as if it were in ROM. This allows you to try this great little assembler/monitor on your 64K CoCo or Dragon without the need for the cartridge hardware. 8-)

EDIT: Once you get the cassette copy that you created from the included wave file loaded into your real 64K CoCo or Dragon, I strongly recommend that you re-save to cassette using the following.

CoCo: POKE146,2:POKE147,0:CSAVEM"DASM64",&H4000,&H60D6,&H4000
Dragon: POKE144,2:POKE145,0: CSAVEM"DASM64",&H4000,&H60D6,&H4000

The result of this will be a reliable cassette copy which loads much quicker than the copy made from the included wave file.
Attachments
DasmDemon for 64K CoCo and Dragon.zip
(44.44 KiB) Downloaded 324 times
Post Reply