The 6502 in "The Terminator"

In the first Terminator movie, the audience sees the world from the T-800’s view several times. It is well-known that in two instances, there is 6502 assembly code on the T-800’s HUD, and many sites have analyzed the contents: It’s Apple-II code taken from Nibble Magazine. Here are HD versions of the shots, thanks to Dominik Wagner:

This is the first assembly snippet:


This is the second assembly snippet:


There are some assembly equates:


On the left, these are the assembled opcodes of the second assembly listing, reaching from “LDY#10” to “SEC”. On the right, there is output of a run of the checksum application Key Perfect on a file names “OVLY.OBJ”, which prints a 16 bit checksum for every 0x50 bytes:



62 thoughts on “The 6502 in "The Terminator"”

    • What does “Program Check is : 0502” in the last two pics mean? Is that the time, 5:02 AM? I’m trying to pin down John Connor’s date of conception. It was either the night of 5-13-1984 or before sunrise on 5-14-1984.

      • Not a time, but a checksum number.
        Basically Key Perfect was a way to verify the code you typed was correct without having to check each line or byte of machine code. It would read through the code you wrote, apply its algorithm over it, and the result would be a number (0502 in the terminator example). Then you would verify that number matched with the number given in the magazine (or other source) the source code came from. If it matched, you were good to go, if not, you’d have to go back through your code to find your mistake(s).

    • The 6502 was a MOS technology product, not Apple. It was just a relatively cheap off the shelf CPU.

      Infact if memory serves the Apple 1 was actually designed to optionally use either a 6502 or Motorola 6800.

  1. I remember noticing that back in the early 90’s when I first saw the movie (and that was on a cheap PAL version). At that time I was learning C64 assembly and I immediately recognized all the LDA’s and LDX’s :)

    I forgot about it until today…

  2. Hilarious, although very romantic.

    6502 code on T-800 HUDs definitively beats other famous Hollywood stereotypes introduced in War Games like the sound made by chars being printed to low-bandwidth terms, blinking lights on the WOPR, etc.

    Back to Terminator, I wonder what is displayed on more advanced Ts like the T-888 seen in the Chronicles series, or the T-1000!

    Ed.

  3. This is precisely why the robots became self-aware. You can’t be giving the robots access to their own source code — of course they’re going to look at it and start modifying it to suit their own needs.

    At the very least, the developers should have removed the comments and obfuscated it. Its just common sense.

  4. @Eldito probably perl, if a real programmer built the 880.

    Ruby if it was an elitist web developer.

  5. Thank you for this. Where would we be without the old 6502 in the Apple ][, Commodore 64, VIC20 and PET? It’s a bastard cousin of the 6800 and the 6809 was to be the heart of the Macintosh, but by the time they fished the damn thing (four years later), they went with the awesome 68000 chip. So did the Amiga. Damn Atari and Microsoft/Intel to hell for blowing up the universe and costing us 20 years of suffering with their Indian software-knock-off of the Amiga and dirty tricks to keep us pinned down editing CONFIG.SYS until they could kill DIGITAL, steal the VMS guys and rip-off the plans for the Alpha chip to build the Pentium. Fuckers. Ok, going back to my happy place of the 6502…now I’m thinking about its predecessor the RCA 1802…thank you for making my day. Time for my nappy poo.

  6. Funny. This is from the same genre of the big panels, full of blinking buttons in sci-fi movies. Or the sounds coming from the computer after each keystroke. Just a dumb effect to fool the layman. This is the perfect example of the motto: “Movies are to entertain, not to teach”.

  7. Why does the HUD need to include a compass? Shouldn’t that be built in and the direction already known by the cyborg. Does it really need to look at a HUD to see that? I guess the same goes for the code.

  8. @Peter Balogh, I do praise the Atari 400/800 which were among Jay Miner’s final custom chips efforts before turning to the gorgeous Amiga. It is the AtariST (and later) that I despise as filth. Why? Back in those days, it took 4 years to fabricate a new chip. Amiga Inc. had formed (with Jay Miner, Dale Luck, RJ Michael and others) to do just that. After years of baking, the Amiga appeared. 40 year old Commodore Business Machines moved in to buy it, but before it could happen, a fight broke out between the CEO and the Chairman who had just gained control of the company. The CEO of 40 yers quit and tried to buy Amiga Inc. on his own, in a new company. The Chairman of Commodore objected and completed the purchase of Amiga Inc. The new company that the former CEO of Commodore had founded knew it was DOOMED because it didn’t have 4 long years of 22 hour days to recreate the chipset. So what did it do? It put together a turkey which did what the Amiga did in software (instead of hardware), so it ran like 1000x slower and was a dog –and he priced it like a Commodore 64 (sweat spot) –way way below the price of an Amiga (because he didn’t have the extra cost of the hardware chips on his Bill of Materials and because he was using cheap Indian laborers in America). So what did he decide to call this new piece of crap? Being a million years old, he did not realize the name was tainted to forever be associated with VIDEO GAMES and he, in fact, reportedly paid $45K to buy the name “Atari”, which had obviously gone defunct after Jay Miner took off years earlier. Then he marketed his low-cost piece of crap as an Atari ST for years up against the Amiga. The public began to think of the Amiga and Atari as being similar products and somehow associated with video GAMES, thus destroying the credibility of the Amiga in business –leaving the door wide open for the vastly inferior Macintosh and eventually Windows products. In the end, Amiga and Commodore will killed with Bill Gates lamenting at how he had been wise enough to steer clear of that disaster (by not supporting it with Office and BASIC as he did the early Macs). Jay Miner, seeing his life’s work go up in smoke over a slow motion decade, died a little while later of kidney problems, he was 62 –Windows 3.11 (the first “real” Windows) was 2. The CEO of the “new” Atari, a holocaust survivor, retired and the last I heard, he let his two boys run what was left of the company. Meanwhile at Apple, they had fired Steve Jobs and the French idiots who took over R&D basically had an Amiga 1000 in the basement they were surgically dissecting and running upstairs every few days to proclaim their new “inventions” —such as QuickDrawGX (aka Amiga GfxBase), AppleScript!! (aka ARexx), PlainTalk!! (aka Amiga Speech Synthesizer), nuBus!! (ZorroBus!) and the list goes on and on. Those maggots got theirs when CALPERS fired the Pepsi Drinker, the Board who put him there and the French Guys, brought in real dudes from Rockwell and the Navy/DOD who quickly realized they needed to buy Steve Jobs back…and the rest his history. Only one part I’m leaving out. WE ALL LOST 15 YEARS OF OUR LIVES! Even if you were not into Tech, how much of your life was spent editing CONFIG.SYS and AUTOEXEC.BAT or dealing with crappy DOS programs while your kids grew up without an Internet and all the great things that came from multimedia-computers with a graphical user interface. I’m sure it all makes perfect sense to the man who saw his family murdered by the Nazis as a small boy, but it was just wrong. Ok, well going back to my happy place now. Remember, you asked!

    • Man you must have had the same history as me!!! Programmed on VMS alphas, had an Amiga thought it was brilliant and cursed DOS everyday when I started programming Win 2 lol.

  9. The 6502 assembly listing is actually the Apple ][ DOS 3.3 listing! It was quite funny the first time I saw Terminator on the opening day! Likely I was one of the very few in the theater anywhere that day who could read that display and know what it said! It did take me out of the movie experience for a moment though… but hey, if the terminator had a 6502 that’s cool.

    I’m of course a brain with 6502 encoded in my dna strands. Naturally during the construction of Gemstone Warrior and Gemstone Healer video games I disassembled the entire Apple DOS eventually chopping away most of it including the sections that the terminator kept – they were just too slow. I gather the terminator evolved in the later movies.

    Funny that I’m studying the AMD64 architecture in detail again today and come across this article. I was just going to post a similar one on my blog… you beat me to it…

    Anyway, here’s to Apple DOS 3.3! Here’s to the terminator and their cheesy effects!

    Maybe I’ll did my Apple ][ out and find the listing! That would be way cool for a blog post!

  10. Pingback: Appleslices IIe
  11. @vaxboy: Very much appreciate your play-by-play of the home computer evolution… I grew up in Europe blissfully ignorant (what kid isn’t) of happenings behind the scenes so I enjoy this sort of commentary and connecting the dots. For the record I started with ZX Spectrums and a bunch of other 8-bit kit computers and then moved to the Atari ST family. But in my heart I always knew Amigas were heads and shoulders above, just never could afford one ;)

  12. So it looks like the Futurama gag with Bender and the 6502 went deeper than I thought… “Want me to precludify him, like some kind of dispatcherator?”

  13. is what is that log-log plot in lower left corner on one of the screens. Looks interesting.

  14. Folks, thanks very much for the threading of real-life, movies, the firts computer we grew up with, and all the funnies.

    I grew up with ][+, i could mental-assemble and dis-assemble code.

    it was awesome.

  15. The Terminator movie is made in 1984, and in that time the CBM Commodore 64 and Commodore Plus 4 home computers already were on their world conquest. These long time hit machines were based on a 6510 CPU, which is a bigger brother of 6502. And the codes I see COULD have been made for these, too. Just to mention.

    We mustn’t forget that the mnemonics are strictly compiler dependent, so the machine code can be the really decisive fact, but that looks all right for me, for the first sight. Anyway, this childlike movie trick is always funny indeed.

    • But the code specifically references features of the Apple //e. AUXMOVE and the address it lives at in a //e’s hardware for one. This also means the T-800 has 128k of RAM! :)

  16. Some answers to questions raised here.

    1. Terminators do not need or use the HUD. It is a diagnostic output for humans, who need to debug terminator software. It was used by Cyberdine prior to Skynet takeover.
    2. T-888 has a more advanced HUD. Technically T-888 is a slightly updated firmware and different hardware.
    3. T-1000 does not have a HUD because it is not made from electronic components. Technically it does not need even to move his head or eyeballs because he “sees” like a fish: 360 degrees in all directions.
    4. Compass ? yes, Terminators have those built-in for navigation, as well as military GPS navigation and cellular modems. They have a database of codes that allow them to use any career for free for data connection.

  17. When I saw the movie, I too noticed the assembly language code which scrolled on the screen when showing a Terminators POV but, because I was a TRS-80 Color Computer geek, and just a dabbler in assembly language, thought it was 6809 assembly code. The 6502 and 6809 are quite similar in instruction set… Just my 2 cents!

    Alfredo Santos (Author of the “CoCo Chronicles”

  18. bbegin LDx -05
    loop lda c030 ;apple2 speaker toggle
    dex
    nop ;2us delay
    nop ; 2 us delay
    nop ;2us delay
    bne loop
    ldx c059 ;toggle annuciator output (can’t remember why)
    jmp bbegin

    yes i remember coding a nasty tone on the apple 2 spkr to annoy the teacher (learning applesoft basic in 84)

  19. It might not be 6502. From the source, it could have been a Ricoh 2A03 so sound and controller input at the price of NO BCD commands (never used them in a game).

  20. Could be worse. Television shows of the time would show their grasp of BASIC. It was actually funny to note when the characters looked at a screen and we got to see…

    10 PRINT “ABC Corporation. 123 East West Street, Nowhere, USA 12345”
    20 PRINT “Aardvark Company. 456 West East…

    It would have worked…had the knowledge of using the command RUN been known when filming, instead of just the command LIST.

    Which makes showing Apple II assembly code a far cooler ‘insider secret’.

    And from the franchise’s perspective, Cybernet took over Human created machines. And was quite lazy about doing anything more then the bare minimum of requirements. So…programmer comments being left in the code makes a lot of sense. Just like having massive machines on the battle lines…that use marker lights.

  21. Long ago, Ed wrote: “Hollywood stereotypes introduced in War Games like the sound made by chars being printed to low-bandwidth terms”

    I don’t recall off hand what that sounded like, and I’m not going to look it up. But the storage tube CRT of the Tektronix 4051 graphics terminal actually did make faint high-pitched sounds when the screen was written to. (You might need the ears of a child under ten to actually hear it.)

  22. The VTOC listing is from the RAM Disk 64 program NEWRAM, published in Nibble September 1984 and Nibble Express V (p. 170) and available on Stavros disk NIB21B.

    The INSTALL/LOOP listing appears to be from MON.E, published in Nibble August 1984 and available on Stavros disk NIB21B (the object code on the screen matches the disk file).

    The OVLY.OBJ checksum listing almost matches that produced by Key Perfect 5.0 for OVLY.OBJ published in Nibble April 1984 (possibly the article “Managing Applesoft Overlays”) and available on Stavros disk NIB19B.

    I don’t know where the equates are from; maybe someone with a stack of magazines or the $90 DVD-ROM can dig around.

  23. My brother and I used to buy Nibble magazine from Waldenbooks at the Eastfield Mall in Springfield Mass.

    When we went to see Terminator at the dollar theater we immediately recognized the Key Perfect code from the magazine. That was a long time ago :-)

  24. I remember watching that movie for the first time and yelling OMG OMG OMG I know what that is! But then I had to ask why would the Terminator have assembly language in his HUD (why would the Terminator have HUD)? And the thought struck me: he’s actually writing the code on the fly and programming his subsystems like his arms and legs.

    Obviously 6502 would be an economical choice for all the microcontrollers that a T-800 requires to operate.

    And the awesome thing is: he actually COMMENTS his code as he’s writing it. If we could get more humans to do the same, the world would be a better place.

Leave a Reply to Jacek Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.