Jump to content
IGNORED

New Adam Owner


videofx

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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!

  • Like 1
Link to comment
Share on other sites

NIAD, the kind ADAM dictator! :rolling:

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. :grin:

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...