Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Commodore 64
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== CPU and memory === [[File:C64 Block Diagram new.svg|thumb|alt=See caption|Block diagram of the C64]] {{Main|MOS Technology 6510}} The C64 uses an [[8-bit computing|8-bit]] [[MOS Technology 6510]] [[microprocessor]] that is almost identical to the [[MOS Technology 6502|6502]] but has [[three-state bus]]es, a different [[pinout]], slightly different [[clock signal]]s and other minor changes for this application. It also has six I/O lines on otherwise-unused legs on the 40-pin IC package. These are used for two purposes in the C64: to [[Bank switching|bank-switch]] the machine's [[read-only memory]] (ROM) in and out of the processor's address space, and to operate the [[Commodore Datasette|datasette]] tape recorder. The C64 has {{val|64|u=KB}} of 8-bit-wide dynamic [[random-access memory|RAM]], {{val|1|u=KB}} of 4-bit-wide static color RAM for text mode, and {{val|38|u=KB}} are available to built-in [[Commodore BASIC]] 2.0 on startup. There is {{val|20|u=KB}} of ROM, made up of the BASIC interpreter, the [[KERNAL]], and the character ROM. Because the processor can only address {{val|64|u=KB}} at a time, the ROM was mapped into memory and only {{val|38911 |u=bytes}} of RAM (plus {{val|4|u=KB}} between the ROMs) were available at startup. Most "[[breadbin]]" Commodore 64s used 4164 DRAM with eight chips totaling 64K of system RAM. Later models, featuring Assy 250466 and Assy 250469 [[motherboard]]s, used 41464 DRAM (64KΓ4) chips which stored {{val|32|u=KB}} per chip (so only two were required). Because 4164 DRAMs are 64KΓ1, eight chips are needed to make an entire byte; the computer will not function without all of them present. The first chip contains Bit 0 for the memory space, the second chip contains Bit 1, and so forth. The C64 performs a RAM test on power-up and if a RAM error is detected, the amount of free BASIC memory will be lower than the normal 38,911. If the faulty chip is in lower memory, then an <code>?OUT OF MEMORY IN 0</code> error is displayed rather than the usual BASIC startup banner. The C64 uses a complicated memory-banking scheme; the normal power-on default is the BASIC ROM mapped in at {{mono|$A000}}-{{mono|$BFFF}}, and the screen editor (KERNAL) ROM at {{mono|$E000}}β{{mono|$FFFF}}. RAM under the system ROMs can be written to, but not read back, without swapping out the ROMs. Memory location {{mono|$01}} contains a register with control bits for enabling or disabling the system ROMs and the I/O area at {{mono|$D000}}. If the KERNAL ROM is swapped out, BASIC will be removed at the same time.{{r|prg|p=264}}<ref>{{cite book|title=Mapping the Commodore 64 and 64C|isbn=0-87455-082-3|last=Leemon|first=Sheldon|year=1987|publisher=COMPUTE! Publications|page=[https://archive.org/details/Compute_s_Mapping_the_64_and_64C/page/4 4]|url=https://archive.org/details/Compute_s_Mapping_the_64_and_64C/page/4}}</ref> BASIC is not active without the KERNAL; BASIC often calls KERNAL routines, and part of the ROM code for BASIC is in the KERNAL ROM. The character ROM is normally invisible to the CPU. The character ROM may be mapped into {{mono|$D000}}β{{mono|$DFFF}}, where it is then visible to the CPU. Because doing so necessitates swapping out the I/O registers, interrupts must first be disabled. By removing I/O from the memory map, {{mono|$D000}}β{{mono|$DFFF}} becomes free RAM. C64 cartridges map into assigned ranges in the CPU's address space. The most common cartridge auto-starting requires a [[String (computer science)|string]] at {{mono|$8000}} which contains "{{mono|CBM80}}" followed by the address where program execution begins. A few C64 cartridges released in 1982 use Ultimax mode (or MAX mode), a leftover feature of the unsuccessful MAX Machine. These cartridges map into {{mono|$F000}} and displace the KERNAL ROM. If Ultimax mode is used, the programmer will have to provide code for handling system interrupts. The cartridge port has 16 [[address line]]s, which grants access to the computer's entire address space if needed. Disk and tape software normally load at the start of BASIC memory ($0801), and use a small BASIC stub (such as <code>10 SYS(2064)</code>) to jump to the start of the program. Although no Commodore 8-bit machine except the C128 can automatically boot from a floppy disk, some software intentionally overwrites certain BASIC vectors in the process of loading so execution begins automatically (instead of requiring the user to type RUN at the BASIC prompt after loading). About 300 cartridges were released for the C64, primarily during the machine's first {{frac|2|1|2}} years on the market, after which most software outgrew the {{val|16|u=KB}} cartridge limit. Larger software companies, such as [[Ocean Software]], began releasing games on bank-switched cartridges to overcome the {{val|16|u=KB}} cartridge limit during the C64's final years. Commodore did not include a reset button on its computers until the CBM-II line, but third-party cartridges had a reset button. A [[Reboot#Cold versus warm reboot|soft reset]] can be triggered by jumping to the CPU reset routine at {{mono|$FCE2}} (64738). A few programs use this as an [[exit (command)|exit]] feature, although it does not clear memory. The KERNAL ROM underwent three revisions, mainly designed to fix bugs. The initial version is only found on 326298 motherboards (used in the first production models), and cannot detect whether an NTSC or PAL VIC-II is present. The second revision is found on all C64s made from late 1982 through 1985. The final KERNAL ROM revision was introduced on the 250466 motherboard (late breadbin models with 41464 RAM), and is found in all C64Cs. The 6510 CPU is clocked at {{val|1.023|u=MHz}} (NTSC) and {{val|0.985|u=MHz}} (PAL),<ref>{{cite web|url=http://www.eurogamer.net/articles/digitalfoundry-face-off-zx-spectrum-vs-commodore-64|title=Face-Off: ZX Spectrum vs. Commodore 64|first=Richard|last=Leadbetter|date=April 29, 2012|website=Eurogamer}}</ref> lower than some competing systems; the Atari 800, for example, is clocked at {{val|1.79|u=MHz}}). Performance can be boosted slightly by disabling the VIC-II's video output via a register write. This feature is often used by tape and disk [[fast loader]]s and the KERNAL cassette routine to keep a standard CPU cycle timing not modified by the VIC-II's sharing of the bus. The restore key is gated directly to the CPU's [[non-maskable interrupt|NMI]] line, and will generate an NMI if pressed. The KERNAL handler for the NMI checks if run/stop is also pressed; if not, it ignores the NMI and exits. Run/stop-restore is normally a soft reset in BASIC which restores all I/O registers to their power-on default state, but does not clear memory or reset pointers; any BASIC programs in memory will be left untouched. [[Machine code|Machine-language software]] usually disables run/stop-restore by remapping the NMI vector to a dummy [[Run-time infrastructure (simulation)|RTI]] instruction. The NMI can also be used for an extra interrupt thread by programs, but risks a system lockup or other undesirable side effects if the restore key is accidentally pressed (which activates the NMI thread).
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Commodore 64
(section)
Add topic