Re: [cc65] Re: Target BBC - info only

From: Kolja Nikolaus Sträter <k1kollus.de>
Date: 2005-04-09 13:56:55
Hi Jonathan,

thanks for your pointers. I've looked again a bit more closely at your 
website, a lot of information there, very interesting. Yes, Small-C has 
those things I needed, but I just had to do some initial programming to 
get into the feel of programming in C for the Beeb, and I didn't want to 
insert too many extra layers (to start with).

In fact, after seeing so much about BBC Basic on your website, it's 
almost tempting to write my program in BBC Basic with some assembler. 
But my problem with this is, that I want to implement on a number of 
different platforms, and C is the only standard that I can see that 
allows some form of single sourcedness. I'm moving on a circle of 
platforms currently, having to leave the BBC now, but coming back for 
the next stage in a while. I'll be looking at the Small-C code more 
closely then, to see where I can save some work.

It seems to me that our outlooks differ somewhat: you are coming from 
RiscOS/BBC Basic (you are still using it, I gather) and want the 
compiler and produced code to be compatible with that setting. I'm not 
really into that, I just want to write one single, though very flexible, 
program which will give me the control over the machine I always dreamed 
of. Incidentally, that is why I love the retro platforms: the simplicity 
of everything, especially as compared to the overloaded systems of 
today. Somehow I feel that my aim is similar to the initial writer of 
BBC Basic, Roger->Sohie Wilson, who I mentioned in a previous mail. Not 
only because he wrote BBC Basic, but he also designed the first Risc 
instruction set and was a 6502 expert (built the first Acorn machine). 
Everything reminds me of the overall aim of 'simplicity' - but that 
ought to be explained further and I'm off at a tangent again :-)

I'll contact you about your Small-C version, when I get back to the Beeb 
platform. What I like about Uz's tool chain is the almost compatibility 
with the standard, and it's nice code (despite anything he says about it :-)

All the best,

kol


Jonathan Graham Harston wrote:
>>Message-ID: <4252A544.3040103@kollus.de>
> 
>  
> Kolja_Nikolaus_Sträter <k@kollus.de> wrote:
> 
>>Just wanted to say that I've done a bit of initial delving into the
>>BBC-target problem. I needed some in- and output, so I got a couple of
>>routines working using OSWORD calls. Somebody must have done this
>>already, but I wanted to do this myself to get to know Uz's code a bit.
>>Anyway, reinventing a few small wheels can't do any harm :-)
> 
>  
> Hi Kol.
>  
> Can I suggest you look at www.mdfs.net/System/C/6502/Small-C/v072
> where I've been working on 'ANSI-ising' A.J.Travis' Small-C for
> the BBC. Specifically, browse through includes/os.h and
> includes/kernel.h. os.h functions modify the passed variables and
> return an 'ok/not ok' flag. The kernel.h functions return their
> return value.
>  
> source/sys.s has the 6502 source of many of the core library
> functions.
>  
> The OS functions should be named 'os_*' as listed in os.h. I need
> to add a few others:
>  
> os_escape() - check Escape flag:
>    LDA &FF, AND #&80, return value
> os_error() - generate an error:
>    copy error number and string to &0100, jump to cause error
> os_report() - return pointer to last error:
>    Read &FD/&FE, return value.
>  
> one of the signal() states should be 'error' to do a signal trap
> equivalent of ON ERROR.
>  
> ...and the equivalents for kernel.h. I need to think a bit about
> the parameters, etc., ultimately, you should be able to do
> something like: fprint("%s",_kernel_report());
>  
> Also, somewhere, I've got some relocation code so that a 'C'
> program can be compiled to load in high memory (&8000-length) and
> then it relocates itself to the current PAGE, clears screen to
> reset high memory and RTSes to PAGE to execute.
>  
> And some sort of directive to specify actual load/exec addresses.
> It would be theortically possible to compile a 'C' program as a
> transient program loaded to the transient command area at
> &0900-&0AFF.
>  
> main() { os_vdu(7); }
>  
> /should/ compile to LDA #7:JSR &FFEE:LDA #0:RTS if appropriate
> switches are set. Maybe even to: LDA #7:JMP &FFEE :)
>  
> I'm going to be hugely busy for the next 30 days, but I'll try to
> keep in touch.
>  

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Apr 9 13:55:26 2005

This archive was generated by hypermail 2.1.8 : 2005-04-09 13:55:33 CEST