6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Apr 27, 2024 8:43 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sun Mar 01, 2020 10:29 pm 
Offline

Joined: Tue Jun 19, 2018 8:28 am
Posts: 122
I know it is not directly 6502 related question, but Motorola 6800 family was kind of predecessor of 6502. There is a lot of similarities in their architectures and assembly languages. For some time I've been experimenting with MC6802 - I had to just slightly modify my 6502 computer design to turn it into a platform for experimenting with Motorola processors. Unfortunately, entire fun was kind of hindered by lack of good enough assembler. I was only able to find THIS ONE. It compiles nicely under Linux, but there are some issues. Comments in single line are still being recognized as code, so compilation fails. It looks like everything after valid command in line is considered comment, which messed things up when I want to declare an array of ASCII characters for example - only first one of them is recognized. By some reason it also causes problems with Makefile scripts.

Is there some better tool, comparable to ACME or CC65?


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 01, 2020 11:08 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
My Java based Dev65 assembler suite supports the 6800 (and 6809). See attached.

Attachment:
6800 example.zip [582.99 KiB]
Downloaded 79 times

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 02, 2020 1:12 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1927
Location: Sacramento, CA, USA
I have used https://www.sbprojects.net/sbasm/index.php version 2 for 6502 and 6800 projects ... but running python under Windoze for version 3 has been an annoying crap-shoot with mixed results for me (I probably don't know what I'm doing and I'm stumbling against some configuration issues I don't quite understand).

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 02, 2020 2:45 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 727
Location: Tokyo, Japan
I can highly recommend The Macroassembler AS. I don't use it for 6800 (yet; it is on my list of Things To Do), but I do use it actively for both 6502 and 6809 code. (It supports many other CPUs as well.) It's very featureful and the author is responsive. (I got a nice improvement to local labels the other day.)

If you need a build script for Linux, I have one here. I also help maintain a GitHub repo in which we do vendor imports on a regular basis. (Unfortunately the author doesn't make his source repo available, just source snapshots and releases.)

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 21, 2020 10:34 am 
Offline

Joined: Tue Jun 19, 2018 8:28 am
Posts: 122
barrym95838 wrote:
I have used https://www.sbprojects.net/sbasm/index.php version 2 for 6502 and 6800 projects ... but running python under Windoze for version 3 has been an annoying crap-shoot with mixed results for me (I probably don't know what I'm doing and I'm stumbling against some configuration issues I don't quite understand).


Currently I experiment with SBASM. It is a great tool indeed.
But I ran across strange issue. I need to calculate size of the table stored in EPROM and ten store that value in zeropage location. In ACME assembler for 6502 it is pretty straightforward task. All I need to do is:

Code:
LDA #<(CHARS_END-CHARS)
STA BLKLEN
LDA #>(CHARS_END-CHARS)
STA BLKLEN+1


Unfortunately it doesn't seem to work with SB ASM. It seems this asembler doesn't even like subtraction of labels in single line. So I defined additional .EQ definition:

Code:
CHARLEN .EQ CHARS_END-CHARS


It is calculated properly as 0x300 (size of a table). But unfortunately I wasn't able to move any further:

Code:
LDAA <CHARLEN
STAA BLKLEN+1
LDAA >CHARLEN
STAA BLKLEN


Causes:

Code:
*** Error: Out of range
    308         LDAA <CHARLEN


And this code:

Code:
LDAA #<CHARLEN
STAA BLKLEN+1
LDAA #>CHARLEN
STAA BLKLEN


Ends up with:

Code:
*** Error: Bad Operand
    308         LDAA #<CHARLEN

*** Error: Bad Operand
    310         LDAA #>CHARLEN


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 21, 2020 3:35 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1927
Location: Sacramento, CA, USA
sbasm doesn't use < and > that way:

from https://www.sbprojects.net/sbasm/expressions.php ...
Quote:
# Use the least significant bits that fit the operand size used by the instruction. This means that only the least significant n bits of the 32 word value are used if only an n bit operand is required.

/ Has the same effect as if the # symbol was used, but the 32 bit value is shifted 8 bits to the right first. Bits falling out of the 32 bit value are discarded and 0 bits are shifted in from the left to fill the operand if needed.

So you should try it this way and let us know if it works:
Code:
   LDAA #CHARLEN
   STAA BLKLEN+1
   LDAA /CHARLEN
   STAA BLKLEN


In 6800 land, it's nice to be able to save a few bytes and a few cycles if your 16-bit X register is available:
Code:
   LDX #CHARLEN
   STX BLKLEN

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


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

All times are UTC


Who is online

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