Anyone ever corrected the 6502 mnemonics

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
Post Reply
User avatar
SimonSideburns
Posts: 405
Joined: Mon Aug 26, 2013 8:09 pm
Location: Purbrook, Hampshire
Contact:

Anyone ever corrected the 6502 mnemonics

Post by SimonSideburns » Sat May 10, 2014 6:17 pm

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.
Just remember kids, Beeb spelled backwards is Beeb!

User avatar
jgharston
Posts: 3755
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: Anyone ever corrected the 6502 mnemonics

Post by jgharston » Sat May 10, 2014 9:07 pm

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).
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: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.
Something like this: http://mdfs.net/Docs/Comp/6502/OpList and other stuff at http://mdfs.net/Docs/Comp/6502?

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
SimonSideburns
Posts: 405
Joined: Mon Aug 26, 2013 8:09 pm
Location: Purbrook, Hampshire
Contact:

Re: Anyone ever corrected the 6502 mnemonics

Post by SimonSideburns » Sun May 11, 2014 2:15 pm

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.
Just remember kids, Beeb spelled backwards is Beeb!

User avatar
jgharston
Posts: 3755
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: Anyone ever corrected the 6502 mnemonics

Post by jgharston » Sun May 11, 2014 7:25 pm

SimonSideburns wrote:Can't remember off hand what exactly but a few of the opcodes had the same number but different 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.

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
>_

User avatar
SimonSideburns
Posts: 405
Joined: Mon Aug 26, 2013 8:09 pm
Location: Purbrook, Hampshire
Contact:

Re: Anyone ever corrected the 6502 mnemonics

Post by SimonSideburns » Sun May 11, 2014 10:35 pm

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.
Just remember kids, Beeb spelled backwards is Beeb!

User avatar
flynnjs
Posts: 828
Joined: Tue Jul 06, 2010 9:33 pm
Contact:

Re: Anyone ever corrected the 6502 mnemonics

Post by flynnjs » Mon May 12, 2014 10:49 pm

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.

User avatar
george.h
Posts: 1030
Joined: Wed Apr 13, 2011 5:32 pm
Location: Chelmsford Essex
Contact:

Re: Anyone ever corrected the 6502 mnemonics

Post by george.h » Tue May 13, 2014 10:46 am

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".
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..."

User avatar
richardtoohey
Posts: 3720
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: Anyone ever corrected the 6502 mnemonics

Post by richardtoohey » Tue May 13, 2014 10:51 am

SimonSideburns wrote:Maybe there are different versions or revisions of the manual, earlier ones with these mistakes, later ones without?
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. :(

User avatar
jgharston
Posts: 3755
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: Anyone ever corrected the 6502 mnemonics

Post by jgharston » Tue May 13, 2014 2:49 pm

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

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
SimonSideburns
Posts: 405
Joined: Mon Aug 26, 2013 8:09 pm
Location: Purbrook, Hampshire
Contact:

Re: Anyone ever corrected the 6502 mnemonics

Post by SimonSideburns » Wed Aug 06, 2014 9:46 am

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.
Just remember kids, Beeb spelled backwards is Beeb!

User avatar
george.h
Posts: 1030
Joined: Wed Apr 13, 2011 5:32 pm
Location: Chelmsford Essex
Contact:

Re: Anyone ever corrected the 6502 mnemonics

Post by george.h » Wed Aug 06, 2014 11:03 am

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!

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

Post Reply