Linked by Thom Holwerda on Tue 15th Jan 2013 22:29 UTC
Hardware, Embedded Systems "In this article, I show at the transistor and silicon level. I've discussed the mathematics of the 6502 overflow flag earlier and thought it would be interesting to look at the actual chip-level implementation. Even though the overflow flag is a slightly obscure feature, its circuit is simple enough that it can be explained at the silicon level."
Order by: Score:
Does anybody still make the 6502?
by bassbeast on Wed 16th Jan 2013 13:35 UTC
bassbeast
Member since:
2007-11-11

Or is this just a slow week? Don't get me wrong, i like reading about niche hardware, but there are chips from that time one can still buy retail and play with. for example the Z80 is still sold and used in many of the CCC MP4 players sold on Chinamart, one can pick up one of those and try hacking on that.

Heck I'm shocked somebody don't pay one of the Chinamart vendors for a fully unlocked unit just for hacking, its not like those little Chinese companies are against hacking as all they want is to sell the hardware.

Reply Score: 2

Vanders Member since:
2005-07-06

Yup, they're still being made. http://westerndesigncenter.com/wdc/chips.cfm

Reply Score: 5

smashIt Member since:
2005-07-06

for example the Z80 is still sold and used in many of the CCC MP4 players sold on Chinamart, one can pick up one of those and try hacking on that.


isn'T the z80 the architecture with the most produced units?

Reply Score: 2

bassbeast Member since:
2007-11-11

It was last time I checked. See those cheap MP3/MP4 players at the checkout? Z80. Thermostats? Z80. Car Stereos and car MP3 players? Z80. Honestly they seem to use that chip more now than they did back when it was being sold in mainstream computers. Can't say as I blame 'em, easy to program for, low power, cheap, and can play most media with the right DSP attached.

Like I said go to Chinamart or any of those Asian vendor sites and you'll find TONS of units, from gumstick MP3s to game handhelds running the Z80 chip, some of them are pretty fricking awesome. I had one of the "MP4" players that ran on SD cards, it would play NES and Gameboy as well as play music and videos, got halfway decent battery life as well. I ended up giving it to a relative who had a sick kid, kept his mind off being sick all the time to have hundreds of games on an SD card. I'm really gonna have to get me another one one of these days, they are great little units.

Reply Score: 2

zima Member since:
2005-07-06

Such absolute domination of Z80 is not really the case any more - a lot of Chinese media players (especially those with more processing power requirements; like, when needed for emulation, or software decoding of various media formats) come with RockChip SoCs. And that's ARM.
http://en.wikipedia.org/wiki/Rockchip
http://www.rockbox.org/wiki/RockChip

I suppose in the simplest devices Z80 is still a fairly safe bet - like in S1 MP3 players: http://en.wikipedia.org/wiki/S1_MP3_player

Edited 2013-01-16 19:20 UTC

Reply Score: 3

levi Member since:
2006-09-07

If I get you right then you're missing the point. Linked article is valuable because of three reasons - nostalgia, debunking and learning value.

Nostalgia and correcting wrong information that is blindly repeated doesn't require clarification.

Learning value does, a bit.
Binary arithmetic didn't change since then and value of understanding quirks of its implementation on real platforms uncovers new territories for some people.

How many OSN readers know how negative numbers are represented in computer memory ?

Edited 2013-01-18 18:33 UTC

Reply Score: 1

Alfman Member since:
2011-01-28

levi,

"How many OSN readers know how negative numbers are represented in computer memory ?"

*Raise hand*

OSNews isn't as technical as I'd like it to be, but I still can appreciate articles covering the basics. Whether they're basic or advanced, I like technical articles much more than those catering to the mobile bling crowd, but I'm surely in the minority and it hasn't helped that there aren't regular technical writers on staff.

Reply Score: 2

Comment by Kroc
by Kroc on Wed 16th Jan 2013 13:56 UTC
Kroc
Member since:
2005-11-10

Yes, 6502s are still in use today in the embedded space. Search for "65C02", there's also the 16-bit version "65C816".

Edit: That was supposed to be a reply to above, I got confused with the silly interstitial log in form.

Edited 2013-01-16 13:57 UTC

Reply Score: 3

RE: Comment by Kroc
by Thom_Holwerda on Wed 16th Jan 2013 14:41 UTC in reply to "Comment by Kroc"
Thom_Holwerda Member since:
2005-06-29

Edit: That was supposed to be a reply to above, I got confused with the silly interstitial log in form.


Yay Kroc, you just justified all our efforts for OSNews 5 ;) .

Reply Score: 2

