Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!think!ames!lll-tis!lll-lcc!unisoft!hoptoad!academ!killer!elg From: elg@killer.UUCP (Eric Green) Newsgroups: comp.sys.cbm Subject: Re: assembler info wanted Message-ID: <1123@killer.UUCP> Date: Fri, 10-Jul-87 04:12:48 EDT Article-I.D.: killer.1123 Posted: Fri Jul 10 04:12:48 1987 Date-Received: Sun, 12-Jul-87 18:02:17 EDT References: <385@polyslo.UUCP> Distribution: na Organization: Bayou Telecommunications Lines: 60 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.