List All Pages
This page contains links to various articles folks would like to write. Topics can be on much of anything you like, provided it has some relevance to 6502 or 65816 programming. Articles by Samuel...
Blitter Theory, Part 1 For the past couple of days, I've been wanting to write some code that renders proportionally-spaced fonts to the screen. Not only does it need to support normal rendering,...
Please change this page according to your needs
datasheets software
Errors in the latest (June 18, 2009) datasheet from WDC: p. 52, sections 7.2.1 and 7.2.2 Clarification: the last sentence of section 7.2.1 and (all of) section 7.2.2 regarding emulation mode are...
FIG-Forth
Bugs in 6502 FIG-Forth: U/ (a.k.a. UM/MOD in ANS Forth) U/ divides a 32-bit unsigned integer dividend by a 16-bit unsigned integer divisor to produce a 16-bit unsigned integer quotient and a...
If you are allowed to edit pages in this Site, simply click on edit button at the bottom of the page. This will open an editor with a toolbar pallette with options. To create a link to a new page,...
Please change this page according to your policy (configure first using Site Manager) and remove this note. Who can join? You can write here who can become a member of this site. Join! So you...
Use this page to explore the effects of various wiki markup tags without polluting existing content. Be sure to clean up when you're done though, to prevent a monsterously huge page!
Welcome page What is a Wiki Site? How to edit pages? How to join this site? Site members Recent changes List all pages Page Tags Site Manager Page tags Add a new page edit this panel
Members: Moderators Admins
To facilitate rapid visual searching, please try to keep the bullets alphabetically sorted as a courtesy to the reader. Software Categories 65816 specific code Math Miscellaneous Software...
This page includes software snips that are relevant only to the 65816 — that is, code which is either rediculously hard to do on the 6502, or outright not possible at all. If you're looking for...
; ; This routine fills a block with a value ; ; Uses 65816 native mode ; ; Start with fill value in Accumulator ; fills up to 65,536 locations ; ; This example fills $00FA00 - $00FDE7...
The following 6502 code has several entry points: OUTBYTE PHA LSR LSR LSR LSR JSR OUTHEXDIG PLA OUTNIBBLE AND #$0F OUTHEXDIG CMP...
MVN and MVP are very useful instructions, but they have a few limitations. First, they cannot span banks (i.e. they wrap at bank boundaries). Second, the source and destination banks are immediate...
Background On the 6502, you're limited to a 256 byte direct page in memory $0000-$00FF, which are best treated as a chunk of virtual CPU registers. Then, you had a stack at $0100-$01FF. If you...
Relative JMP abs A BRL is like JMP abs that uses relative instead of absolute addressing. However, BRL takes 4 cycles, whereas JMP abs takes 3 cycles. Relative JSR abs The equivalent of JSR...
DEC, INC, and shifts With 16-bit data (m flag = 0), incrementing or decrementing a pointer or index twice is common. For example: INC LABEL ; 7 cycles for dp, 9 cycles for abs INC LABEL ; 7...
While working on some graphics code for the 65816 processor, I realized that I needed an 8-bit rotation of a binary value. However, neither the 6502 nor 65816 provide such a rotation — the best...
In the following routines, branches must not cross page boundaries! Delay A+constant cycles (subroutine) For A >= 7, a 7 cycle loop subtracts 7 from the accumulator until it is less than 7. The...
Typical 16-bit increment Overflow (incrementing to $0000) sets the Z flag is set (i.e. BEQ branches). ; INC NUML BNE LABEL INC NUMH LABEL Typical 16-bit decrement ;...
Integer Multiplication Integer Division Square root Cube root
This routine takes the cube root of a 24-bit unsigned number and returns the cube root and the remainder. Note that: number = root * root * root + remainder Inputs: NUMH = bits 23-16 of the...
8-bit / 8-bit = 8-bit quotient, 8-bit remainder (unsigned) Inputs: TQ = 8-bit numerator B = 8-bit denominator Outputs: TQ = 8-bit quotient of TQ / B accumulator = remainder of TQ / B ;...
8-bit * 8-bit = 8-bit product (signed or unsigned) Inputs: F = 8-bit integer S = 8-bit integer Output: accumulator = product of F * S ; Note that it is not necessary to initialize the...
Takes the square root of a 16-bit unsigned integer, returning the square root and a remainder. Note that: number = root * root + remainder Similar to (and inspired by) Lee Davison's square root...
On the 65816, when the location of a program is not known until run time, the program can use PER and PHK to determine where it is. On the 6502 and 65C02, the WHEREAMI routine can be used for this...
Western Design Center is the manufacturer of the 65C02, the 65C816, the 65C22, etc. The other distributors (particularly the larger distributors) are good for parts (glue logic, memory, etc.) and...
navigation How to edit pages? List all pages contact
This wiki has been set up to provide a wiki for the members of the 6502.org community. Anyone is welcome to view these pages. However, you must be a member of this wiki to make...
According to Wikipedia, the world largest wiki site: A Wiki ([ˈwiː.kiː] <wee-kee> or [ˈwɪ.kiː] <wick-ey>) is a type of website that allows users to add, remove, or otherwise edit...
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License