RE[2]: Comment by Kroc
by Kochise on Wed 16th Jan 2013 16:29 UTC in reply to "RE: Comment by Kroc"
Kochise Member since:
2006-03-03

So, disable the "mobile" version alltogether, it's just plain silly on my Google Nexus 7 using Opera. When I scroll at the bottom of the page, the text disapears and it's hard to select "desktop version" at random.

Kochise

Reply Score: 2

RE: Comment by Kroc
by Valhalla on Wed 16th Jan 2013 16:30 UTC in reply to "Comment by Kroc"
Valhalla Member since:
2006-01-24

I did some brief programming on the 65816 back in the day (it was used in the Super Nintendo amongst others).

I remember going like 'yay, a 6502 with 16-bit registers!', unfortunately as I recall there were no separate opcodes for using 8 or 16 bit registers so instead you had to switch between 8/16-bit by setting a 'mode' bit in the status register with rep,sep instructions which quickly became tedious.

Reply Score: 2

Optimization
by Alfman on Wed 16th Jan 2013 15:47 UTC
Alfman
Member since:
2011-01-28

A lot of optimizations can be done with the CPU flags. The trouble is that high level programming languages don't expose them, I'm looking at you C. The C language for it's part assumes the flags don't exist so that it doesn't have to emulate them on architectures which don't have them.

Something as basic as determining whether A+B has overflowed is non-trivial in C, especially considering how overflow logic gets optimized away, see this heated discussion in GCC's bug tracker:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30475

IMHO the lack of overflow flags is a deficiency of most high level languages.

Another flag we don't see much of is the parity flag, but I've found a very interesting way to use parity bits to optimize multi-word multiplication algorithms. An efficient population count function would do the trick too since the least significant bit represents parity. Even though C is thought to be the best low level language, there still exists a gap between it and assembly language.

Edited 2013-01-16 15:52 UTC

Reply Score: 6

Comment by MOS6510
by MOS6510 on Wed 16th Jan 2013 16:04 UTC
MOS6510
Member since:
2011-05-12

It's easy to forget with all these high level programming languages and modern operating systems used to launch the latest 3D games with the best A.I. bad guys that it's really ones and zeroes.

Reply Score: 2

RE: Comment by MOS6510
by Laurence on Wed 16th Jan 2013 16:41 UTC in reply to "Comment by MOS6510"
Laurence Member since:
2007-03-26

It's easy to forget with all these high level programming languages and modern operating systems used to launch the latest 3D games with the best A.I. bad guys that it's really ones and zeroes.

Maybe for end users, but I'd have hoped that most OSNews readers found that fact hard to forget.

Reply Score: 2

RE[2]: Comment by MOS6510
by MOS6510 on Wed 16th Jan 2013 16:57 UTC in reply to "RE: Comment by MOS6510"
MOS6510 Member since:
2011-05-12

I hope so, but during my life I have encountered a number of IT people that were seriously lacking any knowledge beyond their own speciality.

Most don't even know what a nibble is!

It's a sign of the times I guess. Many financial experts use cheap calculators and have no clue how my HP-12C works, nor had they ever heard of it. I have the HP-16C too, to get back to binairy.

Reply Score: 2

RE[3]: Comment by MOS6510
by Laurence on Wed 16th Jan 2013 17:32 UTC in reply to "RE[2]: Comment by MOS6510"
Laurence Member since:
2007-03-26

Most don't even know what a nibble is!

Aren't they the snakes that used to inhabit that QBasic game which shipped with DOS once upon a time? :p


...In all seriousness, I can forgive people for not knowing what a nibble is; there isn't much need to deal with half-octets in most cases. But understanding that computers process in binary is pretty much covered in the 1st chapter of "The Idiots Guide To Those Magic Computing-Boxes".

Reply Score: 2

RE[4]: Comment by MOS6510
by MOS6510 on Wed 16th Jan 2013 17:51 UTC in reply to "RE[3]: Comment by MOS6510"
MOS6510 Member since:
2011-05-12

I once did an AIX course, also present were a number of Microsoft certified chaps. They wanted to know where the GUI was, how to join a domain and if you could rename root to Administrator(!).

Most Microsoft experts know very little of Linux and what they know is wrong.

But they make good money, so it's possible to be succesful at IT without knowing anything beyond your subject of expertice.

BTW the AIX course came down to: type 'smit' and fiddle around with the menu.

Reply Score: 2

RE[5]: Comment by MOS6510
by tidux on Thu 17th Jan 2013 00:01 UTC in reply to "RE[4]: Comment by MOS6510"
tidux Member since:
2011-08-13

So THAT's the target audience for Fedora 18!

Reply Score: 2

