Grevle Posted May 10, 2015 Share Posted May 10, 2015 Is there a easy way to add to the x register ?. Lets say that the equate "DC" contains value 10 LDX #10 STX DC then i want to add 10 more to this DC equate, how can i go about this. LDX DC+ 10# - i tried that one but it didnt work when using atasm to compile. Im still a beginner but i guess it should be easy to learn how this is done. Quote Link to comment Share on other sites More sharing options...
Rybags Posted May 10, 2015 Share Posted May 10, 2015 There's no add or subtract for X and Y, only A. There's INX, DEX which adds or subtracts 1. Generally you use A if you want to do maths or bitwise operations. LDX DC + 10# isn't a legal instruction. LDX DC + 10 would be legal but it loads X with whatever is 10 bytes after DC. e.g. if DC is $4000 then X gets loaded from $400A. In the example you gave, if you want to add 10 to what's in DC, you'd do something like: LDA DC CLC ADC #10 STA DC Quote Link to comment Share on other sites More sharing options...
xxl Posted May 10, 2015 Share Posted May 10, 2015 Is there a easy way to add to the x register ? You always can use undocumented code: to add value to X register: LAX DC SBX #$100-10 to substract value from X register: LAX DC SBX #10 no need to clear or set C. 2 Quote Link to comment Share on other sites More sharing options...
Grevle Posted May 10, 2015 Author Share Posted May 10, 2015 Thank you il give it a try.. Quote Link to comment Share on other sites More sharing options...
Kyle22 Posted May 10, 2015 Share Posted May 10, 2015 You always can use undocumented code: to add value to X register: LAX DC SBX #$100-10 to substract value from X register: LAX DC SBX #10 no need to clear or set C. Yes, you can do that, but it means that those of us who have 65802 and 65816 processors aren't able to run it. Quote Link to comment Share on other sites More sharing options...
xxl Posted May 10, 2015 Share Posted May 10, 2015 computer with 6809 aren't able to run it also. but... Atari computer does not have these processors. 3 Quote Link to comment Share on other sites More sharing options...
Shawn Jefferson Posted May 11, 2015 Share Posted May 11, 2015 but... Atari computer does not have these processors. They do today. 2 Quote Link to comment Share on other sites More sharing options...
phaeron Posted May 11, 2015 Share Posted May 11, 2015 Atari never shipped a computer with more than 128K of memory, either. Undocumented instructions have a lot of caveats. Besides compatibility with the 65816, they are also neither consistently documented nor supported by assemblers and debuggers. For a beginner I would definitely recommend avoiding such instructions. 3 Quote Link to comment Share on other sites More sharing options...
Bryan Posted May 11, 2015 Share Posted May 11, 2015 I say use them only if you're writing something to show how fast it can be (i.e. inner loop of 1337 democode). Otherwise, reorder your code to have the value in A when you need to manipulate it. LUTs can be used for some things you do frequently with limited possible outcomes. Quote Link to comment Share on other sites More sharing options...
Kyle22 Posted May 11, 2015 Share Posted May 11, 2015 computer with 6809 aren't able to run it also. but... Atari computer does not have these processors. 6809 is not compatible with 6502 code at all. Some people do have them in their Ataris, but they don't run any Atari software at all, so that is a non-issue for us here. I have a 65802 in my Atari 800 Incognito, it was a direct plug in replacement for the 6502. If I add only one jumper wire to the CPU card in my 800, I can directly plug in a 65816. The 802's and 816's are compatible with documented 6502 instructions, and run 99% of Atari software perfectly. The added benefit is that they both provide useful extra instructions and addressing modes that the 6502 is missing, and in the case of the 816, it allows much more RAM to be directly addressed by the CPU. The new Rapidus board from Lotharek, and the XL14 from Bob Woolley (bob1200xl) are two examples of the new, fast accelerators being produced for our beloved Ataris, and I hope everyone buys one. We must also never forget about the Sweet 16 from FTe. The Sweet 16 was a beautiful little blue board, hardly bigger than the DIP40 Sally it replaced. The 816 was on top, and a GAL logic chip on the bottom of the board. Note to anyone who is trying to repair one: Due to a mistake in design, the legs on the GAL had to be bent over backwards, and the chip was mounted to the underside of the board upside down. It worked out well to confuse those who would try to copy it, but that was not the original intention. It was a real pain in the ass to build because of that. (Just a little bit of history there.) 1 Quote Link to comment Share on other sites More sharing options...
Grevle Posted May 11, 2015 Author Share Posted May 11, 2015 Atasm would not compile the undocumented features so im going for use of ADC or SBC when needed, As its also easier to understand. Thank You. Quote Link to comment Share on other sites More sharing options...
+David_P Posted May 11, 2015 Share Posted May 11, 2015 We must also never forget about the Sweet 16 from FTe. The Sweet 16 was a beautiful little blue board, hardly bigger than the DIP40 Sally it replaced. The 816 was on top, and a GAL logic chip on the bottom of the board. Note to anyone who is trying to repair one: Due to a mistake in design, the legs on the GAL had to be bent over backwards, and the chip was mounted to the underside of the board upside down. It worked out well to confuse those who would try to copy it, but that was not the original intention. It was a real pain in the ass to build because of that. (Just a little bit of history there.) ...and the gold pins are really, really soft, and don't hold up well to moving the board between systems 1 Quote Link to comment Share on other sites More sharing options...
Kyle22 Posted May 11, 2015 Share Posted May 11, 2015 ...and the gold pins are really, really soft, and don't hold up well to moving the board between systems Yes, they are... But they make good contact, and they look great Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted May 11, 2015 Share Posted May 11, 2015 (edited) in c64 land undocumented opcodes are "standard" and on Atari don't? as XXL posted they are "illegal" opcodes which are stable... neverless I would not recommend them for beginners either but why not? for the 0,1% with an 65816? (if they are 0,1% machines... maybe 0,01%...) (people should complain more about PAL software not running on NTSC... or as I played yesterday hours with my 800... why there is less 800 (48k) modern software ) but do we really want to go back to 1979 - 48k RAM).... ps. I know philosophy discussion here... just wanted to give my 2 cents regarding the "evil opcodes". Edited May 11, 2015 by Heaven/TQA Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted May 11, 2015 Share Posted May 11, 2015 and btw... XXL's example trashes A and X so you always have tradeoffs... but with official methoda ADC/TAX you would do the same. Quote Link to comment Share on other sites More sharing options...
emkay Posted May 11, 2015 Share Posted May 11, 2015 Atari never shipped a computer with more than 128K of memory, either. Atari managed to add the Cartridge Port with Page Flipping. So you just could use any cart with RAM/ROM sizes, as far as the pageflipping and the budget works. But I miss the "CPU exchange socket" . And btw. A 128K Atari has more than 128K inside, because Pageflipping works fine. Undocumented instructions have a lot of caveats. Besides compatibility with the 65816, they are also neither consistently documented nor supported by assemblers and debuggers. For a beginner I would definitely recommend avoiding such instructions. Yeah, and an advanced coder buys faster Hardware to write faster programs? 1 Quote Link to comment Share on other sites More sharing options...
MaPa Posted May 11, 2015 Share Posted May 11, 2015 The 802's and 816's are compatible with documented 6502 instructions, and run 99% of Atari software perfectly. The added benefit is that they both provide useful extra instructions and addressing modes that the 6502 is missing, and in the case of the 816, it allows much more RAM to be directly addressed by the CPU. Added benefit? But then the software will not run on stock Atari with the new instructions or addressing modes... I can say that the undocumented 6502 instructions are added benefit too and software which is using them will run on stock Atari. The new Rapidus board from Lotharek, and the XL14 from Bob Woolley (bob1200xl) are two examples of the new, fast accelerators being produced for our beloved Ataris, and I hope everyone buys one. I hope not. Or I don't care if someone buys it but I hope that the software for it will not be at the expense of software for stock Atari. 2 Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted May 11, 2015 Share Posted May 11, 2015 just another 2 cents regarding LAX/SAX/SBX... from my latest projects I can tell that these instructions enabled 1-2 more FPS... which is a lot getting from slideshow to something playable... so why should I leave them out? 3 Quote Link to comment Share on other sites More sharing options...
xxl Posted May 11, 2015 Share Posted May 11, 2015 (edited) what is the benefit in replace 8-bit cpu in atari? new programs for that computer do not work on standard Atari... why should I change my beloved Atari into 16 bit? or even better question: why should I write programs in "safe" mode to work on that transform hardware? maybe we shouldn't use 6502C decimal mode because of lack of compatibility with 65816? btw. MADS http://mads.atari8.info/ allows to compile undocumented instructions Edited May 11, 2015 by xxl 1 Quote Link to comment Share on other sites More sharing options...
Joey Z Posted May 11, 2015 Share Posted May 11, 2015 what is the benefit in replace 8-bit cpu in atari? new programs for that computer do not work on standard Atari... why should I change my beloved Atari into 16 bit? or even better question: why should I write programs in "safe" mode to work on that transform hardware? maybe we shouldn't use 6502C decimal mode because of lack of compatibility with 65816? btw. MADS http://mads.atari8.info/ allows to compile undocumented instructions the real issue is when your 6502C dies from lightning strike, act of god, whatever it takes, and YOU CAN'T FIND ANOTHER. one day we'll be out of 6502C's and you'll have to convert to a 65C02, which doesn't support undocumented instructions. Quote Link to comment Share on other sites More sharing options...
Kyle22 Posted May 11, 2015 Share Posted May 11, 2015 what is the benefit in replace 8-bit cpu in atari? new programs for that computer do not work on standard Atari... why should I change my beloved Atari into 16 bit? or even better question: why should I write programs in "safe" mode to work on that transform hardware? maybe we shouldn't use 6502C decimal mode because of lack of compatibility with 65816? btw. MADS http://mads.atari8.info/ allows to compile undocumented instructions First of all, there are many benefits, look up the 65816: http://en.wikipedia.org/wiki/WDC_65816/65802 You are not changing your beloved Atari into a 16 bit, you are only enhancing its capabilities. The way you wrote that makes it sound as if we're changing it into an ST. Safe Mode, really? We're not talking about Windows here. All I am asking you (and everyone) to do is respect the documented opcodes so everyone can use your software. the decimal mode problem was a bug which was fixed. Quote Link to comment Share on other sites More sharing options...
emkay Posted May 11, 2015 Share Posted May 11, 2015 All I am asking you (and everyone) to do is respect the documented opcodes so everyone can use your software. What about respecting the Atari's real specs? When a coder wants to push a stock machine to the limits, you should also respect that. And, well, what would stop you to do the needed changes for the Atari with your strange setup? Quote Link to comment Share on other sites More sharing options...
Kyle22 Posted May 11, 2015 Share Posted May 11, 2015 In 2015, it would surprise me to see any number of "power users" who are not using some form of upgrade. Therefore, the bone stock machine becomes the "strange setup." 2 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted May 11, 2015 Share Posted May 11, 2015 the real issue is when your 6502C dies from lightning strike, act of god, whatever it takes, and YOU CAN'T FIND ANOTHER. one day we'll be out of 6502C's and you'll have to convert to a 65C02, which doesn't support undocumented instructions. Nah - by that time, anyone can (and most likely will have) rolled their own via FPGA so no issues 1 Quote Link to comment Share on other sites More sharing options...
Bryan Posted May 11, 2015 Share Posted May 11, 2015 just another 2 cents regarding LAX/SAX/SBX... from my latest projects I can tell that these instructions enabled 1-2 more FPS... which is a lot getting from slideshow to something playable... so why should I leave them out? Then it would be cool to have an option which simply patches the illegal opcodes in and out (while leaving space for the longer option). The patch code could be pretty small. 1 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.