[comp.sys.cbm] assembler info wanted

mower@sunybcs.UUCP (06/17/87)

Someone posted a query a few days ago about a good assembler for the 
C64.  I'm interested too and I'm sure others are so please post your 
responses to the net.  Thanks!
Jim Mower, Dept. of Geography
uucp: [decvax,watmath,rocksvax]!sunybcs!mower
ARPAnet, CSnet: mower%buffalo@CSNET-RELAY         BITNET:  v061flm5@ubvms
                                                        or v061flm5@ubvm

rex@otto.COM (Rex Jolliff) (06/19/87)

Expires:

Sender:

Followup-To:


I used to work for a Commodore computer store here in Las Vegas and I have had
the opportunity to see a wide variety of assemblers for C-64. The following
will be an opinion of those assemblers and I don't mean to personally insult
any of the cbm.type.people out there. Send any flames to /dev/caveman or
/dev/fireplace.

The first one I can think of is the CBM macro-assembler.  This program was one
of the first things I bought when I bought my computer.  It comes with an
editor that basically extends the normal BASIC editor so you can load seq. text
files and edit them without BASIC tokenizing the keywords.  Two loaders and two
monitors are supplied so you can build loadable files from anywhere in memory.
The monitors are limited in there abilities.  The assembler has most of the
standard pseudo-ops, but conditionals are not supported and neither is more
than one nesting of library files(there are not enough disk buffers, so I don't
think any assembler will handle this properly.). Macros are supported by this
assembler, with a maximum of 9 parameters.  If you have a HES-MON cartridge
installed, the assembler will crash on any macro.  All assemblies are disk
based and between the assembler and all the utilities there is no room left for
source, so you swap between source and assembler binary.  $C000-$CFFF is used
by the editor, one of the loaders and the DOS wedge, and is not a good place
for test programs with this assmebler.  Not a bad piece of software,
considering it comes from Commodore.

The PAL assembler is produced by Pro-Line software.  This package comes with
several assorted utilities like a CBM-to-PAL converter, a unassembler, and many
more.  The normal basic editor is used to enter and edit the source code and
the code must have a 'SYS700' before the first line of assembly code.  One of
the interesting things about this assembler is you can mix basic and assembly
source to do custom things like set up files or generate optional code.  The
assembly is memory based and very fast.  Loadable files can be generated at
assembly time or assembly can go right into memory.  This assembler supports
most of the standard pseudo-ops and conditionals but it does not support
macros.  $C000-$CFFF is not used by this assembler and is a good place for
testing your code. This is a great assembler, it's only disadvantage is no
macros.

The Merlin assembler is the next one that comes to mind, but I can remember who
makes it.  This package also comes with several assorted utilities, but not as
many as PAL.  The editor supplied with this package is similar to ED(I hate
line editors.).  This package supports most of the standard pseudo-ops,
conditionals and macros.  The fact that supports all those assembly features is
really the only appealing thing about it.  I don't know whether $C000-$CFFF is
used or not.  I wasn't too impressed with this assembler.

The TSDS(Total Software Development System) assembler is produced by NoSync
Software. This package is not only an assembler but also a decent editor, a
sound effects code generator, a sprite editor, and a character set/matte
editor.  Several other utilities are also included this package. Sample source
files, sprites and sound files are also part of this package.  The editor is,
like the CBM assembler, an extension of the BASIC editor.  With this editor
however you can select whether you want to edit a BASIC file or an assembly
file.  This editor has a wide selection a functions and is very flexible.  The
assembler is resident along with the editor.  Files can be assembled from
memory to memory, from memory to disk, from disk to memory, or from disk to
disk.  This assembler supports the standard pseudo-ops, macros and
conditionals.  The $C000-$CFFF is left alone, so you can use that area for test
programs.  This software package also works with the 128 in native mode! The
TSDS package is, in my opinion, an excellent choice for an assembler.

Of coursed there's Mark Rinfret's C-ASSM, a public domain linkable assembler
that is designed for used with C-Power.  I haven't recieved his assembler yet,
so I can't comment on it, but from his description it sounds like a great
assembler.

