> 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. -- J.G.Harston - jgh@arcade.demon.co.uk - mdfs.net/User/JGH Prospective Parliamentary Candidate for Sheffield Brightside BBC BASIC for Windows and Internationalisation See http://mdfs.net/Software/BBCBasic/Windows/ProgTips ---------------------------------------------------------------------- To unsubscribe from the list send mail to majordomo@musoftware.de with the string "unsubscribe cc65" in the body(!) of the mail.Received on Wed Apr 6 00:00:21 2005
This archive was generated by hypermail 2.1.8 : 2005-04-06 00:00:28 CEST