🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.misc
Article #1060

Re: C-Power 64 sys call -- HELP!

#1060
From: schaefer
Date: Tue, 07 Apr 1987 21:00
42 lines
2687 bytes
In article <brl-adm.6734> prindle@nadc.arpa writes:
>In C, to pass the pointer of an object to a function (or to take the address
>of an object with the & operator in general), that object must be "static" or
>"auto", not "register"!  In most C compilers, the default storage class is
>"auto" (given that you don't explicitly declare a storage class).  But in C-
>Power, the default storage class is "register".  To solve your problem (or
>at least make it manageable - I didn't check it out, just saw the obvious),
>either declare any variables which you use & with to be explicitly auto as in:
>	auto char x;
>instead of:
>	char x;
>
>Sincerely,
>Frank Prindle
>Prindle@NADC.arpa

This was not the problem.  (My C-Power manual says "register" declarations
are ignored -- I thought that this meant that there are no register variables
in C-64 C-Power, that the fastest you can get is 0-page, where the first 32
auto variables go.)  Thanks for the pointer, though, Frank; I'll check it out.

The evening after I posted the original article, I tried something different.
The documented call to `sys' is
	sys(bank,address,a,x,y);
but `bank' is suspicious because of the reference to the Basic BANK command,
which does not exist in C-64 Basic.  So I tried:
	sys(address,a,x,y)
i.e., leaving out the bank number.  This works, as far as making the jump to
the machine language routine and setting/reading the accumulator.  I have not
yet checked the x and y registers to see if they are correctly handled.  The
manual evidently needs some proof-reading.

By the way, I have recently heard that C-Power is no longer being distributed
by Pro-Line.  It is reportedly still available, but from some other company in
the eastern US, and possibly under the new name "Power-C".  Anybody out there
have further info on this?

-- 
Bart Schaefer						Dept. of CS&E
CSNET:	schaefer@Oregon-Grad				Oregon Graduate Center
UUCP:	{ihnp4,seismo,sun}!verdix \			19600 NW Von Neumann Dr
 {hplabs,ucbvax,decvax}!tektronix  !ogcvax!schaefer	Beaverton, OR  97006
Technical Details
Message-ID: <1245@ogcvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!vrdxhq!verdix!ogcvax!schaefer
References: <brl-adm.6734>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!vrdxhq!verdix!ogcvax!schaefer
From: schaefer@ogcvax.UUCP
Newsgroups: comp.sys.misc,comp.sys.cbm
Subject: Re: C-Power 64 sys call -- HELP!
Message-ID: <1245@ogcvax.UUCP>
Date: Tue, 7-Apr-87 16:00:42 EST
Article-I.D.: ogcvax.1245
Posted: Tue Apr  7 16:00:42 1987
Date-Received: Sat, 11-Apr-87 06:19:03 EST
References: <brl-adm.6734>
Reply-To: schaefer@ogcvax.UUCP (Barton E. Schaefer)
Organization: Oregon Graduate Center, Beaverton, OR
Lines: 42
Summary: The Solution (I think)