Thomas Jentzsch Posted April 20, 2017 Share Posted April 20, 2017 (edited) Ah, I remember that from somewhere... My version: DASM 2.20.11 unofficial RevEng 20140124 Edited April 20, 2017 by Thomas Jentzsch Quote Link to comment Share on other sites More sharing options...
enthusi Posted April 20, 2017 Share Posted April 20, 2017 haha, hehe.. *cries* I seriously wonder why so many people in the Atari field keep using DASM. Or in fact it appears to me that many individual patches/fixes are out there. All other 6502-based communities use other or at least a large variety of assemblers. Funny, somehow. 1 Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted April 20, 2017 Share Posted April 20, 2017 Historical reasons I suppose. Quote Link to comment Share on other sites More sharing options...
Kylearan Posted April 20, 2017 Author Share Posted April 20, 2017 I seriously wonder why so many people in the Atari field keep using DASM. [...] All other 6502-based communities use other or at least a large variety of assemblers. Can you recommend a better alternative? You'd instantly become my personal hero! Apart from a lot of minor gripes I have with dasm, the main feature I'm looking for is to have a linker where I can mark sections as aligned or parts of a section as "nocross" (i.e. that part must not cross a page boundary) and then let the linker optimize placement in ROM. KK's k65 more or less has such a linker, but it doesn't use standard 650x mnemonics and has lots of other minor annoyances and inconsistencies. Quote Link to comment Share on other sites More sharing options...
enthusi Posted April 20, 2017 Share Posted April 20, 2017 I use XA from floodgap which is pretty basic and I like that plus it comes with a suitable disassembler. Ca65 of the cc65 suite is pretty popular among sceners with a background as professional programmers. Kickassembler is pretty mighty (which I dislike Then there is K2asm that provides inline-Python for those are into such things. To replace DASM probably ACME is a good choice as well. Still actively developed. Me, I like it simple. I only use local labels and #defines as a 'feature' of XA, not even macros (which it has). Converting my source to-from any other is no issue. Quote Link to comment Share on other sites More sharing options...
Kylearan Posted April 20, 2017 Author Share Posted April 20, 2017 From a quick glance over the assemblers you listed, none of them seems to support the "nocross" declaration in conjunction with a linker. Which is really odd, as that is often needed and would be much more powerful and easier to use than manually fiddling around with "align" and "org" statements. Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted April 20, 2017 Share Posted April 20, 2017 Macros can help here. Quote Link to comment Share on other sites More sharing options...
gauauu Posted April 20, 2017 Share Posted April 20, 2017 I seriously wonder why so many people in the Atari field keep using DASM. Part of it is that it's just easier to use the same thing others are using. Then as you pass around code, or ask questions, everyone knows what you're talking about. Ca65 of the cc65 suite is pretty popular among sceners with a background as professional programmers. I've been using ca65 for a nes game recently. It's pretty nice, but learning the linker configuration system can be a pain. Quote Link to comment Share on other sites More sharing options...
enthusi Posted April 21, 2017 Share Posted April 21, 2017 I've been using ca65 for a nes game recently. It's pretty nice, but learning the linker configuration system can be a pain. Yes, it's not my cup of coffee either As I said people who are used to this from i.e. embedded coding etc. seem to love it :-) I for one want to keep 100% control of all bytes. Which is also why I dont like macros and alike. If something is supposed to be in memory, I want to have written that manually Not particularly efficient but this is my hobby and that is why I enjoy Assembler coding - not for rapid application development but handwritten opcodes and knowledge where in ZP which variable sits, etc. I align by .dsb $1000-*,$ff if I already know the barrier or even: .dsb ((*+$100)/$100)*$100-*,$ff to align for the next best page break. There is no branches-crossing-page-boundaries warning in XA but sometimes I write python tools to check labels as postprocess. Quote Link to comment Share on other sites More sharing options...
Kylearan Posted April 21, 2017 Author Share Posted April 21, 2017 I understand your point of view; it's a matter of taste. I however would like to concentrate on coding actual effects or game logic. Manually aligning code and data, sometimes with a needed offset, and manually searching for code caves when ROM gets full and then shuffling around routines and data blocks is something I've done extensively before and already know how that works. Now the computer scientist in me demands that my PC should do that chore for me. It's an optimization problem perfectly suited to computers, so it can do it better anyway! So I broke down and actually started to develop my own assembler/linker. It will support align with offset and nocross sections, optimize placement of sections in ROM and yet still allows full control of everything, if needed. It also does away with stupid white space rules and other annoyances. Hopefully with Boost Spirit it won't take very long to have a usable prototype. 3 Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted April 21, 2017 Share Posted April 21, 2017 I almost forgot, here is the working ROM (for those who are too lazy to assemble it themselves ). BTW: @Kylearan: I noticed your random number generation. Why don't you use LFSRs? lightning.bin Quote Link to comment Share on other sites More sharing options...
Kylearan Posted April 21, 2017 Author Share Posted April 21, 2017 (edited) BTW: @Kylearan: I noticed your random number generation. Why don't you use LFSRs? To be honest, I just googled for 8 bit pRNG routines and quickly found one at codebase64 which is small and generates all numbers between 0-255 (which for some effects like fades is useful), so I didn't search any further. So far, it served me well on multiple occasions, and up to now I only needed 256 different seeds and not a 16 bit version. But from a quick glance at your link it seems to be very similar in concept, and "my" version also allows any seed, even 0 (which is quite important). Edited April 21, 2017 by Kylearan Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted April 21, 2017 Share Posted April 21, 2017 I for one want to keep 100% control of all bytes. Which is also why I dont like macros and alike. ... There is no branches-crossing-page-boundaries warning in XA but sometimes I write python tools to check labels as postprocess. Might be worth making an exception if you can create a macro for XA like this set we use with dasm. You still maintain 100% control of the bytes, it just generates an error as part of the compile process: ;------------------------------------------------------- ; SAME PAGE BRANCH CHECK ; Original auther: John Payson ; ; Usage: sbeq, sbne, etc just like a normal beq, bne, etc. ; A message will be output if the target of the branch ; is not on the same page. ; mac sbcc bcc {1} if (* ^ {1}) & $FF00 echo "PAGE CROSSING","WARNING ",{1}," at ",* err endif endm mac sbcs bcs {1} if (* ^ {1}) & $FF00 echo "PAGE CROSSING","WARNING ",{1}," at ",* err endif endm mac sbeq beq {1} if (* ^ {1}) & $FF00 echo "PAGE CROSSING","WARNING ",{1}," at ",* err endif endm mac sbmi bmi {1} if (* ^ {1}) & $FF00 echo "PAGE CROSSING","WARNING ",{1}," at ",* err endif endm mac sbne bne {1} if (* ^ {1}) & $FF00 echo "PAGE CROSSING","WARNING ",{1}," at ",* err endif endm mac sbpl bpl {1} if (* ^ {1}) & $FF00 echo "PAGE CROSSING","WARNING ",{1}," at ",* err endif endm mac sbvc bvc {1} if (* ^ {1}) & $FF00 echo "PAGE CROSSING","WARNING ",{1}," at ",* err endif endm mac sbvs bvs {1} if (* ^ {1}) & $FF00 echo "PAGE CROSSING","WARNING ",{1}," at ",* err endif endm I made a variation set of them as dXXX to confirm branch to a different page as I needed the extra cycle to occur one time. ;------------------------------------------------------- ; DIFFERENT PAGE BRANCH CHECK ; Original auther: Darrell Spice, Jr. ; ; Usage: dbeq, dbne, etc just like a normal beq, bne, etc. ; A message will be output if the target of the branch ; is not on a different page. ; mac dbcc bcc {1} if ((* ^ {1}) & $FF00) = 0 echo "SAME PAGE","WARNING ",{1}," at ",* err endif endm mac dbcs bcs {1} if ((* ^ {1}) & $FF00) = 0 echo "SAME PAGE","WARNING ",{1}," at ",* err endif endm mac dbeq beq {1} if ((* ^ {1}) & $FF00) = 0 echo "SAME PAGE","WARNING ",{1}," at ",* err endif endm mac dbmi bmi {1} if ((* ^ {1}) & $FF00) = 0 echo "SAME PAGE","WARNING ",{1}," at ",* err endif endm mac dbne bne {1} if ((* ^ {1}) & $FF00) = 0 echo "SAME PAGE","WARNING ",{1}," at ",* err endif endm mac dbpl bpl {1} if ((* ^ {1}) & $FF00) = 0 echo "SAME PAGE","WARNING ",{1}," at ",* err endif endm mac dbvc bvc {1} if ((* ^ {1}) & $FF00) = 0 echo "SAME PAGE","WARNING ",{1}," at ",* err endif endm mac dbvs bvs {1} if ((* ^ {1}) & $FF00) = 0 echo "SAME PAGE","WARNING ",{1}," at ",* err endif endm Quote Link to comment Share on other sites More sharing options...
enthusi Posted April 21, 2017 Share Posted April 21, 2017 Oh, admittedly that is a nice solution but it affects the source code. Two things mentioned here I also had in mind "optimize placement of sections in ROM" while you follow the smart approach I once wrote a python code to do that based on labels that are local with start, end and then tries to re-arrange them for best continuous fit. For Assembloids2600 I did all by hand. Back and forth. Alot. Again. Alot. Lost my sanity several times And about branching, I'd rather patch the assembler code itself to check for that if the branch lines contains a ";nocross" instead of using an artificial opcode. Then again, your version works, mine is just a 'what if' in my head 1 Quote Link to comment Share on other sites More sharing options...
gauauu Posted April 22, 2017 Share Posted April 22, 2017 "optimize placement of sections in ROM" while you follow the smart approach I once wrote a python code to do that based on labels that are local with start, end and then tries to re-arrange them for best continuous fit. For Assembloids2600 I did all by hand. Back and forth. Alot. Again. Alot. Lost my sanity several times Ugh, I wasted so much time doing that at the end of my Atari Anguna development. I don't want to have to do that ever again, I'm all for a tool that makes it easier. (That said, a lot of it was also rearranging between banks, which is a bit more complicated, as you have to also track what data each section has access to, and factor in the expense of doing a bank jump) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.