6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 9:06 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: ASL with Accumulator??
PostPosted: Thu Aug 04, 2022 8:55 pm 
Offline

Joined: Thu Aug 04, 2022 8:47 pm
Posts: 3
What is the operand for use with ASL when shifting bits in the accumulator?

The Programmers Reference Guide (CBM) shows "ASL A", but there seems to be no way to write the "A" which the C64 Assembler recognizes??

Any help would be appreciated!

Anthony G


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 04, 2022 9:13 pm 
Offline
User avatar

Joined: Tue Jul 17, 2018 9:58 am
Posts: 107
Location: Long Island, NY
Does it recognize just ASL by itself?


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 05, 2022 12:03 am 
Offline

Joined: Thu Jan 21, 2016 7:33 pm
Posts: 282
Location: Placerville, CA
Yeah, some assemblers recognize ASL A, some recognize ASL all by itself, and some allow both. It's a mite annoying.


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 05, 2022 12:09 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
commodorejohn wrote:
Yeah, some assemblers recognize ASL A, some recognize ASL all by itself, and some allow both. It's a mite annoying.

And I think there's even a third option. Don't some assemblers allow ASLA (with no space) for this? That is, make the A part of the mnemonic? Worth a try, anyway! :)

Welcome, Anthony!

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 05, 2022 3:50 am 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
Context should be enough, no?

ASL without an argument should assemble to 0A.

_________________
Bill


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 05, 2022 4:38 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8513
Location: Midwestern USA
AAGDOS wrote:
What is the operand for use with ASL when shifting bits in the accumulator?

The Programmers Reference Guide (CBM) shows "ASL A", but there seems to be no way to write the "A" which the C64 Assembler recognizes??

The official MOS Technology assembly language syntax would be ASL A, with A being one of the reserved assembler symbols—the CBM PRG is correct in its reference. A similar syntax is specified for other accumulator-based instructions, such as LSR, ROL and ROR. WDC has continued this standard in their assembly language specifications for the 65C02 and 65C816. An assembler that exactly follows that standard is a “compliant assembler.”

65xx-family assemblers have often been non-compliant and in some cases, wildly inconsistent. For example, the Kowalski assembler that I use recognizes ASL with no operand as valid syntax to left-shift the accumulator. In that assembler, ASL A would be interpreted as shifting whatever is in location A, and would halt with an error if A hasn’t been defined. Even more inconsistent are the accumulator-based decrement and increment instructions. In a compliant assembler, those would be written as DEC A and INC A, respectively. In the Kowalski assembler assembling code for the 65C02, it would be DEA and INA, respectively. However, when assembling code for the 65C816, it would be DEC and INC, neither with an operand.

Something else that can trip you up is what the assembler recognizes as valid numeric radices. The aforementioned Kowalski assembler, by default, uses @ to present binary numbers, such as @10100101. The MOS Technology standard uses %, such as %10100101. Some other assemblers use a trailing B to indicate binary, such as 10100101B.

The only way to be sure with the assembler you are using is to read the documentation and/or experiment. The Commodore MADS and HDC65 assemblers are fully compliant, so they should recognize an instruction such as ASL A as valid.

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 05, 2022 4:30 pm 
Offline

Joined: Thu Aug 04, 2022 8:47 pm
Posts: 3
To all,

Thank you for the informative information! I struggled with ASLA and ASL A, neither of which were recognized by the C64 Macro Assembler Development System (CBM 1982).- MADS.

I did return to the simple ASL with no Operand, and it worked running Monitor$C000.

.A 033C LDA #$01
.A ASL
.A BRK

I should have tried this sooner!!

Anthony G


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 05, 2022 7:02 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8513
Location: Midwestern USA
AAGDOS wrote:
To all,

Thank you for the informative information! I struggled with ASLA and ASL A, neither of which were recognized by the C64 Macro Assembler Development System (CBM 1982).- MADS.

I did return to the simple ASL with no Operand, and it worked running Monitor$C000.

.A 033C LDA #$01
.A ASL
.A BRK

I should have tried this sooner!!

Anthony G

Historical note: the M/L monitor that is provided with MADS (two monitor versions, actually—one runs at $8000 and the other at $C000) is Jim Butterfield's Supermon 64. Also note that the monitors are not the MADS assembler. The latter is a symbolic macroassembler, whereas the assembler in the M/L monitor is not.

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 05, 2022 7:49 pm 
Offline

Joined: Thu Aug 04, 2022 8:47 pm
Posts: 3
Thanks for the clarification on the M/L monitors. I tend to use the assembler terms interchangeably.

For short and quick codes, I usually use "Monitor$C000" directly, since it assembles and runs on the spot. For longer ones, I use the full set...Editor64, Assembler 64, LoLoader64, and Monitor$C000. The full set does require a number of loads, and it is not so easy to just back up and do it all over again when the .obj file doesn't work! I used just Monitor$C000 when checking out the ASL syntax.

Again, thanks.
Anthony G


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: DRG and 57 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: