A 6502 Simulator Mystery - Solved!

preview_player
Показать описание
For a while now I've been looking at a nifty little 6502 simulator which has been available on the Apple ][, but was uncertain of its provenance. I began this video in the hopes that someone could identify it, but while making it - right as I was about to publish it! I stumbled across the actual answer to the mystery. Here we go!

On a related note, check out Curt Sampson's excellent blog article "Going Back to EDASM, the 1980 Apple II Editor/Assembler", which discusses one of the other executables on the same disk.

Join this channel to get access to perks; the "Thanks, peterb!" tier is a great way to show your support without breaking the bank, and the "Early Access" tier gets you access to most of my videos about a week early.

Рекомендации по теме
Комментарии
Автор

Wow. I can't believe this existed in 1982 and nothing like this became a part of everyone's 6502 educational tools for another decade or two.

Barnaclebeard
Автор

I worked at MECC when that was built. My recollection is that it was written by Anders McCarthy and possibly with the help of Eric Rantapa. It was the best of times. We had a cadre of young brilliant coders with a love of technology. I learned many amazing things from those days. They were mostly also attending UofM and way ahead of where the college curriculum was.

RussErickson_v
Автор

I can confirm that the 6502 simulator existed in the 80‘s. During my time as a student, around 1982…1984 I was lucky to get my hands on an Apple ][ owned by the university and also came across this really amazing piece of software. It helped me in understanding machine language and not much longer I started to write assembler and BASIC applications for the Apple ][. Memories, memories!

henrypile
Автор

An ad appear the exact moment you pressed enter on the keyboard, and for a second I was utterly confused and had no idea what had happened. The timing was just too perfect.

pablogarin
Автор

I started programming in 1985 on an Apple ][ knock off (I was living on the other side of the iron curtain). I've seen this, or a very similar thing a couple of years later. Back then I was only programming in BASIC, so this looked like magic to me. Unfortunately, I didn't make a copy and when I started dabbling in assembly a couple of years later, I couldn't find it.

It is an amazing piece of software and I don't know why it wasn't more popular. Thanks for the memories! :)

IvanToshkov
Автор

Interesting...not quite emulating the 6502 properly.

Once the LSB of the address of LDA $0800, X has been loaded, while the processor loads the MSB (08) the X is simultaneously being added to the LSB.
During the next cycle the created address (read MSB plus modified LSB) is read whilst internally the processor checks the carry flag and increases the MSB if necessary. If the MSB was increased the read data is thrown away and the read of the correct address is done on the next clock cycle.

This is why crossing page boundaries on reads take an extra cycle.

On a write to avoid potentially splatting memory the 6502 does not do a write before it has checked the carry flag (it possibly does a read) and so a write (on an indexed address) always takes the extra cycle.

Being little endian it means the 6502 can start modifying an indexed address whilst the address is still loading, thus improving efficiency.

cigmorfil
Автор

This simulator dates back to the '80s. I had it and I did Apple II stuff just until I got my Atari Mega ST in 1988.

galier
Автор

I imagine some people wonder why anyone would care about such old tech. But the beauty of the Apple II, was you could understand everything it did for the most part. Read the Reference manual, the DOS manual, and other manuals, and you know what it's doing. I am a software engineer since the 80s, who got his start with time shared BASIC and Apple II, and since then, programming has gotten increasingly black box. In fact, the HP 2000, not sure?) Something doesn't work, and you don't really know why, you can't necessarily debug what's wrong. I think some people love an environment where you can still understand what the computer is doing. Consider a modern Windows computer. You type something into a console window. And it seems simple, except who knows how many APIs, system calls, device drivers, and whatnot, had to happen, just to print out those characters. I often thought it would be interesting to write a book whose only goal, was to explain what happened, when you type in a command to the console, in terms of how the characters are displayed in the window, programs are run, and output is funneled back to window. If you understood all that stuff from Windows calls, lower level system calls, device drivers, etc. you would understand a modern computer really well. But I couldn't even write that book with my current knowledge ( I would come closer, if it was Linux.) Anyway, my point is even stuff that looks simple, is due to a complex pyramid of code on top of code. Where in the Apple II days, much simpler. Harder in a lot of ways as so little code was available to leverage, but also a lot simpler too.

michaelbauers
Автор

I saw this program back in the 80's running on an actual Apple IIe. I don't know who wrote it.

A few years ago I wrote a 6502 emulator, and then when on to write an Apple II emulator on top of it. Once I got the graphics and the Disk II emulation running, I went and found this simulator and ran it. I realized that I was watching a 6502 simulator running on a 6502 emulator! How meta is that???

markjones
Автор

Impressive and funny. This 6502 simulator clearly shows how 6502's registers work. I wish I could have seen it working when I started to learn 6502 machine language. Thank you!

Commodoreretro-programming
Автор

After over a decade of watching 8bit retro computing videos on YouTube, how have I never seen this before? Since I finally got the recommendation you get a belated sub. Looking forward to catching up on the rest of your content.

MikePerigo
Автор

This disk is listed in the 1986 MECC catalog: Apple Assembly Language | Advanced Programming | These comprehensive materials provide the basis for an introductory course in Apple assembly language. In addition to lesson outlines, handouts, and 36 sequenced student exercises, this package features six utility programs to aid the beginning or advanced assembly language programmer. Among these utilities are a powerful debugging tool and an animated simulation of the 6502 microprocessor.
Apple 48K*
No. T-691 $49.00

DanielBarnes-gwjt
Автор

I'm c64 guy, and I like this symulator a lot.

denismilic
Автор

I got my programming start in 1988 with a surplus Rockwell AIM 65. I wrote an algorithm to detect engine knock from a knock sensor. It's still in use today in all my ignition timing controllers. The target processor was the MC68SEC811E2FN, which had 2k of securable EEPROM. I had a "Fat Mac" and used Red Ryder to communicate with the 6811 dev system. I eventually ported it to a 9s12C32. I'm still using assembly. I have tried a few times to learn C but always give up.

jselectronics
Автор

Sure looks like visual computer 6502. Looks exactly like what I remember from early 80s. I loved it as a kid learning to program.
Likely found on some pirate board, I don't think I ever saw the retail package.

You had me laughing when you couldn't use assembly. I had no problem reading the hex as you typed it in... decades later and most of the machine code hex values are still available.

lostmyhare
Автор

Wow. Seeing it in action, makes all that learning visual. I gotta have this. 😁

LadyNicola
Автор

That's beautiful. I can imagine this running on a monitor in the background of my office because ... it's beautiful.

LiamDennehy
Автор

Another clue that this may be fairly old is that the second diskette you found ("The 6502 Simulator Monitor Tutorial") appears to include EDASM, which is one of the earliest editor/assembler packages for the Apple II, dating back to 1979. By the mid-80s there were much better assemblers available (Merlin, for example) and I'd imagine any post-80s system would use something that also offered a screen editor, rather than a line editor. (Then again, maybe the Apple II crowd never got into screen editing outside of word processors; Merlin's editor was also a line editor.)

If you want to see a bit more about EDASM, I wrote an article about it a while back: "Going Back to EDASM, the 1980 Apple II Editor/Assembler." It should come up at or near the top of any web search; I don't include the URL here because YouTube seems to quietly kill any comments where I do.

Curt_Sampson
Автор

Wow! I'm impressed. I will use this when I create a new 6502 tutorial.

TechCowboy
Автор

Great video! The size of each file in the catalog is reported in sectors. In DOS 3.3 there are sixteen of them per track and each holds 256 bytes. At 35 tracks per disk that's 143, 360 bytes or 140 kilobytes per disk.

deangarbis