RE[5]: Comment by MOS6510
by Laurence on Thu 17th Jan 2013 08:57 UTC in reply to "RE[4]: Comment by MOS6510"
Laurence Member since:
2007-03-26

AIX isn't Linux (or was that a separate point you were making?)

I know what you mean though. I'm a Linux and UNIX administrator by trade, and these days I struggle to fix even basic Windows problems. Back in the days of XP (and every version of Windows that preceded it, both NT and DOS branches), I knew where everything was and how to fix many of even the most obscure of errors. But the last version of Windows I ran at home was Win2000 (I was only familiar with XP because of the similarities) and since then Vista, 7 and 8 have all changed everything around. Now I struggle even just finding networking control panels (in fact I don't understand how people prefer the new control panel layout as it's a nightmare if you know where you want to end up but not what hyperlinks you need to click to get there!)

Thankfully Windows does have some CLI tools which have been pretty static over the years. But there's a hell of a lot in Windows which doesn't have a CLI to and I end up having to guess to find the GUI on the rare occasions I am called up to fix a Windows PC (which, thankfully, is very rare these days)

Reply Score: 2

RE[6]: Comment by MOS6510
by MOS6510 on Thu 17th Jan 2013 09:14 UTC in reply to "RE[5]: Comment by MOS6510"
MOS6510 Member since:
2011-05-12

The point was <anything> outside <what some people know>. Embarrassingly they thought of AIX as some kind of operating system that does all the Windows thing, only different. Zo they assumed a GUI somewhere, a domain controller, the Administrator, drive letters.

Yes, Microsoft has this annoying habit of moving stuff/settings, almost to a point it could be called deliberate hiding.

The CLI is often helpful, but sometimes thing disappear, like the 'telnet' command that was present in Windows 2003, but is left out by default in Windows 2008 and needs to be added.

If management really knew how UNIX/Linux/Windows worked I'm pretty sure it would have a devastating effect on Windows server market share.

Reply Score: 2

RE[7]: Comment by MOS6510
by lucas_maximus on Thu 17th Jan 2013 20:53 UTC in reply to "RE[6]: Comment by MOS6510"
lucas_maximus Member since:
2009-08-18

Windows works well because of things like group policy and it's integration with other products.

Reply Score: 2

RE[6]: Comment by MOS6510
by Alfman on Thu 17th Jan 2013 15:04 UTC in reply to "RE[5]: Comment by MOS6510"
Alfman Member since:
2011-01-28

Laurence,

Yea, right? It used to be simple to direct users to the control panel and find something. Not long ago I was trying to find the control appet for a virtual CD rom, ridiculous... The wizards in place today have no hierarchy, you just dive in and start wading through wizards you don't want until you eventually get what you want. It's so incoherently organised and difficult to walk someone through over the phone.

Another change I find troubling are the missing icons in the icon tray, which can be extremely helpful in conveying information and controlling system daemons. We can turn it back on of course, but anyone who's ever given instructions to a technophobe over the phone knows what a PITA it is when windows may or may not have hidden some of the tray icons.

Worse yet, this leads to application vendors engineering around the missing tray icons in windows. Take a look at skype's solution, which makes the skype program unclosable in the application list. Click the "X", still there. Right click the running program and click "close", still there. This is infuriating application behaviour and yet I completely understand why they did it since they were compensating for poor windows behaviour. Users wouldn't be able to access a skype instance under hidden tray icons.


A far better solution to clean up the icon tray without crippling it IMHO would be to stop vendors from pre-loading all the unwanted bloatware responsible for polluting the icon tray in the first place.

/rant

Edited 2013-01-17 15:07 UTC

Reply Score: 2

RE[6]: Comment by MOS6510
by lucas_maximus on Thu 17th Jan 2013 20:58 UTC in reply to "RE[5]: Comment by MOS6510"
lucas_maximus Member since:
2009-08-18

Most of it is available via the search box once you are in the control panel.

Reply Score: 2

Comment by Valhalla
by Valhalla on Wed 16th Jan 2013 16:17 UTC
Valhalla
Member since:
2006-01-24

Very interesting (and very deep) article. As someone who first learned programming on a 6502 (or rather 6510 as it was on a Commodore 64) I never even remotely considered how this worked, just that it did.

Reply Score: 3

Very Interesting
by Pro-Competition on Wed 16th Jan 2013 16:17 UTC
Pro-Competition
Member since:
2007-08-20

I found both this article and the author's article about the mathematics of the flag to be very interesting. Thank you for linking to them!

This brings back memories. The VIC-20 was my first computer, and several of the popular competitors used the 6502 also. I quickly got into machine/assembly language programming, and even wrote a couple of articles for Commodore's magazines at the time. Those were the days... ;^)

Reply Score: 2