Bill Lange Posted June 6, 2003 Share Posted June 6, 2003 I've been updating Atari Roots, an Atari assembly language book from circa 1983, to include examples for DASM/ Atari800Win PLus. For example, I took the following program from chapter 9, which was for the Atari Assembler Editor cartridge. I fixed the errors in line 160 and 190 (the Atari assembler can not assemble a line with just a lable on it) - 10; THE ATARI RAINBOW 20; RAINBOW.SRC 30; 40 COLRBK=$2C8; THE GRAPHICS 0 BORDER COLOR REGISTER 50 TMPCLR=$C0; A PLACE TO STORE COLORS TEMPORARILY 60; 70 *=$0600 80; 90 START LDA #$FE; MAX COLOR VALUE 0100 STA TMPCLR 0110; 0120 NEWCLR LDA TMPCLR 0130 STA COLRBK 0140; 0150 LDX #$FF 0160 LOOPA NOP; JUST A DELAY LOOP 0170; 0180 LDY #$30 0190 LOOPB NOP; ANOTHER DELAY LOOP 0200 DEY; DECREMENT Y REGISTER 0210 BNE LOOPB 0220; 0230 DEX; DECREMENT X REGISTER 0240 BNE LOOPA 0250; 0260 DEC TMPCLR; DCREMENT TMPCLR 0270 DEC TMPCLR; SUBTRACT 2 FOR NEXT COLOR 0280 BNE NEWCLR; IF NOT ZERO, CHANGE COLORS AGAIN 0290; 0300 JMP START; ALL COLORS DISPLAYED - NOW DO 'EM ALL AGAIN and modified it for DASM ; The Atari Rainbow ; rainbow.das ; compile with DASM ; dasm rainbow.das -f3 -orainbow.bin ; attach resulting .BIN file as a cartridge in the Atari800Win Plus Emulator processor 6502; must be seven space before this line COLRBK equ $2C8; THE GRAPHICS 0 BORDER COLOR REGISTER TMPCLR equ $C0; A PLACE TO STORE COLORS TEMPORARILY ORG $A000 CLD; clear the decimal flag CLC; clear the carry flag START LDA #$FE; MAX COLOR VALUE STA TMPCLR NEWCLR LDA TMPCLR STA COLRBK LDX #$FF LOOPA NOP; JUST A DELAY LOOP LDY #$30 LOOPB NOP; ANOTHER DELAY LOOP DEY; DECREMENT Y REGISTER BNE LOOPB DEX; DECREMENT X REGISTER BNE LOOPA DEC TMPCLR; DECREMENT TMPCLR DEC TMPCLR; SUBTRACT 2 FOR NEXT COLOR BNE NEWCLR; IF NOT ZERO, CHANGE COLORS AGAIN JMP START; ALL COLORS DISPLAYED - START OVER ORG $BFFA .byte $00; $BFFA starting address low byte .byte $A0; $BFFB starting address high byte .byte $00; $BFFC cartridge present byte must be zero .byte $02; $BFFD cartridge flag byte - bits 0,2 and 7 are significant .byte $00; $BFFE init address low byte .byte $A0; $BFFF init address high byte I've also showed how to use the Monitor in the Atari800Win Plus instead of the DEBUG mode of the Atari Assembler Editor cart. Is there any interest in seeing this? WRL Link to comment Share on other sites More sharing options...
+Sauron Posted June 6, 2003 Share Posted June 6, 2003 Yes, definitely! I've never read the original book, though, but just having specific examples for today's commonly used assemblers would be worth the price of admission in itself. Link to comment Share on other sites More sharing options...
Jetboot Jack Posted June 6, 2003 Share Posted June 6, 2003 I'd like to see this stuff -- I still have my copy of roots sTeVE Link to comment Share on other sites More sharing options...
DEBRO Posted June 6, 2003 Share Posted June 6, 2003 Hi Bill, Nice to see you translating this to DASM (as this is the assembler I use ). BTW, I've been sitting on this for a while now... Your examples will run a cart image. If you wanted to create a disk image using DASM you would do... CODE_START = $<code start address> RUNAD = $2E0 ; needs to be added to equates.inc .org CODE_START ; ; this is the header information needed for the disk image ; .byte $FF,$FF .word CODE_START ; the code starting location .word CODE_END-13 ; the ending location of the code (minus DASM extra bytes) . . . ; ; since I can't find a way to .org RUNAD in DASM...this works fine ; it tells DOS the start address of the code ; .word RUNAD,RUNAD-1 .word CODE_START END_CODE Link to comment Share on other sites More sharing options...
Bill Lange Posted June 6, 2003 Author Share Posted June 6, 2003 Look here - http://www.langesite.com/AtariRoots/index.html Thanks for the info on the disk images. I'll have to try that too. WRL Link to comment Share on other sites More sharing options...
DEBRO Posted June 6, 2003 Share Posted June 6, 2003 Bill I forgot to add... Have you seen this http://www.atariage.com/forums/viewtopic.p...6728&highlight= I hope to see you there Link to comment Share on other sites More sharing options...
Bill Lange Posted June 6, 2003 Author Share Posted June 6, 2003 I've seen it now! WRL Link to comment Share on other sites More sharing options...
Bill Lange Posted June 7, 2003 Author Share Posted June 7, 2003 Ok, here is all of Atari Roots except Appendix A. Let me know what you guys think. I am know in the processes of converting all the example programs to Dasm/Atari800Win PLus. www.langesite.com/AtariRoots WRL Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.