+videofx Posted April 22, 2013 Share Posted April 22, 2013 I just picked up my Adam this weekend from Jim and he knows what ever you need to know. We spent all day Saturday going over everything sine I am a Newbie when it comes to the Adam. Atari and Amiga is what I know. So I hooked everything up at home and used my DOS PC to make floppies to test on my Adam disk drive. The first disk I made was CPM and Assembler. The reason I wanted to test this first was a few years ago when I started programming my Atari 800 in 6502 Assembler. I found a bug. Its a math bug. Here is the bug. When you subtract 1 from 0 (if you said -1 then you are right) you should get FFh (FF is hex for 255 or in Binary 11111111) So in the Atari if you Subtract 1 from 0 instead of getting FFh you get FEh. So the Atari has a bug. (I have tested this with the Atari Assembler cart and Mac/65) Now on the Adam when you subtract 1 from 0 you et the correct answer which is FFh I found this interesting so I thought I would share If you are interested in the 6502 and Z80 instructions I will show you. ATARI: .ORG $600 LDA #0 SBC #1 Adam: ORG 100H MVI A,0 SUI 1 Hope you found this interesting Bill Quote Link to comment Share on other sites More sharing options...
NIAD Posted April 23, 2013 Share Posted April 23, 2013 Glad to hear the ADAM Computer package that I was able to assemble for you with all the extra goodies is already being put to good use. Sounds like I found the perfect home for it as the return to this CV & ADAM Community could be vast considering the incredible knowledge of computers/programming that you hold. BTW, thanks for saving me from shipping this monster out and picking it up! Interesting tidbit about the ADAM returning the proper value for your test case when the Atari didn't. Quote Link to comment Share on other sites More sharing options...
+nanochess Posted April 23, 2013 Share Posted April 23, 2013 Nice to know about a newcomer to the Coleco lands By the way, the 6502 substract instruction always includes carry, the right way to substract is to clear the carry flag using the SEC instruction, this is the cause of the weird behavior. So your code should look like: LDA #0 SEC SBC #1 For adding the sense is reversed, your code should be: LDA #0 CLC ADC #1 Thanks for helping me to "undust" my 6502 memories Quote Link to comment Share on other sites More sharing options...
retroillucid Posted April 23, 2013 Share Posted April 23, 2013 That is sweet from Jim! Anyway, Jim is really that kind of guy you want as friend Jim, The ADAM Dictator. Quote Link to comment Share on other sites More sharing options...
+videofx Posted April 23, 2013 Author Share Posted April 23, 2013 Thanks Nanochess! setting the carry flag before doing the subtraction yields the correct answer. The difference is on the Z80 you have the SUI - Subtract immediately so you don't have to worry about the carry flag but the 6502 only has SBC - subtract with carry so I see you have to set the carry before subtracting. Thanks for helping me solve this problem! 1 Quote Link to comment Share on other sites More sharing options...
NIAD Posted April 23, 2013 Share Posted April 23, 2013 Jim, The ADAM Dictator. Hmmm, I think dictator is kind of a harsh word to use although I have been known to crack the wip around here at times... so maybe it does fit! Quote Link to comment Share on other sites More sharing options...
retroillucid Posted April 23, 2013 Share Posted April 23, 2013 Hmmm, I think dictator is kind of a harsh word to use although I have been known to crack the wip around here at times... so maybe it does fit! no worries, I did use that word as kindly Quote Link to comment Share on other sites More sharing options...
Pixelboy Posted April 23, 2013 Share Posted April 23, 2013 no worries, I did use that word as kindly NIAD, the kind ADAM dictator! 1 Quote Link to comment Share on other sites More sharing options...
NIAD Posted April 24, 2013 Share Posted April 24, 2013 NIAD, the kind ADAM dictator! Somehow I knew that you couldn't resist chiming in on Retroillucid's post, although I thought it would have been his first post and not the second. At least I'm not the "Sweet Dictator"! Or is it Sweat? Nah, I had it right the first time... it is Sweet. See PixelBoy, I do learn from my mistakes which is a fleeting trait to possess in today's world. 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.