6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri May 03, 2024 8:14 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Fri Aug 09, 2013 9:27 pm 
Offline

Joined: Fri Aug 09, 2013 9:20 pm
Posts: 2
Location: Providence, Rhode Island
Hi folks. I just joined! I've been playing on my Apple II in both LISA and S-C Macro Assembler and they both don't recognize "ASL A" as an instruction. They do recognize just "ASL" which I checked gets assembled to they same opcode for "ASL A" which is $0A. Is this just a non-standard assembly syntax?

Thanks, Gabe Read


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 09, 2013 10:00 pm 
Offline
User avatar

Joined: Mon Apr 23, 2012 12:28 am
Posts: 760
Location: Huntsville, AL
The Kingswood A65 assembler (Windows) expects the operand, A, to be included. Before I started using it, I expected that the opcode would not require the operand register to be specified because all opcodes in that row of the instruction table are implicit operand instructions.

There's only general agreement on the mnemonics for the opcodes, but the syntax across the various assemblers is not standardized.

_________________
Michael A.


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 10, 2013 3:00 am 
Offline

Joined: Sun Nov 08, 2009 1:56 am
Posts: 387
Location: Minnesota
Assemblers vary - some require the 'A', some refuse it, and some accept either variant. Requiring the 'A' is the 'official' syntax (ie., the one documented by the creators of the 6502), IIRC.


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 10, 2013 4:52 am 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
Until I did some research when I wrote my assembler, I didn't even know the A was considered required by some.

For the record, my assembler won't take it, it just wants ASL.


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 10, 2013 9:01 am 
Offline

Joined: Sat Jul 28, 2012 11:41 am
Posts: 442
Location: Wiesbaden, Germany
The programming reference manual shows the immediate accumulator opcodes with the accumulator operand (ASL A). I think it's better then without operand as it makes the assembler cough when you just forgot the operand address on the other addressing modes.

_________________
6502 sources on GitHub: https://github.com/Klaus2m5


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 11, 2013 2:19 am 
Offline

Joined: Fri Aug 09, 2013 9:20 pm
Posts: 2
Location: Providence, Rhode Island
Thanks guys.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 15, 2013 4:56 pm 
Offline

Joined: Sun Sep 15, 2002 10:42 pm
Posts: 214
The three 6502 assemblers I remember on the Apple II:

S-C Macro Assembler
Merlin Pro
Merlin-16

did not require the A operand. I think it was pretty standard on the Apple II assemblers.
The FASM 6502 assembler I wrote (which is in the archives) does not require the A operand either.

The 2500AD 6502 cross-assembler for MS-DOS and the assembler packaged with the Super Nintendo development system required the A operand, if I remember correctly.

Toshi


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 22, 2013 7:13 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8172
Location: Midwestern USA
TMorita wrote:
The 2500AD 6502 cross-assembler for MS-DOS and the assembler packaged with the Super Nintendo development system required the A operand, if I remember correctly.

As do both of Commodore's assembler packages (MADS and DevPak). DevPak prohibits the use of the letter A as a symbol or label. I don't recall anymore if that is true of MADS, but I suspect that is so.

A bit of history: quite a few years ago (about 25, to be exact) I had the pleasure of eating lunch with the late Jim Butterfield while at a Commodore lovefest and naturally, we got into a discussion about assembly language. Somehow the topic of A operands came up. Sir Jim said that when MOS Technology created the assembly language syntax, which requires an A operand for implied accumulator operations, the decision was made that if an instruction mnemonic, e.g., ROR, could be applied to memory or accumulator it had to have an operand. He went on to say that it was easier to parse such an instruction if an operand was required in all cases—most likely true with the limited machine resources available to an assembler in the 1970s. Therefore, the syntax was formalized that way. We can probably blame Chuck Peddle for it, since most of the 6502 assembly language structure was "borrowed" from 6800 assembly language, with which, of course, he was intimately acquainted.

When I wrote the assembler for my POC firmware I didn't have to be concerned with ROR A vs. ROR, since only numeric operands are accepted. As a consequence, ROR A assembles as ROR $0A ($66 $0A), whereas ROR assembles as ROR ($6A). Having been accustomed to the official MOS syntax for some 35 years, I occasionally reflexively type ROR A and thereby create a nice bug in the program.

Another interesting note: DEA has often been used as an alias to DEC A in 65C02 assemblers. The Kowalski simulator's assembler only recognizes DEA. DEC A would be interpreted as a R-M-W operation on a location defined by the symbol A. It seems to me that the original syntax should have used DEA in place of DEC A, only because we have DEX and DEY, as well as INX and INY—logically then, INC A should be INA.

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


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 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:  
cron