6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 5:37 pm

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Mon Dec 31, 2018 2:27 pm 
Offline
User avatar

Joined: Fri Aug 14, 2015 5:19 pm
Posts: 28
Location: ENCOM mainframe.
Attachment:
fb9.jpg
fb9.jpg [ 5.32 KiB | Viewed 3779 times ]

The new Atari 2600 Flashback 9 consoles come in two varieties of emulator, one running an AtGames emu and the other running the open source emulator Stella.

That one has a virtual 6502 where the decimal flag that is always set. This was corrected in a later build first to be random and then to be cleared for broader software compatibility - what is the perception of setting the decimal flag, does anyone use this mode? I'm not sure why it was included in the architecture.

_________________
Load BASIC from tape on your Atari 2600:
http://RelationalFramework.com/vwBASIC.htm


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 31, 2018 7:31 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Decimal mode is good for point-of-sale and vending machines (also for games scores, but the 6502 was designed for embedded compute and industrial control.)


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 01, 2019 6:55 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1951
Location: Sacramento, CA, USA
Mr SQL wrote:
- what is the perception of setting the decimal flag, does anyone use this mode? I'm not sure why it was included in the architecture.


http://www.6502.org/tutorials/decimal_mode.html#7
http://www.6502.org/tutorials/decimal_mode.html#6

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 02, 2019 8:10 am 
Offline
User avatar

Joined: Fri Aug 14, 2015 5:19 pm
Posts: 28
Location: ENCOM mainframe.
barrym95838 wrote:
Mr SQL wrote:
- what is the perception of setting the decimal flag, does anyone use this mode? I'm not sure why it was included in the architecture.


http://www.6502.org/tutorials/decimal_mode.html#7
http://www.6502.org/tutorials/decimal_mode.html#6

BigEd wrote:
Decimal mode is good for point-of-sale and vending machines (also for games scores, but the 6502 was designed for embedded compute and industrial control.)


I follow but it seems an unusual feature given the 6502's reduced architecture.

Any ideas about the initial state of the flag retaining previous values or being randomized or clear?

Are these characteristics uniform across different models and manufacturing methods?

With virtual 6502's they are not, I'm curious how the real hardware compares.

_________________
Load BASIC from tape on your Atari 2600:
http://RelationalFramework.com/vwBASIC.htm


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 02, 2019 8:21 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
The initial state is undefined on the NMOS parts. I've never seen any statistics on what actually happens: to be meaningful you'd need to collect a lot of extra data about year, manufacturer, voltage, temperature.

Bear in mind that the 6502 wasn't reduced for the sake of it: it was reduced to meet a price point and to be a useful part. Decimal mode was (evidently) felt to be pretty important. (I think the only patent on the 6502 was on the decimal adjust circuitry, but I'm not sure if that proves anything.)

If you look at the initial publicity, here
https://en.wikipedia.org/wiki/MOS_Techn ... t_1975.jpg
you'll see that ease of use, high performance, and a simple instruction set were headlined. It's certainly easier to do BCD arithmetic on a processor which supports it, and arguably easier if you have a mode bit rather than a decimal adjust instruction. You only have to set the mode bit once. And there's a performance win from having the decimal adjust in the 6502 not take any extra cycles - just possibly this will show up, depending on what the benchmarks were.

Anyone any idea what the 'A-H Systems Benchmarks' might have been?


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 02, 2019 2:44 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
Re: AH Systems Benchmarks:

Apparently, AH Systems, Inc. was a small company that provided some detailed information around multiple microprocessors back in the day. I did find a little bit of information, but nothing specific, except that they (AH Systems) charged $495 for the benchmark report, which seemed to include 10 processors.

Some links:

http://www.bitsavers.org/pdf/microcomputerAssociates/
http://bitsavers.informatik.uni-stuttga ... ssociates/

download Feb75 PDF, page 14 covers the book AH Systems published and some info around it.

Some other nice graphics:

Attachment:
timeline_computers_1975_MOS6502.jpg
timeline_computers_1975_MOS6502.jpg [ 101.17 KiB | Viewed 3660 times ]

Attachment:
1280px-MOS_6501_6502_Ad_Sept_1975.jpg
1280px-MOS_6501_6502_Ad_Sept_1975.jpg [ 238.22 KiB | Viewed 3660 times ]

Attachment:
1024px-MOS_6501_Ad_August_1975.jpg
1024px-MOS_6501_Ad_August_1975.jpg [ 166.31 KiB | Viewed 3660 times ]

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 02, 2019 3:45 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
On the topic of decimal mode, it does take up a chunk of the chip, and they did take the trouble to patent the no-overhead decimal arithmetic, so maybe MOS did believe it was quite a selling point, even though it's not mentioned in the adverts. All the competitor parts mentioned - 6800, 8080, F8, PPS-8 - have decimal mode. (Point of sale and data entry are mentioned in the PPS-8 datasheet).

For interest, see also the two-age article "Meet the Microprocessor" from 1976 which has this table:
Attachment:
Micro-comparison-1976.png
Micro-comparison-1976.png [ 117.26 KiB | Viewed 3657 times ]


Good find with the Microcomputer Digest! Here's the page 14 text

Quote:
Microprocessor Field Survey and Data Book
AH Systems, Inc.
The AH Systems, Inc. Microprocessor Field Survey and Data Book is a compact reference volume that provides microprocessor theory, configurations, costs, advantages and disadvantages to the circuit designer, and includes comparisons aimed to answer the question "Which microprocessor is the most cost effective for my specific application?" This report is intended to provide business and industry with the most current, comprehensive and reliable information on the following subjects:
    Microprocessors
    Semiconductor Memories
    Microcomputers
    Programming Aids
    LSI Technology
    Software Support
    LSI Computer Systems
    Interface Chips
This data allows more objective comparisons of various microprocessors, their characteristics and costs. New revisions are issued quarterly in January, April, July and October of each year. The updating service provides details on the current state-of-the-art and significant new developments in the field of microprocessors, systems and LSI Technology.

AH Systems' Microprocessor Field Survey contains four sections.

o EXECUTIVE SUMMARY--Condensed data in brief presentation form, directly oriented to the business manager, program manager, design engineer, chief engineer, software specialists and others interested in a brief overview of the microprocessor field with a comparative analysis of each device.
o INTRODUCTION--General description of the survey, the basic parameters of microprocessors and baseline system data.
o MICROPROCESSOR SURVEY--The survey contains comparisons of the currently available and/or announced microprocessors as a function of key parameters. Over 20 microprocessors are discussed. Areas covered include:
    Selection Parameters
    Technologies
    Benchmark Programs
    Instruction Sets
    Hardware Support
    Software Support
    Second Sourcing
o SUMMARY DATA--Current information on each microprocessor is presented in summary form. The following information is provided for each processor.

    General--Word length, technology, cycle time, cycle time/shortest instruction, power, and configuration.
    Instruction Set--Number of instructions, number of bytes/instruction, microprogrammable, addressing modes, decimal arithmetic capability, push down stack description, and interrupt capability.
    Overhead Circuitry--Requirements, T21 compatibility, manufacturer supplied chips, and start-up conditions.
    Memory--Memory addressing capability and DMA capability.
    Support Items--Hardware and software.
    Availability--Samples and Production
    General Comments
    Marketing Approach
    Recent Announcements
    Major Advertised Customers
    Second Sources Status
    Military Specification Conformance--
    Specifications and reliability data.
    Literature Available from Manufacturer
    Support Material Included

In addition, detailed information is provided when available for:
o System Architecture
o Actual Instruction Sets
o Support Items
o Benchmark Program Listing

An outstanding feature of the AH Systems report is the set of benchmarks which have been programmed for ten of the microprocessors.

A complete set of benchmark results are presented in both tabular and graphic form.

The price of the AH Systems report is $495 and includes the quarterly updates. In addition to the report, AH Systems provides consulting services including systems and software development, training courses and seminars, market research and analysis, and other related services.


Attachments:
Microcomputer-Digest-1975-02-p14.png
Microcomputer-Digest-1975-02-p14.png [ 585.83 KiB | Viewed 3657 times ]
Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 02, 2019 3:58 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
In the later CMOS versions of the 6502 family (which came along *long* after the Atari consoles), the Decimal flag was explicitly cleared on Reset and upon entering interrupt handlers. That's the behaviour of the latest emulator version.

In the original NMOS versions, the Decimal flag was not altered by the interrupt microcode, which was also used by Reset, so you couldn't rely on the state of D on reset or interrupt entry. Not too much of a problem if you include CLD in your Reset handler and never set it again anywhere else.

Additionally, ADC and SBC in Decimal mode took one cycle extra on CMOS, unlike on the NMOS chips - this was to allow the NZV flags to be updated to correctly reflect the post-decimal-adjusted result; these flags were often wrong on NMOS (but predictably so, and this is one reliable way to distinguish NMOS from CMOS). Apparently this was considered a sufficiently important bug to fix in hardware.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 02, 2019 4:04 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
Ah, but wait... my story gets better!

Seems AH Systems are still around, who knew. In a later edition, September 1975, H. Dean McKay (President) presented an article in electronic warfare. It also shows the company name/address on page 22 as:

A H Systems Inc.
9710 Cozycroft Ave, Chatsworth CA 91311
(213) 998-0223

Today the same company exists as:

9710 Cozycroft Ave, Chatsworth, CA 91311
(818) 998-0223
https://www.ahsystems.com/

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 02, 2019 7:33 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
You shouldn't downplay the indirect efficiencies of Decimal mode either.

Consider. Decimal math is trivial and cheap. To multiply and divide by 10, simply shift left or right. Similarly, it's trivial to encode and decode to text, for much of the same reason. This is at a cost in memory, but not a substantial cost. 6 digits (999,999) in 3 bytes. Which is a completely reasonable decimal number for staggering number of applications. A calculator or cash register doesn't actually need to store a lot of numbers, it just has to store the most recent numbers. Fix point (or even floating point) conversion is also trivial. 6 digits for 9,999.99.

So, the decimal flag is actually a pretty valuable asset to such a little processor. I wouldn't overlook it.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 02, 2019 10:01 pm 
Offline
User avatar

Joined: Fri Aug 14, 2015 5:19 pm
Posts: 28
Location: ENCOM mainframe.
Chromatix wrote:
In the later CMOS versions of the 6502 family (which came along *long* after the Atari consoles), the Decimal flag was explicitly cleared on Reset and upon entering interrupt handlers. That's the behaviour of the latest emulator version.

In the original NMOS versions, the Decimal flag was not altered by the interrupt microcode, which was also used by Reset, so you couldn't rely on the state of D on reset or interrupt entry. Not too much of a problem if you include CLD in your Reset handler and never set it again anywhere else.

Additionally, ADC and SBC in Decimal mode took one cycle extra on CMOS, unlike on the NMOS chips - this was to allow the NZV flags to be updated to correctly reflect the post-decimal-adjusted result; these flags were often wrong on NMOS (but predictably so, and this is one reliable way to distinguish NMOS from CMOS). Apparently this was considered a sufficiently important bug to fix in hardware.


This is very interesting, it sounds like that change could potentially break some Atari 2600 games -
every cycle counts in the kernel because there is no framebuffer save half a scanline, the timing is so tight we have to count the cycles.

The production run for 6507's/6502's spanned 1977 to 1992 so I bet the different versions abound, perhaps this may account for some of the incompatibilities between models (edit: Atari VCS production).

Learning lot's of fascinating stuff on this thread! :)

_________________
Load BASIC from tape on your Atari 2600:
http://RelationalFramework.com/vwBASIC.htm


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 03, 2019 1:56 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
Well, also CMOS 6502s don't have the various "undocumented opcodes" that NMOS 6502s had, and which some games for old machines were known to use. That would be another breaking change, and quite likely explains why the software emulator is used rather than a real hardware 6502.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 24 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: