6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Sep 20, 2024 7:36 am

All times are UTC




Post new topic Reply to topic  [ 138 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7 ... 10  Next
Author Message
PostPosted: Fri Jul 28, 2017 5:18 am 
Offline

Joined: Mon Mar 25, 2013 9:26 pm
Posts: 183
Location: Germany
To question 1) I'm using one of the inexpensive PL2303HX USB2Serial adapter like this one: http://amzn.to/2vdc2xU. They are strong enough to even power a small system and run on 5V TTL level, so you don't have to use a MAX232 to convert to RS-232 voltage levels.
The PL2303HX is directly supported by MacOS without the need to install a driver like for the CH340 FTDI replacements you find on the cheap Arduino clones.

Mario.

_________________
How should I know what I think, until I hear what I've said.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 28, 2017 7:06 am 
Offline

Joined: Fri Apr 15, 2016 1:03 am
Posts: 139
nei02: your 64Kbit EEPROM will work OK as long as you don't need to put more than 8192 bytes in it.
You don't need to change your address decoding at all - selecting the EEPROM for any address between $8000 & $FFFF will just repeat the 8KByte EEPROM contents 4 times.
You might consider the "real" copy to be $E000 thru $FFFF and the "extra" copies to be $8000 thru $9FFF, $A000 thru $BFFF, and $C000 thru $DFFF.
When you later replace the 64Kbit EEPROM with a 256Kbit one and connect the additional 2 address lines, there won't be any "extra" copies anymore - $8000 thru $FFFF will access a unique EEPROM byte.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 28, 2017 6:02 pm 
Offline

Joined: Fri Jul 21, 2017 8:16 pm
Posts: 59
Thanks for this hint with the addresses. I am just trying to digest this.

My EEProm has only 13 address-lines (A0 - A12)
The 65C02 has 16 address-lines.

The first three most significant bits can not be addressed (but the A15 can enable the ROM)

When I now program my EEPROM in address $8600 1000 0110 0000 0000
He actually writes the value in address $0600 0 0110 0000 0000

So i think that not the stored value is doubled but the 65C02 finds the same value with for different addresses:
$0600 (000)0 0110 0000 0000 -> Not since he will read from RAM
$8600 (100)0 0110 0000 0000
$A600 (101)0 0110 0000 0000
$C600 (110)0 0110 0000 0000
$E600 (111)0 0110 0000 0000


What do you think?


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 28, 2017 6:55 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8510
Location: Southern California
It's not a problem though. If you know you only have 8KB of EEPROM, you won't be writing to the mirrored address ranges. It's like the I/O in the simple address decoding scheme in the 6502 primer which I've been using for 24 years and never had a problem with it.

BTW, a little tip about English: Inanimate objects (like the EEPROM and the processor) are referred to as "it," not "he." Some animate objects are also referred to as "it," but the lines get foggy. We would usually refer a dog as "he" or "she;" but referring to a snake, I might say "I saw it on the road," or referring to a bird, "It flew into the window."

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 28, 2017 8:38 pm 
Offline

Joined: Fri Jul 21, 2017 8:16 pm
Posts: 59
Thanks for this advise regarding english! I appreciate this!

I wrote a litte program and its working.

Address Hexdump Dissassembly
-------------------------------
$8600 a2 00 LDX #$00
$8602 a9 01 LDA #$01
$8604 8d 01 00 STA $0001
$8607 a9 05 LDA #$05
$8609 8d 02 00 STA $0002
$860c a9 08 LDA #$08
$860e 8d 03 00 STA $0003
$8611 e8 INX
$8612 8a TXA
$8613 8d 04 00 STA $0004
$8616 4c 11 06 JMP $8611

used the arduino to program the EEPROM

=========
byte digits[] = {0xa2 ,0x00 ,0xa9 ,0x01 ,0x8d ,0x01 ,0x00 ,0xa9 ,0x05 ,0x8d ,0x02 ,0x00 ,0xa9 ,0x08 ,0x8d ,0x03 ,0x00 ,0xe8 ,0x8a ,0x8d ,0x04 ,0x00 ,0x4c ,0x11 ,0x86};

int adresse = 0;
for (int value = 0; value <= (sizeof(digits)); value +=1) {
adresse = 0x8600 + value;
writeEEPROM(adresse,digits[value]);
}
==========

Its counting and jumping! :-) Next step will be Counting storing loading adding jumping.
Thank you very much!


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 28, 2017 10:22 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8389
Location: Midwestern USA
GARTHWILSON wrote:
BTW, a little tip about English: Inanimate objects (like the EEPROM and the processor) are referred to as "it," not "he."

What Garth is saying is unlike other Latinate languages, English doesn't use the formal concept of gender with most objects. Exceptions are few, and in informal speech objects are often referred to as being feminine. For example, a ship may be referred to as "she" rather than "it". The tendency to use the feminine to refer to machines seems to have come from old Romance language usage. For example, in Western Hemisphere Spanish, a computer is almost always called "computadora," which has feminine gender (in Castillian Spanish, on the other hand, a computer is "ordenador," which is masculine—go figure). A railway locomotive is "locomotora," also feminine, which makes no sense when one considers how big and powerful those things are. :D

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 31, 2017 9:15 pm 
Offline

Joined: Fri Jul 21, 2017 8:16 pm
Posts: 59
mkl0815 wrote:
I would also suggest using CoolTerm, it is really easy to use and has some nice features.
Beside the Ophis assembler .



I am struggling with ophis and python.

I copied all the ophis *,py files into documents. But I don't make it :-(

>>> python main.py hello1
File "<stdin>", line 1
python main.py hello1
^
SyntaxError: invalid syntax
>>>

:evil:


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 31, 2017 10:09 pm 
Offline

Joined: Sat Jun 04, 2016 10:22 pm
Posts: 483
Location: Australia
It looks like you are trying to invoke Python from inside Python. That's not going to work. You need to be at a terminal. Something like bash, where you get a $ prompt.
I imagine you already know this, but to get out of Python, you can enter exit(). If you started Python using a terminal, that will put you back into the terminal. If you started Python using a menu or shortcut, it will probably just close the window.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 31, 2017 10:45 pm 
Offline

Joined: Fri Jul 21, 2017 8:16 pm
Posts: 59
Hi
I now can create an assembled outputfile. But the option -1 doesn't work.
Just downloading an HEX editor to read the outputfile.

Dankeschön

Ralf


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 31, 2017 10:47 pm 
Offline

Joined: Fri Jul 21, 2017 8:16 pm
Posts: 59
Got:

A90185FF

From:

lda #$1
sta $FF

seems to work.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 03, 2017 6:07 pm 
Offline

Joined: Fri Jul 21, 2017 8:16 pm
Posts: 59
Hello,
I made some progress. Learned to assemble with Ophis and emulate with Sysmon.
My little computer has now RAM, ROM. next step is to implement ACIA 65C51 to communicate with a terminal programm.
Ordered the RS232 to USB adapter as proposed. And waiting now for some parts from mouser.

In the meantime I try to teach my BenEater breadboard computer how to detect Carry.
I already set up a status register to store the zero flag. (latches only if Op Code add or Subtract / controlled by microcode)

No I wanted to latch the Carry bit and noticed that there is always a carry out if I make a subtraction.
--> Unsigned Numbers!
(Do the subtraction by adding the 2scomplement)
To latch the Carry flag I now used a XOR-Gate.

Carry / SUBsignal / Carry flag
0 1 1
1 0 1
1 1 0
0 0 0

So if subtraction an carry out is ok. But if no carry out than the result is invalid and the carry flag will be set.
If adding no carry out is ok. But if the adder has a carry out the result is invalid and the carry flag will be set.

Is this the right way to to? I am talking about unsigned numbers.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 03, 2017 6:38 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
I think the joy of two's-complement arithmetic is that the ALU doesn't have to worry about whether a number is signed or not, for addition and subtraction.

There are two reasonable choices for the convention of what to do with carry and subtraction: either carry is a borrow bit, or it's the opposite. The 6502's choice is to make carry the opposite of a borrow. So, before a subtraction, you set the carry, and afterwards you expect the carry to be set. This consistency makes it easy to string together subtractions on multi-byte values. If, on the 6502, you find the carry isn't set after subtraction, it means there's a borrow, which means the subtraction 'failed' - you computed X-Y and it turns out that Y was bigger.

I've a feeling the 6800 made the opposite choice, so in that case you'd clear the carry before a subtraction and afterwards expect it to be clear. If it's not clear, then you did X-Y and Y was bigger.

Hope this helps.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 03, 2017 9:52 pm 
Offline

Joined: Fri Jul 21, 2017 8:16 pm
Posts: 59
Yes! This helps! I want to implement a BCC and BCS.
I assume that this is equal to a "less than" .
btw: Do you know a source where I can see the 65C02 micro steps for every instruction?


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 03, 2017 10:01 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8510
Location: Southern California
nei02 wrote:
Yes! This helps! I want to implement a BCC and BCS.
I assume that this is equal to a "less than" .

BCC, or "branch on carry clear," means "branch if less than" if it's after a subtraction.

Quote:
btw: Do you know a source where I can see the 65C02 micro steps for every instruction?

I don't know if this is what you're looking for, but the 65816 datasheet, at http://6502.org/documents/datasheets/wd ... 3_2010.pdf, tells what's on the buses in every cycle of every instruction, starting on page 38 of the .pdf. It's for the '02 as well, and the footnotes tell the difference between the '02 and '816 in different modes.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 04, 2017 5:14 am 
Offline

Joined: Tue Jun 08, 2004 11:51 pm
Posts: 213
Two's complement subtraction is complement the value to
subtract and add 1, then add to the other value.
Setting the carry before the subtraction on the 6502 does
the +1 for you.
Clever of them.
Tinker Dwight


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 138 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7 ... 10  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 37 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: