Anyone ever corrected the 6502 mnemonics
- SimonSideburns
- Posts: 405
- Joined: Mon Aug 26, 2013 8:09 pm
- Location: Purbrook, Hampshire
- Contact:
Anyone ever corrected the 6502 mnemonics
My user guide is buried somewhere in the loft at the moment, but from memory, I seem to recall there were numerous errors in the 6502 assembler mnemonic list in the back of the book (one of the Appendices).
Has anyone here ever corrected the list, and has it to hand if so?
I am particularly interested in the undocumented features, and think a quick read of wikipedia might be interesting, unless anyone here has a url to such information.
Thanks.
Has anyone here ever corrected the list, and has it to hand if so?
I am particularly interested in the undocumented features, and think a quick read of wikipedia might be interesting, unless anyone here has a url to such information.
Thanks.
Just remember kids, Beeb spelled backwards is Beeb!
Re: Anyone ever corrected the 6502 mnemonics
Were there? I never noticed, but then I learned the 6502 instruction set from the Advanced User Guide, the User Guide opcode map being rather small and hidden.SimonSideburns wrote:My user guide is buried somewhere in the loft at the moment, but from memory, I seem to recall there were numerous errors in the 6502 assembler mnemonic list in the back of the book (one of the Appendices).
Something like this: http://mdfs.net/Docs/Comp/6502/OpList and other stuff at http://mdfs.net/Docs/Comp/6502?SimonSideburns wrote:I am particularly interested in the undocumented features, and think a quick read of wikipedia might be interesting, unless anyone here has a url to such information.
Code: Select all
$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_
- SimonSideburns
- Posts: 405
- Joined: Mon Aug 26, 2013 8:09 pm
- Location: Purbrook, Hampshire
- Contact:
Re: Anyone ever corrected the 6502 mnemonics
Can't remember off hand what exactly but a few of the opcodes had the same number but different mnemonics.
Very confusing, and hard (at the time) to know what was right or wrong.
Be interesting to find a scan of that table to see.
Very confusing, and hard (at the time) to know what was right or wrong.
Be interesting to find a scan of that table to see.
Just remember kids, Beeb spelled backwards is Beeb!
Re: Anyone ever corrected the 6502 mnemonics
Do you mean things like INC A which can also be assembled as INA? That was on the '12 and later not the '02.SimonSideburns wrote:Can't remember off hand what exactly but a few of the opcodes had the same number but different mnemonics.
Page 514-515 of http://bbc.nvg.org/doc/BBCUserGuide-1.00.pdf has the User Guide 6502 Instruction set, but I can't see any errors or duplicates in it.
Code: Select all
$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_
- SimonSideburns
- Posts: 405
- Joined: Mon Aug 26, 2013 8:09 pm
- Location: Purbrook, Hampshire
- Contact:
Re: Anyone ever corrected the 6502 mnemonics
Has anyone got a better scan of the two pages? I'll have to climb in to the loft and try to rescue mine otherwise.
Maybe there are different versions or revisions of the manual, earlier ones with these mistakes, later ones without?
I distinctly recall the same two digit hex opcode on the list twice on at least two occasions. I'm sure I've got them annotated in biro on my copy.
The reason I noticed was that originally I was going to try writing a 6502 emulator (documented opcodes only) in some PC language (probably in Turbo Pascal or similar) a good few years ago now. It wouldn't have needed to be perfect timing, etc., just wanted to try to write 6502 assembly and have it 'execute'.
It never got off the ground, but while entering the codes into a chart I found duplicates.
Maybe there are different versions or revisions of the manual, earlier ones with these mistakes, later ones without?
I distinctly recall the same two digit hex opcode on the list twice on at least two occasions. I'm sure I've got them annotated in biro on my copy.
The reason I noticed was that originally I was going to try writing a 6502 emulator (documented opcodes only) in some PC language (probably in Turbo Pascal or similar) a good few years ago now. It wouldn't have needed to be perfect timing, etc., just wanted to try to write 6502 assembly and have it 'execute'.
It never got off the ground, but while entering the codes into a chart I found duplicates.
Just remember kids, Beeb spelled backwards is Beeb!
Re: Anyone ever corrected the 6502 mnemonics
I'm not aware of any documented dupes.
A good instruction set reference can be found at http://www.llx.com/~nparker/a2/opcodes.html
The only thing I can think of is different assemblers using
differing mnemonics for some reason.
PowerPC manuals I have, on the other hand, are littered with
synonyms in the instruction set.
A good instruction set reference can be found at http://www.llx.com/~nparker/a2/opcodes.html
The only thing I can think of is different assemblers using
differing mnemonics for some reason.
PowerPC manuals I have, on the other hand, are littered with
synonyms in the instruction set.
Re: Anyone ever corrected the 6502 mnemonics
I first learned the 6502 instructions set from the MOS 65xx Hardware and Software manuals (both available on http://www.6502.org along with data sheets for some of the CMOS variants which do not all have the same instructions extensions).
I can't remember ever comming across mnemonic "mistakes" as such, but certainly "variations". Largely these variations have been to save either typing or make writing assemblers easier. The typical example being INA instead of INC A. Two less keypresses and, from an assembler parsing perspective, no operand to decode.
I most often came across "non-standard" mnemonics with assemblers which for some reason couldn't handle the arguably more complex lines to parse such as:
LDA #<SCREEN
STA PNTR+5
LDA #>SCREEN
STA PNTR+6
LOOP LDA (PNTR+5),Y
ADC #'9'
INC A - As JGH mentioned not on the 6502
so the author would invent their own mnemonic to make it easier.
Where I have came across mistakes, particularly in the older printed material, they have been incorrect opcodes in the instruction/opcode "magic square".
I can't remember ever comming across mnemonic "mistakes" as such, but certainly "variations". Largely these variations have been to save either typing or make writing assemblers easier. The typical example being INA instead of INC A. Two less keypresses and, from an assembler parsing perspective, no operand to decode.
I most often came across "non-standard" mnemonics with assemblers which for some reason couldn't handle the arguably more complex lines to parse such as:
LDA #<SCREEN
STA PNTR+5
LDA #>SCREEN
STA PNTR+6
LOOP LDA (PNTR+5),Y
ADC #'9'
INC A - As JGH mentioned not on the 6502
so the author would invent their own mnemonic to make it easier.
Where I have came across mistakes, particularly in the older printed material, they have been incorrect opcodes in the instruction/opcode "magic square".
Last edited by george.h on Tue May 13, 2014 12:59 pm, edited 1 time in total.
Pic Caption: "One day son, this will all be yours..."
- richardtoohey
- Posts: 3720
- Joined: Thu Dec 29, 2011 5:13 am
- Location: Tauranga, New Zealand
- Contact:
Re: Anyone ever corrected the 6502 mnemonics
I've got various versions of the manuals so will have a look if I remember ... but my scanner has died, so can't scan right now.SimonSideburns wrote:Maybe there are different versions or revisions of the manual, earlier ones with these mistakes, later ones without?

Re: Anyone ever corrected the 6502 mnemonics
There's a couple of mistakes in the New Advanced User Manual in the machine code reference (amongst others):
p33 AND absolute &0E &2D
p35 BBR zeropage 2 3 bytes
p36 BBS zeropage 2 3 bytes
p45 BRK B flag not affected, but set in stacked value
p33 AND absolute &0E &2D
p35 BBR zeropage 2 3 bytes
p36 BBS zeropage 2 3 bytes
p45 BRK B flag not affected, but set in stacked value
Code: Select all
$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_
- SimonSideburns
- Posts: 405
- Joined: Mon Aug 26, 2013 8:09 pm
- Location: Purbrook, Hampshire
- Contact:
Re: Anyone ever corrected the 6502 mnemonics
Have finally had a good rummage and have found my old decrepit user guide, and even though the whole index at the back is missing, presumed dead, the 6502 instruction set was still there, albeit loose.
The mistakes are as follows:
Both ROL (zero page X) and SEC (implied) are listed as opcode &36.
STY (absolute) and JMP (indirect) are listed as opcode &8C.
Not quite the 'many errors' I was trying to remember, but still wrong, nonetheless.
Now I've just got to find out what the correct opcodes are. On my page the JMP instruction has had &6C written by the side of the wrong opcode, so I guess that's one that is already done.
EDIT: On a guide linked to in this thread, the SEC command is &38 and ROL is &36.
The mistakes are as follows:
Both ROL (zero page X) and SEC (implied) are listed as opcode &36.
STY (absolute) and JMP (indirect) are listed as opcode &8C.
Not quite the 'many errors' I was trying to remember, but still wrong, nonetheless.
Now I've just got to find out what the correct opcodes are. On my page the JMP instruction has had &6C written by the side of the wrong opcode, so I guess that's one that is already done.
EDIT: On a guide linked to in this thread, the SEC command is &38 and ROL is &36.
Just remember kids, Beeb spelled backwards is Beeb!
Re: Anyone ever corrected the 6502 mnemonics
My memory is not a bad as I thought - I actually remembered $6C as the opcode for JMP (indirect). But then I started off doing 6502 on a PET entering everything by hand in hex using a version of TIM loaded from tape!


Pic Caption: "One day son, this will all be yours..."