6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 3:23 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: ASL opcode 0A
PostPosted: Sat May 31, 2014 5:18 pm 
Offline

Joined: Mon Mar 03, 2014 7:19 pm
Posts: 7
What does the operand 10 do in my example below? I've run the code through the visual6502.org simulator and I can't find the use for this operand. The instruction always just shifts the bits in the accumulator to the left one place no matter what number I have as the operand. I'm sure this is just a simple misunderstanding.

Example:
0A 10

My Resource:
https://sites.google.com/site/6502asemb ... on-set/asl
Addressing Mode Example Explanation Example Opcode Bytes Cycles
Accumulator ASL #10 Arithmetic Shift Left (ASL) operation between $10 (Decimal 16) and the content of the Accumulator 0A 10 2


Top
 Profile  
Reply with quote  
 Post subject: Re: ASL opcode 0A
PostPosted: Sat May 31, 2014 6:52 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
0A is the op code for ASL A, and it has no opperand. It takes a single byte, and two clocks. 10 is the op code for BPL, the next instruction. BPL does use an operand. The page you referenced is clearly in error.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: ASL opcode 0A
PostPosted: Sat May 31, 2014 7:16 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
A couple of tutorials on this site that are probably better (and I would be surprised if Bruce had any errors) are:
NMOS 6502 Opcodes by John Pickens, Updated by Bruce Clark
CMOS 65C02 Opcodes, by Bruce Clark
There are other books linked on the Tutorials and Primers page; but by far the best one, I think, is Programming the 65816, Including the 6502, 65c02, and 65802, by David Eyes and Ron Liechty. It used to be a free download, but now they want $10 for it. It's still very much worth it. The description there does not even begin to do it justice.

Unless you are limited by old hardware like working on the Commodore 64 whose 6510 was never available in CMOS, I definitely recommend using the CMOS 6502 if you're considering building something. It's not just a lower-power version. It has all the NMOS bugs fixed, has more instructions and addressing modes, a lot more bus-driving strength, and other benefits.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: ASL opcode 0A
PostPosted: Sun Jun 01, 2014 1:43 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8505
Location: Midwestern USA
GARTHWILSON wrote:
0A is the op code for ASL A, and it has no op code...

Garth means ASL A doesn't have an operand byte. The value in the accumulator is what is shifted.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject: Re: ASL opcode 0A
PostPosted: Sun Jun 01, 2014 2:23 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
BigDumbDinosaur wrote:
GARTHWILSON wrote:
0A is the op code for ASL A, and it has no op code...

Garth means ASL A doesn't have an operand byte. The value in the accumulator is what is shifted.

Woops, yes, I slipped up. I just fixed it.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: ASL opcode 0A
PostPosted: Sun Jun 01, 2014 3:45 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8505
Location: Midwestern USA
tbehman87 wrote:
What does the operand 10 do in my example below? I've run the code through the visual6502.org simulator and I can't find the use for this operand. The instruction always just shifts the bits in the accumulator to the left one place no matter what number I have as the operand. I'm sure this is just a simple misunderstanding.

Example:
0A 10

My Resource:
https://sites.google.com/site/6502asemb ... on-set/asl
Addressing Mode Example Explanation Example Opcode Bytes Cycles
Accumulator ASL #10 Arithmetic Shift Left (ASL) operation between $10 (Decimal 16) and the content of the Accumulator 0A 10 2

That site also has similar errors for LSR, ROL and ROR. Accumulator mode instructions are always single byte instructions, as the accumulator is the (implied) operand.

Frankly, I would not recommend most of these sites as resources for 65xx information, as they are frequently compiled by people who are not 6502 assembly language experts and often simply repeat errors published at other sites. Your best bet for information of this type is to come here for resources, and as Garth suggested, to get and read the programming manual published by WDC.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject: Re: ASL opcode 0A
PostPosted: Sun Jun 01, 2014 4:05 am 
Offline

Joined: Sat Aug 21, 2010 7:52 am
Posts: 231
Location: Arlington VA
I had not seen this site before. There are links in the leftnav to www.6502.buss.hk which also isn't very good.


Top
 Profile  
Reply with quote  
 Post subject: Re: ASL opcode 0A
PostPosted: Sun Jun 01, 2014 5:18 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
I just realized that's the same site we were talking about at viewtopic.php?f=2&t=2378, and I tried to contact the writer back then (at info@cloudgen.cloudgravity.net) to encourage him to make a few corrections, and never got any answer. Re-reading now what I wrote to him, I have to say it was virtually all worded as good news that the 6502 picture is even much rosier than he thought, with hardly anything negative about it.

tbehman87, it would be better to look elsewhere for info.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: ASL opcode 0A
PostPosted: Mon Jun 02, 2014 5:41 pm 
Offline

Joined: Mon Mar 03, 2014 7:19 pm
Posts: 7
Thanks everyone for the good information. This forum has always been very helpful. I'll be sure to use the suggested resources.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: