Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!samsung!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker!husc6!m2c!wpi!greyelf From: greyelf@wpi.wpi.edu (Michael J Pender) Newsgroups: comp.sys.apple Subject: Re: HyperC Message-ID: <7678@wpi.wpi.edu> Date: 5 Feb 90 00:38:20 GMT References: <9002042113.AA13312@en.ecn.purdue.edu> <1990Feb4.224830.8017@eng.umd.edu> Reply-To: greyelf@wpi.wpi.edu (Michael J Pender) Organization: Worcester Polytechnic Institute, Worcester ,MA Lines: 92 In article <1990Feb4.224830.8017@eng.umd.edu> cyliao@eng.umd.edu (Chun-Yao Liao) writes: >I had trouble to compile my very simple "hello world" c program too. I got >an error like pph (or some file name like this) not found. Interesting that >we got different errors. Anyway, maybe I did something wrong. > >Thax for you all folks who upload HyperC/put it in ftp site/whatever. I finally >got a C compiler for my computer which runs on ProDOS. Thanx again. > > Just name your file something like filename.c then type cc filename with no suffix. Unless you're playing with the assembler. I figured out the minimum information necessary to link a 65c02 assembler file to the Hyperc shell and linker: This file I called min.a, its the minimum source. {Isn't it handy the way c source is a text file and I don't have to pack this stuff first?} --- Michael J Pender Jr Box 1942 c/o W.P.I. W.O.S. is not dead. greyelf@wpi.bitnet 100 Institute Rd. ...its time to get started, greyelf@wpi.wpi.edu Worcester, Ma 01609 there is much to be done. ------- This is an example of a short ml program interfaced to the Hyperc linker. Note the way hex numbers are entered, and the way label equates are defined. -------- .nolist sp = 0xf4 sph = sp+1 fp = sp-2 fph = fp+1 pc = fp-2 pch = pc+1 r1 = pc-2 r1h = r1+1 r2 = r1-2 r2h = r2+1 r3 = r2-2 r3h = r3+1 r4 = r3-2 r4h = r4+1 jp = r4-2 jph = jp+1 smask = jp-2 smaskh = smask+1 dsply = smask-32 rp = dsply-2 .list .even .entry _main _main: lda #0 tay jsr Alnk ; ; I don't know all of what the stuff before here does. ; Mostly I imagine its associated with simulating the p-code ; machine, but partly its involved with the linker. ; This information constitutes the minimum amount of ; information I'm sure will allow integrating machine code ; to the Hyper C Prodos system. ; ; It was created by use of the ccn command on the file ; main () {} that is, the smallest possible c program... ; Simply start your code after this point, and instead of ; using RTS to return to prodos, jmp to _exit. ; ; The following is just a sample assembler program that ; writes a few characters to the screen, then returns to ; the Hyperc shell... ; ; ; cout = 0xfded ; ldy #32 .entry _loop _loop: tya jsr cout iny cpy #42 bne _loop ; ; Thats the end of the stuff I added ; jmp Artn