I hope I have answered your questions, and I hope I didn't offend anyone.  If I
did, mail me your flames so I can dispose of them properly.

                                                        ** Rex! **


-- 
Rex Jolliff  (rex@otto.UUCP, {akgua,ihnp4,mirror,sdcrdcf}!otto!rex)
The Sun Newspaper -            |Disclaimer:  The opinions and comments in
Nevada's Largest Daily Morning | this article are my own and in no way
Newspaper                      | reflect the opinions of my employers.

elg@killer.UUCP (Eric Green) (06/20/87)

in article <3670@sunybcs.UUCP>, mower@sunybcs.UUCP (James Mower) says:
> 
> Someone posted a query a few days ago about a good assembler for the 
> C64.  I'm interested too and I'm sure others are so please post your 
> responses to the net.  Thanks!

Buy the C-Power compiler and get Mark Rinfret's 6502 assembler. Best way to go
if you are going to write programs bigger than "hello, world!", because it
produces code linkable by the C-Power linker (thus, you don't have to
re-assemble 160K of source code every time you make a minor change -- my
problem with my current assembler, the Merlin assembler).

The C-Power compiler is now marked as "Power C" by Spinnaker, and costs $39.95
for a package containing both C64 & C128 version, and a very LOUSY manual
(e.g.: how do I issue a DOS command to a unit other than unit#0, when using
the 128 version?). But hey, for the price....

Your dealer probably doesn't have it, but I've found that any software store
can order it (because distributor catalogs such as the Inmac catalog go by
publisher, not by computer type, and Spinnaker publishes some non-Commodore
stuff too).

  Eric Green
     {ihnp4,cbosgd}!killer!elg  elg@usl.CSNET

PS to Mark: When we gonna get a 128 version of the assembler? For example, the
128 version of Power C already does your "openfile" with ordinary fopen...

doc@crash.CTS.COM (Mitch Evans) (06/24/87)

If anyone out there is interested in purchasing a Repairable power supply for
the Commodore 64....send me net mail.  The charges are $25 + your old power
supply (for cables, etc.). The new supply will be reliable, cooler, and
best of all....repairable...

                        Doc
q
-- 
*******************************************************************************
UUCP:   {cbosgd,hplabs!hp-sdd,sdcsvax,nosc}!crash!doc
ARPA:   crash!doc@nosc.mil
INET:   doc@crash.CTS.COM

.........Quid?.....Me Vexari?..
********************************************************************************

rayz@csustan.UUCP (R. L. Zarling) (06/27/87)

In article <1022@killer.UUCP> elg@killer.UUCP (Eric Green) writes:
>PS to Mark: When we gonna get a 128 version of the assembler? For example, the
>128 version of Power C already does your "openfile" with ordinary fopen...

I have modified the assembler to run on the 128; send a blank disk and
postpaid mailer to

	Raymond L. Zarling
	Dept. Computer Science
	CSU Stanislaus
	Turlock, CA 95380

jchikin@polyslo.UUCP (Joe Chikin) (07/06/87)

>  Eric Green
>
>PS to Mark: When we gonna get a 128 version of the assembler? For example, the
>128 version of Power C already does your "openfile" with ordinary fopen...

Hey Erik, 
I just purchased Spinnaker's Power Assembler (Proline's buddy Assembler)
and the disk contains an Assembler for Power C 128.  The Asm.sh is 
probably like Mark Rinfret's 6502 assembler except it works in the 128
mode.

I'm happy that I have a good assembler but I have another problem.  What
format does Power C (C-Power) use for ml.  I tried writing a short ml
program and linked it to another program but the linker said that I had
an undefined external reference.  Here is an example of what I tried.

This is the C module:

-------------------------------------------
main()
{

test();

printf("this is a test of the assembler\n");
}
-------------------------------------------


this is the ML module:


-------------------------------------------
test lda #$93     ;clear screen
     jsr $ffd2    ;print char
     jsr $ff7d    ;print string routine
.asc "end of ml module"
.byte 13,0
     rts
-------------------------------------------


Anyway, I tried this for a while without much success but I went in
with a sector editor and examined the .obj files and found textual
(ascii) references to itself and other routines mixed in with a lot
of other gibberish.  I couldn't decipher the exact meaning other than
it might be a symbol table of some sort following the actual object
code.  Moreover, there were numerous JSRs to the $0d00 region which
is defined as a C system buffer.

Now does anyone know how to properly link a Power C object file with
an assembled object file?  (What is my assembly file missing?).

Thanks in advance.

Chikin Joe (jchikin@polyslo.UUCP)
61 N. Broad #216
San Luis Obispo, CA 93401.
(805) 544-0907

dwl10@amdahl.UUCP (07/09/87)

In article <385@polyslo.UUCP> jchikin@polyslo.UUCP (Joe   Chikin) writes:
>>  Eric Green
>>
>>PS to Mark: When we gonna get a 128 version of the assembler? For example, the
>>128 version of Power C already does your "openfile" with ordinary fopen...
>
>Hey Erik, 
>I just purchased Spinnaker's Power Assembler (Proline's buddy Assembler)
>and the disk contains an Assembler for Power C 128.  The Asm.sh is 
>probably like Mark Rinfret's 6502 assembler except it works in the 128
>mode.
>
>I'm happy that I have a good assembler but I have another problem.  What
>format does Power C (C-Power) use for ml.  I tried writing a short ml
>program and linked it to another program but the linker said that I had
>an undefined external reference.  Here is an example of what I tried.
>
>This is the C module:
>
>-------------------------------------------
>main()
>{
>
>test();
>
>printf("this is a test of the assembler\n");
>}
>-------------------------------------------
>
>
>this is the ML module:
>
>
>-------------------------------------------
>test lda #$93     ;clear screen
>     jsr $ffd2    ;print char
>     jsr $ff7d    ;print string routine
>.asc "end of ml module"
>.byte 13,0
>     rts
>-------------------------------------------
>
I can't say for Spinnaker's assembler, but in C/ASSM, you have to
define all external symbols. So for your sample above, you would
need the following line at the beginning of your assembler source:
 .def test

If you wish to reference externally defined names, you need to
define the names with a ".ref" statement.

Hope this helps.
-- 
-------------------------------------------------------------------
                               Dave Lowrey

"So it goes, so it goes, so it goes, so it goes. But where it's
 going, nobody knows"   [Nick Lowe]
                                ...!{ihnp4,cbosgd,hplabs}!amdahl!dwl10

[ The opinions expressed <may> be those of the author and not necessarily
  those of his most eminent employer. ]

elg@killer.UUCP (Eric Green) (07/10/87)

in article <385@polyslo.UUCP>, jchikin@polyslo.UUCP (Joe   Chikin) says:
> Hey Erik, 
> I just purchased Spinnaker's Power Assembler (Proline's buddy Assembler)
> and the disk contains an Assembler for Power C 128.  The Asm.sh is 
> probably like Mark Rinfret's 6502 assembler except it works in the 128
> mode.

I don't think so. Mark's assembler is an old-fashioned MOS-Technology styled
assembler tht was posted to the net eons ago and modified by Mark to work
under CPOWER-128. The modifications mainly consisted of making the assembler
produce files in the relocatable object format of "C" objects, from what I can
tell, along with some .if stuff that I don't remember in the original as6502.
I suspect that the asm.sh is much like the "buddy" assembler only running
in the C-Power environment (I guess for the editor and shell?).

> I'm happy that I have a good assembler but I have another problem.  What
> format does Power C (C-Power) use for ml.  I tried writing a short ml
> program and linked it to another program but the linker said that I had
> an undefined external reference.  Here is an example of what I tried.
> 
> -------------------------------------------
> test lda #$93     ;clear screen
>      jsr $ffd2    ;print char
>      jsr $ff7d    ;print string routine
> .asc "end of ml module"
> .byte 13,0
>      rts
> -------------------------------------------

Well, there's three big problems here: a) You haven't declared the label
"test" to be external. Internal labels are not visible to objects outside the
object code, unless specifically told so. This is similiar to most mainframe
and Unix assemblers which produce relocatable object code, although they
probably use a different statement name/syntax/etc.  In CASM, you would need
to put a ".def test" statement, before the first use of the label "test".
which brings up b), you're not using CASM, because CASM doesn't have a ".asc"
statement, you would say just '.byte "end of ml module",13,0' in CASM if I
recall right (at least, that's what I used to do with my old CBM assembler,
back when the C64 just came out and before all these new-fangled assemblers).
And finally, big problem #3: "C" programs run in bank 1 of memory. The
question of whether the Kernel is banked in or not is a Very Big Question, one
that I can't answer off-hand as I haven't done any C128 mode development. It
is possible you're jumping into un-initialized memory with your "jsr".

I have CASM running in 128 mode just fine. I even fixed the readline
processing to use "fgets" to make the thing faster than a crawl (although it's
still no speed-demon -- it takes 2-3 minutes to assemble 1,000 lines of code
-- a file that got out-of-hand when I was adding features, and grew from a
lowly 250 lines to that scale). I find it quite useful for development work,
because it was taking up to 10 minutes to re-assemble a diskfull of code, and
now I just have to wait the 3 minutes and then re-link (which takes virtually
no time at all). All I have to say is Good Job.... now if only the "C"
compiler produced better code! (not to mention the problem of linking in the
library -- has ANYBODY figured out a way to wait less than three minutes after
hitting the "^" key?!).
--
Eric Green   elg%usl.CSNET     CS student, University of SW Louisiana
{cbosgd,ihnp4}!killer!elg      Apprentice Haquer, Bayou Telecommunications
Snail Mail P.O. Box 92191      BBS phone #: 318-984-3854  300/1200 baud
Lafayette, LA 70509            I disclaim my existence, and yours, too.

sentinel@killer.UUCP (The Sentinel) (07/10/87)

In article <1123@killer.UUCP>, elg@killer.UUCP (Eric Green) writes:
> And finally, big problem #3: "C" programs run in bank 1 of memory. The
> question of whether the Kernel is banked in or not is a Very Big Question, one
> that I can't answer off-hand as I haven't done any C128 mode development. It
> is possible you're jumping into un-initialized memory with your "jsr".

    I did some playing around with this a few weeks ago, and I agree with this
statement.  It is not safe to assume anything about the memory configuration
of the 128 at the time your ML is called.  You can get away with manually
switching the Kernal back in temporarily *IF AND ONLY IF* you link the ML
routine early enough that it will not be under the ROM.
    For safety, you should use the interbank routines in low memory.  These
are not the same as JSRFAR, JMPFAR, etc. in "normal" 128 mode.  C-Power seems
to move them around, probably to get more zero page space.  I can't tell you
offhand how to call them, but if you look at a disassembly of sys.obj and
peek.obj from the library disk, it should be fairly obvious.  The sys()
function is just a straightforward interbank call, and peek() and poke() are
simple load and store, respectively.
    Also, if you wish to call Kernal routines, most of them are represented in
the C library by routines which do the proper interbank call.

    I'm sorry I can't post more detailed information right now, but I haven't
dug into this too deeply yet, and what I have found out I don't know off the
top of my head.

> I have CASM running in 128 mode just fine. I even fixed the readline
> processing to use "fgets" to make the thing faster than a crawl (although it's
> still no speed-demon -- it takes 2-3 minutes to assemble 1,000 lines of code
> -- a file that got out-of-hand when I was adding features, and grew from a
> lowly 250 lines to that scale). I find it quite useful for development work,
> because it was taking up to 10 minutes to re-assemble a diskfull of code, and
> now I just have to wait the 3 minutes and then re-link (which takes virtually
> no time at all). All I have to say is Good Job.... now if only the "C"
> compiler produced better code! (not to mention the problem of linking in the
> library -- has ANYBODY figured out a way to wait less than three minutes after
> hitting the "^" key?!).

    Can you post a patch for the assembler with the changes you have made to
it?  I am interested in speeding it up, as I'm using it quite a bit now.  I
haven't fed it any real big programs yet, but it's nice to know it can
handle them.

    I haven't noticed any excessive time being taken up by linking.  I don't
know what you're doing with it, but I don't think it's ever taken 3 minutes
to search the library any time I've done it.  After some observation, I've
noticed that most of the time spent in library searching is in directory
access time.  I haven't tried C-Power with anything other than a 1571 and a
1541, but I think that a different drive would speed things up considerably.
A 1581, for instance, would probably be significantly better because of it's
whole track buffering, so all parts of the directory would be accessed
equally fast.

> --
> Eric Green   elg%usl.CSNET     CS student, University of SW Louisiana
> {cbosgd,ihnp4}!killer!elg      Apprentice Haquer, Bayou Telecommunications
> Snail Mail P.O. Box 92191      BBS phone #: 318-984-3854  300/1200 baud
> Lafayette, LA 70509            I disclaim my existence, and yours, too.


-- 
Rob Tillotson				...ihnp4!killer!sentinel
3922-1 Newport Ave.				-or-
Fort Wayne, IN 46805			...rutgers!unirot!sentinel
(219) 483-2722				    (top one preferred)

elg@killer.UUCP (Eric Green) (07/11/87)

in article <1124@killer.UUCP>, sentinel@killer.UUCP (The Sentinel) says:
> In article <1123@killer.UUCP>, elg@killer.UUCP (Eric Green) writes:
>> compiler produced better code! (not to mention the problem of linking in the
>> library -- has ANYBODY figured out a way to wait less than three minutes after
>> hitting the "^" key?!).
> 
>     Can you post a patch for the assembler with the changes you have made to
> it?  I am interested in speeding it up, as I'm using it quite a bit now.  I
> haven't fed it any real big programs yet, but it's nice to know it can
> handle them.

OK, will do, when I can (I don't up/download via PC Pursuit, I will do the
"diff" with one of the USL minis and then EMAIL it to myself -- a computer is
much more patient over PC Pursuit than I am!). Note that since I have about 50
jillion things to do and a month and a half to do them, it may take me awhile
to get around to it....

>     I haven't noticed any excessive time being taken up by linking.  I don't
> know what you're doing with it, but I don't think it's ever taken 3 minutes
> to search the library any time I've done it.  After some observation, I've
> noticed that most of the time spent in library searching is in directory
> access time.  I haven't tried C-Power with anything other than a 1571 and a
> 1541, but I think that a different drive would speed things up considerably.
> A 1581, for instance, would probably be significantly better because of it's
> whole track buffering, so all parts of the directory would be accessed
> equally fast.

I guess I exaggerate somewhat. But after the fast speed of linking in the
major object modules, waiting for the directory searches for all these tiny
object modules is a Real Drag. This could be solved with a more-intelligent
linker which could fetch only PARTS of a file... then you could do it like the
old "Collossal Cave" adventure (in BASIC), which had about 40 files, each with
about five "look"-type messages in it... so who volunteers to write the
linker?! (:-). 

> Rob Tillotson				...ihnp4!killer!sentinel

Eric Green {ihnp4,cbosgd}!killer!elg

rayz@csustan.UUCP (R. L. Zarling) (07/13/87)

In article <385@polyslo.UUCP> jchikin@polyslo.UUCP (Joe   Chikin) writes:
>Now does anyone know how to properly link a Power C object file with
>an assembled object file?  (What is my assembly file missing?).

Using the C-Power assembler that Mark Rinfret and I wrote, you would need
to include a ".def test" line in the assembly, to mark "test" as an
external symbol.  I am sure ProLine's assembler has a similar pseudo-op.

--Ray Zarling

jchikin@polyslo.UUCP (Joe Chikin) (07/14/87)

>Using the C-Power assembler that Mark Rinfret and I wrote, you would need
>to include a ".def test" line in the assembly, to mark "test" as an
>external symbol.  I am sure ProLine's assembler has a similar pseudo-op.
>
>--Ray Zarling

Thanks for the info folks.  However, I tried that and others without much
success.  It may be that Power Assembler's ASM.SH is very basic; it's only
32 blocks long.  

Well another question.  How do I link C .o files with assembly .o files?
(How is the parameter passing organized between C .o files and assembly .o
files?)  I can't seem to get even the simplest routines working because
of the 128's banking.  This is ridiculous!  

Also, what is the meaning of the various symbols in the symbol table?
(I.E., RD, R, >, ... etc).

Thanks again

Chikin Joe (jchikin@polyslo.UUCP)
61 N. Broad #216
San Luis Obispo, CA 93401
(805) 544-0907