Page 2 of 2

Re: Compusense. Dasm/Demon

Posted: Sat Sep 18, 2010 10:44 pm
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

Re: Compusense. Dasm/Demon

Posted: Sat Sep 18, 2010 11:18 pm
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).

Re: Compusense. Dasm/Demon

Posted: Sun Sep 19, 2010 2:48 am
by zephyr
Thanks Alastair. I updated my example code with the BASIC routine at the end to display the symbol table.

Re: Compusense. Dasm/Demon

Posted: Sun Sep 19, 2010 3:47 pm
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

Re: Compusense. Dasm/Demon

Posted: Sun Sep 19, 2010 5:44 pm
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.

Re: Compusense. Dasm/Demon

Posted: Mon Sep 20, 2010 11:29 am
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.

Re: Compusense. Dasm/Demon

Posted: Mon Sep 20, 2010 2:22 pm
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

Re: Compusense. Dasm/Demon

Posted: Tue Sep 21, 2010 8:29 pm
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.