PDA

View Full Version : KERNAL routines on the PET2001-N



davepl1968
December 29th, 2016, 10:14 AM
I was writing some code to ultimately read the real-time clock from a petSD+, but I only got this far:

LDA #$01 ; dir name length
LDX #<dirname
LDY #>dirname
JSR $FFBD ; SETNAM to $

...and SETNAM doesn't seem to exist there on the PET. It'd be fine on the C64. So I have two questions:

- Can anyone point me at a table (or even better, a doc) showing the known routines for things like setting the filename, open, read, close, etc on the PET?
- Does anyone have a "read and print directory" code sample that works on the PET?

And of course if someone has already written assembly code to read the clock from the petSD+, that'd be a HUGE leg up. But for now just being able to call I/O on the PET would be a great start.

I'm running #### COMMODORE BASIC 2 #### on a PET2001-N w/32K

dave_m
December 29th, 2016, 06:56 PM
- Can anyone point me at a table (or even better, a doc) showing the known routines for things like setting the filename, open, read, close, etc on the PET?

I have never found a good disassembly of BASIC2. Here are some BASIC 2 ROM subroutine entry points.

http://www.zimmers.net/anonftp/pub/cbm/manuals/anthology/p032.jpg

Here are some books on bombjack that may have some info of interest. "See PET/CBM Personal Computer Guide Second Edition" by Adam Osborne, etc.

http://www.bombjack.org/kim-pet/books-kim-pet.htm

KC9UDX
December 29th, 2016, 07:33 PM
The PET KERNALs are nowhere near as advanced as the VIC-20/Commodore 64 ones.

Most of the routines you seek just don't exist. You have to deal with the IEEE devices directly. If you look at the list of all of them for the C64, you well recognise a bunch of I/O routines that you never used. Those are the ones you need to use on the PET.

Most of the examples I've seen for the PET are very frustrating because they don't even use the KERNAL. They JSR to BASIC routines! I have two large how-to books that do that.