Commodore KERNAL Historical previous

Partager

news image

While you possess ever written 6502 code for the Commodore Sixty four, you would fair take into account the enlighten of “JSR $FFD2″ to print a character on the conceal. You may perhaps fair possess read that the soar desk on the close of the KERNAL ROM used to be designed to allow applications to speed on a all Commodore eight bit computers from the PET to the C128 (and the C65!) – but that shall be a misconception. This article will conceal how

  • the first version of the soar desk in the PET used to be designed to handiest hook up BASIC to the map’s choices
  • it wasn’t until the VIC-20 that the soar desk used to be generalized for application increase (and the vector desk launched)
  • all later machines add their very possess calls, but later machines don’t wanted red meat up older calls.

KIM-1 (1976)

The KIM-1 used to be at the start supposed as a computer increase board for the MOS 6502 CPU. Commodore bought MOS in 1976 and saved promoting the KIM-1. It contained a 2 KB ROM (“TIM”, “Terminal Interface Video show”), which incorporated capabilities to read characters from ($1E5A) and write characters to ($1EA0) a serial terminal, as smartly as code to load from and assign to tape and red meat up for the hex keyboard and conceal.

Commodore asked Microsoft to port their BASIC for 6502 to it, which interfaced with the video show handiest thru the 2 character in and out capabilities. The fashioned source of BASIC reveals how Microsoft adapted it to work with the KIM-1 by defining CZGETL and OUTCH to say the video show routines:

IFE     REALIO-1,

(The values are octal, since the assembler Microsoft historical did no longer red meat up hexadecimal.)

The makers of the KIM-1 below no circumstances supposed to change the ROM, so there used to be no must possess a soar desk for these calls. Applications right hardcoded their offsets in ROM.

PET (1977)

The PET used to be Commodore’s first full computer, with a keyboard, a conceal and a constructed-in tape power. The map ROM (“KERNAL”) used to be now Four KB and incorporated an spectacular file I/O map for tape, RS-232 and IEEE-488 (for printers and disk drives) as smartly as timekeeping common sense. One other 2 KB ROM (“EDITOR”) handled conceal output and character input. Microsoft BASIC used to be incorporated in ROM and used to be marketed – with the establish “COMMODORE BASIC” – because the actual working map, making the KERNAL and the editor merely a instrument driver kit.

Love with the KIM-1, Commodore asked Microsoft to port BASIC to the PET, and provided them with addresses of a soar desk in the KERNAL ROM for interfacing with it. These are the emblem definitions in Microsoft’s source:

        CQOPEN=^O177700
        CQCLOS=^O177703
        CQOIN= ^O177706         ;OPEN CHANNEL FOR INPUT
        CQOOUT=^O177711         ;FILL FOR COMMO.
        CQCCHN=^O177714
        CQINCH=^O177717         ;INCHR'S CALL TO GET A CHARACTER
        OUTCH= ^O177722
        CQLOAD=^O177725
        CQSAVE=^O177730
        CQVERF=^O177733
        CQSYS= ^O177736
        ISCNTC=^O177741
        CZGETL=^O177744         ;CALL POINT FOR "GET"
        CQCALL=^O177747         ;CLOSE ALL CHANNELS

(The that means of the CQ prefix is left as an enlighten to the reader.)

In hex and with Commodore’s names, these are the KERNAL calls historical by BASIC:

  • $FFC0: OPEN
  • $FFC3: CLOSE
  • $FFC6: CHKIN
  • $FFC9: CHKOUT
  • $FFCC: CLRCHN
  • $FFCF: BASIN
  • $FFD2: BSOUT
  • $FFD5: LOAD
  • $FFD8: SAVE
  • $FFDB: VERIFY
  • $FFDE: SYS
  • $FFE1: STOP
  • $FFE4: GETIN
  • $FFE7: CLALL
  • $FFEA: UDTIM (come clock; no longer historical by BASIC)

Before everything explore, this soar desk seems very linked to the one acknowledged from the C64, but it is indeed very varied, and it is no longer in overall like minded.

The following eight KERNAL routines are known as from within the implementation of BASIC instructions to accommodate character I/O and the keyboard:

  • $FFC6: CHKIN – role channel for character input
  • $FFC9: CHKOUT – role channel for character output
  • $FFCC: CLRCHN – restore character I/O to cowl/keyboard
  • $FFCF: BASIN – gain character
  • $FFD2: BSOUT – write character
  • $FFE1: STOP – take a look at for STOP key
  • $FFE4: GETIN – gain character from keyboard
  • $FFE7: CLALL – shut all channels

Nonetheless the final six calls are no longer library calls the least bit, but full-fledged implementations of BASIC instructions:

  • $FFC0: OPEN – start a channel
  • $FFC3: CLOSE – shut a channel
  • $FFD5: LOAD – load a file into memory
  • $FFD8: SAVE – assign a file from memory
  • $FFDB: VERIFY – compare a file with memory
  • $FFDE: SYS – speed machine code

When compiled for the PET, Microsoft BASIC detects the additional instructions “OPEN”, “CLOSE” and hundreds others., but doesn’t provide an implementation for them. As a substitute, it calls out to these KERNAL capabilities when these instructions are encountered. So these KERNAL calls must parse the BASIC arguments, take a look at for errors, and update BASIC’s internal data structures.

These 6 KERNAL calls are in actual fact BASIC advise extensions, they normally must no longer functional for some other programs in machine code. After all, the entire soar desk used to be no longer supposed as an abstraction of the machine, but as an interface in particular for Microsoft BASIC.

PET BASIC V4 (1980)

Model Four of the ROM role, which came with critical enhancements to BASIC and shipped by default with the 4000 and 8000 series, contained a few additions to the KERNAL – all of which had been additional BASIC instructions.

  • $FF93: CONCAT
  • $FF96: DOPEN
  • $FF99: DCLOSE
  • $FF9C: RECORD
  • $FF9F: HEADER
  • $FFA2: COLLECT
  • $FFA5: BACKUP
  • $FFA8: COPY
  • $FFAB: APPEND
  • $FFAE: DSAVE
  • $FFB1: DLOAD
  • $FFB4: CATALOG/DIRECTORY
  • $FFB7: RENAME
  • $FFBA; SCRATCH
  • $FFBD: DS$ (disk field)

Even when Commodore used to be doing all increase on their fork of BASIC after version 2, advise additions had been soundless saved separate and developed as segment of the KERNAL. With out a doubt, for all Commodore eight-bit computers from the PET to the C65, BASIC and KERNAL had been constructed individually, and the KERNAL soar desk used to be their interface.

VIC-20 (1981)

The VIC-20 used to be Commodore’s first low-ticket home computer. In say to withhold the price down, the entire ROM needed to suit into Sixteen KB, which supposed the BASIC V4 choices and the machine language video show wanted to be dropped and the editor used to be merged into the KERNAL. While reorganizing the ROM, the distinctive BASIC advise extensions (OPEN, CLOSE, …) had been moved into the BASIC ROM (so the KERNAL requires the BASIC advise implementations had been no longer wanted).

The VIC-20 KERNAL is the first one to possess a factual map name interface, which doesn’t handiest consist of all calls required so BASIC is hardware-honest, but additionally additional calls no longer historical by BASIC but supposed for applications written in machine code. The VIC-20 Programmer’s Reference Handbook documents these, making this the first time that machine code applications may probably be written for the Commodore eight bit series in a forward-like minded ability.

Aged PET Calls

The following PET KERNAL calls are in overall functional and due to this truth soundless supported on the VIC-20:

  • $FFC6: CHKIN
  • $FFC9: CHKOUT
  • $FFCC: CLRCHN
  • $FFCF: BASIN
  • $FFD2: BSOUT
  • $FFE1: STOP
  • $FFE4: GETIN
  • $FFE7: CLALL
  • $FFEA: UDTIM

Channel I/O

The requires the BASIC instructions OPEN, CLOSE, LOAD and SAVE were replaced by generic capabilities that may probably smartly be known as from machine code:

  • $FFC0: OPEN
  • $FFC3: CLOSE
  • $FFD5: LOAD
  • $FFD8: SAVE

(There is no separate name for VERIFY, since the LOAD characteristic can produce this characteristic in line with its inputs.)

OPEN, LOAD and SAVE take hang of extra arguments (LA, FA, SA, filename) than match into the 6502 registers, so two extra calls take hang of these and retailer them temporarily.

  • $FFBA: SETLFS – role LA, FA and SA
  • $FFBD: SETNAM – role filename

Two extra additions allow reading the field of the closing operation and to role the verbosity of messages/errors:

  • $FFB7: READST – return field byte
  • $FF90: SETMSG – role verbosity

BASIC uses all these capabilities to enforce the instructions OPEN, CLOSE, LOAD, SAVE and VERIFY. It on occasion parses the arguments after which calls the KERNAL capabilities.

IEC

The KERNAL also exposes a full low-stage interface to the serial IEC (IEEE-488) bus historical to join printers and disk drives. None of these calls are historical by BASIC though, which talks to these gadgets on a bigger stage (OPEN, CHKIN, BASIN and hundreds others.).

  • $FFB4: TALK – send TALK advise
  • $FFB1: LISTEN – send LISTEN advise
  • $FFAE: UNLSN – send UNLISTEN advise
  • $FFAB: UNTLK – send UNTALK advise
  • $FFA8: IECOUT – send byte to serial bus
  • $FFA5: IECIN – read byte from serial bus
  • $FFA2: SETTMO – role timeout
  • $FF96: TKSA – send TALK secondary take care of
  • $FF93: SECOND – send LISTEN secondary take care of

Memory

BASIC needs to take hang of the build usable RAM starts and the build it ends, which is what the MEMTOP and MEMBOT characteristic are for. Additionally they allow environment these values.

  • $FF9C: MEMBOT – read/write take care of of start of usable RAM
  • $FF99: MEMTOP – read/write take care of of close of usable RAM

Time

BASIC supports the TI and TI$ variables to gain entry to the map clock. The RDTIM and SETTIM KERNAL calls allow reading and writing this clock.

  • $FFDE: RDTIM – read map clock
  • $FFDB: SETTIM – write map clock

These capabilities enlighten the addresses that historical to be the BASIC instructions SYS and VERIFY on the PET.

Show conceal conceal

Machine code applications may probably must take hang of the dimensions of the text conceal (SCREEN) and be in a build to read or role the cursor direct (PLOT). The latter is historical by BASIC to align text on tab positions.

  • $FFED: SCREEN – gain the conceal resolution
  • $FFF0: PLOT – read/write cursor direct

I/O

On the PET, the BASIC’s random number generator for the RND advise used to be straight away reading the timers in THE VIA 6522 controller. For the explanation that VIC-20, right here is abstracted: The IOBASE characteristic returns the start take care of of the VIA in memory, and BASIC reads from the indexes Four, 5, eight and 9 to gain entry to the timer values.

  • $FFF3: IOBASE – return start of I/O build

The VIC-20 Programmer’s Reference E book states: “This routine exists to supply compatibility between the VIC 20 and future models of the VIC. If the I/O locations for a machine language program are role by a name to this routine, they’re going to fair soundless soundless remain like minded with future versions of the VIC, the KERNAL and BASIC.”

Vectors

The PET already allowed the user to override the following vectors in RAM to hook into some KERNAL capabilities:

  • $00E9: input from keyboard
  • $00EB: output to cowl
  • $0090: IRQ handler
  • $0092: BRK handler
  • $0094: NMI handler

The VIC-20 ROM replaces these vectors with a extra extensive desk of addresses in RAM at $0300 to hook core BASIC and KERNAL capabilities. The KERNAL ones start at $0314. The first three may perhaps smartly be historical to hook IRQ, BRK and NMI:

  • $0314: CINV – IRQ handler
  • $0316: CBINV – BRK handler
  • $0318: NMINV – NMI handler

The others allow overriding the core role of KERNAL calls

  • $031A: IOPEN – indirect entry to OPEN ($FFC0)
  • $031C: ICLOSE – indirect entry to CLOSE ($FFC3)
  • $031E: ICHKIN – indirect entry to CHKIN ($FFC6)
  • $0320: ICKOUT – indirect entry to CHKOUT ($FFC9)
  • $0322: ICLRCH – indirect entry to CLRCHN ($FFCC)
  • $0324: IBASIN – indirect entry to CHRIN ($FFCF)
  • $0326: IBSOUT – indirect entry to CHROUT ($FFD2)
  • $0328: ISTOP – indirect entry to STOP ($FFE1)
  • $032A: IGETIN – indirect entry to GETIN ($FFE4)
  • $032C: ICLALL – indirect entry to CLALL ($FFE7)
  • $032E: USRCMD – “Particular person-Outlined Vector”
  • $0330: ILOAD – indirect entry to LOAD ($FFD5)
  • $0332: ISAVE – indirect entry to SAVE ($FFD8)

The “USRCMD” vector is difficult: It’s unused on the VIC-20 and C64. On all later machines, this vector is documented as “EXMON” and enables hooking the machine code video show’s advise entry. The vector used to be presumably supposed for the video show from the starting, but this characteristic used to be carve from these two machines.

The KERNAL documentation warns in opposition to altering these vectors by hand. As a substitute, the VECTOR name enables the application to repeat the entire role of KERNAL vectors ($0314-$1/3) from and to non-public memory. The RESTOR advise gadgets the default values.

  • $FF8D: VECTOR – read/write KERNAL vectors
  • $FF8A: RESTOR – role KERNAL vectors to defaults

Custom IRQ Handlers

If an application hooks the IRQ vector, it may maybe probably right insert itself and focus on to code at the start pointed to by the vector, or totally replace the IRQ code (and return with pulling the registers and RTI). In the latter case, it’ll fair soundless desire the keyboard and the map clock to work. The PET already had the UDTIM ($FFEA) name to update the clock in the IRQ context. The VIC-20 provides SCNKEY to take care of the keyboard and populating the keyboard buffer.

  • $FF9F: SCNKEY – keyboard driver

CBM-II (1982)

The CBM-II series of computers used to be supposed as a successor of the PET 4000/8000 series. The KERNAL’s structure used to be in line with the VIC-20.

The vector desk in RAM is like minded except for ILOAD, ISAVE and USRCMD (which is now historical), whose say used to be changed:

  • $032E: ILOAD – indirect entry to LOAD ($FFD5)
  • $0330: ISAVE – indirect entry to SAVE ($FFD8)
  • $0332: USRCMD – machine code video show advise input

There are two new keyboard-linked vectors:

  • $0334: ESCVEC – ESC key vector
  • $0336: CTLVEC – CONTROL key vector (unused)

And all IEEE-488 KERNAL calls except ACPTR may perhaps smartly be zigzag:

  • $0346: ITALK – indirect entry to TALK ($FFB4)
  • $0344: ILISTN – indirect entry to LISTEN ($FFB1)
  • $0342: IUNLSN – indirect entry to UNLSN ($FFAE)
  • $0340: IUNTLK – indirect entry to UNTLK ($FFAB)
  • $033E: ICIOUT – indirect entry to CIOUT ($FFA8)
  • $033C: IACPTR – indirect entry to ACPTR ($FFA5)
  • $033A: ITKSA – indirect entry to TKSA ($FF96)
  • $0338: ISECND – indirect entry to SECOND ($FF93)

For no obvious motive, the VECTOR and RESTOR calls possess moved to varied addresses:

  • $FF84: VECTOR – read/write KERNAL vectors
  • $FF87: RESTOR – role KERNAL vectors to defaults

And there are a few new calls. All machines since the VIC-20 possess a ability to hand withhold watch over to ROM cartridges as one more of BASIC on map startup. At this level, no map initialization whatsoever has been achieved by the KERNAL, so the application or game on the cartridge can open as instant as probably. Applications that desire to be forward-like minded can name into the following new KERNAL calls to initialize varied facets of the map:

  • $FF7B: IOINIT – initialize I/O and enable timer IRQ
  • $FF7E: CINT – initialize text conceal

The LKUPLA and LKUPSA calls are historical by BASIC to fetch unused logical and secondary addresses for channel I/O, so its constructed-in disk instructions can start channels even supposing the user has presently start channels – logical addresses must be out of the ordinary on the laptop side, and secondary addresses must be out of the ordinary on the disk power side.

  • $FF8D: LKUPLA – search tables for given LA
  • $FF8A: LKUPSA – search tables for given SA

It also added 6 in overall functional calls:

  • $FF6C: TXJMP – soar at some level of banks
  • $FF6F: VRESET – vitality-on/off vector reset
  • $FF72: IPCGO – loop for other processor
  • $FF75: FUNKEY – checklist/program characteristic key
  • $FF78: IPRQST – send IPC seek data from
  • $FF81: ALOCAT – allocate memory from MEMTOP down

C64 (1982)

Each and every the KERNAL and the BASIC ROM of the C64 are derived from the VIC-20, so each and every the KERNAL calls and the vectors are fully like minded with it, but some extensions from the CBM-II carried over: The IOINIT and CINT calls to initialize I/O and the text conceal exist, but at varied addresses, and a new RAMTAS name has been added, which may be functional for startup from a ROM cartridge.

  • $FF87: RAMTAS – take a look at and initialize RAM
  • $FF84: IOINIT – initialize I/O and enable timer IRQ
  • $FF81: CINT – initialize text conceal

The factitious CBM-II additions are missing, since they must no longer wanted, e.g. on myth of BASIC doesn’t possess the V4 disk instructions (LKUPLA, LKUPSA) and on myth of there is handiest one RAM bank (TXJMP, ALOCAT).

Plus/Four (264 Series, 1985)

The following Commodore eight bit computers in historical say are the 264 series: the C16, the C116 and the Plus/Four, which fragment the same smartly-liked structure, BASIC and KERNAL. Nonetheless they are neither supposed as successors of the C64, nor to the CBM-II series – they are extra admire religious successors of the VIC-20. Nonetheless, the KERNAL soar desk and vectors are in line with the C64.

For the explanation that 264 machines don’t possess an NMI, the NMI vector is missing, and the final vectors were moved in memory. This makes many of the vector desk incompatible with their predecessors:

  • $0314: CINV – IRQ handler
  • $0316: CBINV – BRK handler
  • (NMI removed)
  • $0318: IOPEN
  • $031A: ICLOSE
  • $031C: ICHKIN
  • $031E: ICKOUT
  • $0320: ICLRCH
  • $0322: IBASIN
  • $0324: IBSOUT
  • $0326: ISTOP
  • $0328: IGETIN
  • $032A: ICLALL
  • $032C: USRCMD
  • $032E: ILOAD
  • $0330: ISAVE

The Plus/Four is the first machine from the home computer series to consist of the machine code video show, so the USRCMD vector is now historical for advise input in the video show.

And there is one new vector, ITIME, which is is assumed as one every frame at some level of vertical easy.

  • $0312: ITIME – vertical easy IRQ

The Plus/Four supports all C64 KERNAL calls, plus some additions. The RESET name has been added to the very close of the desk:

  • $FFF6: RESET – restart machine

There are 9 extra undocumented entries, that are positioned at lower addresses so that there is an (unused) gap between them and the final calls. For the explanation that build $FFD0 to $FF3F is occupied by the I/O build, these vectors are ruin up between the areas right below and right above it. These two gadgets are acknowledged because the “banking routine desk” and the “unofficial soar desk”.

  • $FCF1: CARTRIDGE_IRQ
  • $FCF4: PHOENIX
  • $FCF7: LONG_FETCH
  • $FCFA: LONG_JUMP
  • $FCFD: LONG_IRQ
  • $FF49: DEFKEY – program characteristic key
  • $FF4C: PRINT – print string
  • $FF4F: PRIMM – print string following the caller’s code
  • $FF52: MONITOR – enter machine code video show

The DEFKEY name has the same functionality as FUNKEY ($FF75) name of the CBM-II series, but the 2 take hang of varied arguments.

C128 (1985)

The Commodore 128 is the successor of the C64. Subsequent to a A hundred% like minded C64 mode that historical the distinctive ROMs, it has a local C128 mode, which is in line with the C64 (no longer the CBM-II or the 264), so all KERNAL vectors and calls are like minded with the C64, but there are additions.

The KERNAL vectors are the same as on the C64, but any other time, the USRCMD vector (on the VIC-20/C64 field of $032E) is historical for advise input in the machine code video show. There are additional vectors starting at $0334 for hooking editor common sense as smartly as tricks to keyboard decode tables, but these are no longer segment of the KERNAL vectors, since the VECTOR and RESTOR calls don’t consist of them.

The role of KERNAL calls has been extended by 19 entries. The LKUPLA and LKUPSA calls from the CBM-II exist (on myth of BASIC has disk instructions), but they are at varied locations:

  • $FF59: LKUPLA
  • $FF5C: LKUPSA

There are also a few calls acknowledged from the Plus/Four, but at varied addresses:

  • $FF65: PFKEY – program a characteristic key
  • $FF7D: PRIMM – print string following the caller’s code
  • $FF56: PHOENIX – init characteristic cartridges

And there are one more 14 totally new ones:

  • $FF47: SPIN_SPOUT – setup posthaste serial ports for I/O
  • $FF4A: CLOSE_ALL – shut all data on a instrument
  • $FF4D: C64MODE – reconfigure map as a C64
  • $FF50: DMA_CALL – send advise to DMA instrument
  • $FF53: BOOT_CALL – boot load program from disk
  • $FF5F: SWAPPER – switch between 40 and Eighty columns
  • $FF62: DLCHR – init Eighty-col character RAM
  • $FF68: SETBNK – role bank for I/O operations
  • $FF6B: GETCFG – look up MMU data for given bank
  • $FF6E: JSRFAR – gosub in one more bank
  • $FF71: JMPFAR – goto one more bank
  • $FF74: INDFET – LDA (fetvec),Y from any bank
  • $FF77: INDSTA – STA (stavec),Y to any bank
  • $FF7A: INDCMP – CMP (cmpvec),Y to any bank

Interestingly, the C128 Programmer’s Reference E book states that all calls since the C64 “are namely for the C128 and as such may perhaps fair soundless no longer be regarded as as everlasting additions to the usual soar desk.

C65 (1991)

The C65 (also known as the C64X) used to be a deliberate successor of the C64 line of computers. Several hundred prerelease gadgets had been constructed, but it used to be below no circumstances released as a product. Love the C128, it has a C64 mode, but it is no longer backwards-like minded with the C128. Nonetheless, the KERNAL of the native C65 mode is in line with the C128 KERNAL.

Love the CBM-II, but at varied addresses, all IEE-488/IEC capabilities may perhaps smartly be zigzag with these eight new vectors:

  • $0335: ITALK – indirect entry to TALK ($FFB4)
  • $0338: ILISTEN – indirect entry to LISTEN ($FFB1)
  • $033B: ITALKSA – indirect entry to TKSA ($FF96)
  • $033E: ISECND – indirect entry to SECOND ($FF93)
  • $0341: IACPTR – indirect entry to ACPTR ($FFA5)
  • $0344: ICIOUT – indirect entry to CIOUT ($FFA8)
  • $0347: IUNTLK – indirect entry to UNTLK ($FFAB)
  • $034A: IUNLSN – indirect entry to UNLSN ($FFAE)

The C128 additions of the soar desk are on occasion supported, but three calls were removed and one has been added. The removed ones are DMA_CALL (REU red meat up), DLCHR (VDC red meat up) and GETCFG (MMU red meat up). All three are C128-sigh and would make no sense on the C65. The one addition is:

  • $FF56: MONITOR_CALL – enter machine code video show

The removals and addition causes the addresses of the following calls to change:

  • $FF4D: SPIN_SPOUT
  • $FF50: CLOSE_ALL
  • $FF53: C64MODE
  • $FF59: BOOT_CALL
  • $FF5C: PHOENIX
  • $FF5F: LKUPLA
  • $FF62: LKUPSA
  • $FF65: SWAPPER
  • $FF68: PFKEY
  • $FF6B: SETBNK

The C128-added KERNAL calls on the C65 can in no ability be known as like minded with the C128, since among the calls take hang of varied arguments, e.g. the INDFET, INDSTA, INDCMP calls take hang of the bank number in the 65CE02′s Z register. This reveals any other time that the C65 is no ability a successor of the C128, but one more successor of the C64.

Relationship Graph

The successorship of the Commodore eight bit computers is messy. Most had been merely religious successors and seldom no doubt like minded. The KERNAL source code and the decisions of the soar desk largely be aware the successorship path, but some KERNAL choices and soar desk calls carried over between branches.

Which entries are capable?

While it’s essential to write code that works on a pair of Commodore eight bit machines, this desk will reduction:

PET

VIC-20

C64
C128
C65
Plus4

CBM-II

$FF80

KERNAL Model

$FF81

CINT

$FF84

IOINIT

$FF87

RAMTAS

$FF8A

RESTOR

$FF8D

VECTOR

$FF90

SETMSG

$FF93

SECOND

$FF96

TKSA

$FF99

MEMTOP

$FF9C

MEMBOT

$FF9F

SCNKEY

$FFA2

SETTMO

$FFA5

IECIN

$FFA8

IECOUT

$FFAB

UNTLK

$FFAE

UNLSN

$FFB1

LISTEN

$FFB4

TALK

$FFB7

READST

$FFBA

SETLFS

$FFBD

SETNAM

$FFC0

OPEN

$FFC3

CLOSE

$FFC6

CHKIN

$FFC9

CHKOUT

$FFCC

CLRCHN

$FFCF

BASIN

$FFD2

BSOUT

$FFD5

LOAD

$FFD8

SAVE

$FFDB

SETTIM

$FFDE

RDTIM

$FFE1

STOP

$FFE4

GETIN

$FFE7

CLALL

$FFEA

UDTIM

$FFED

SCREEN

$FFF0

PLOT

$FFF3

IOBASE

Code that must work on all Commodore eight bit computers (with out detecting the sigh machine) is little to the following KERNAL calls which may be supported from the first PET as a lot as the C65:

  • $FFCF: BASIN – gain character
  • $FFD2: BSOUT – write character
  • $FFE1: STOP – take a look at for STOP key
  • $FFE4: GETIN – gain character from keyboard

The CHKIN, CHKOUT, CLRCHN, CLALL and UDTIM can be accessible, but they must no longer functional, since they are missing their counterparts (opening a file, hooking an interrupt) on the PET. The UDTIM name can be accessible too, but there isn’t this form of thing as a usual ability to hook the timer interrupt must you consist of the PET.

Nonetheless, the four fundamental calls are ample for any text mode application that doesn’t care the build the twin carriageway breaks are. Present that the PETSCII graphical character role and the fundamental PETSCII advise codes e.g. for transferring the cursor are supported at some level of the entire family.

While that you shall be limiting your self to the VIC-20 and above (i.e. except for the PET but including the CBM-II), that you may enlighten the fundamental of 34 calls starting at $FF90.

You may perhaps handiest enlighten these two vectors though – must you’re k with altering them manually with out going thru the VECTOR name in say to red meat up the CBM-II:

  • $0314: CINV – IRQ handler
  • $0316: CBINV – BRK handler

VECTOR and RESTOR are supported on the entire home computer series (i.e. must you exclude the PET and the CBM-II), and the entire role of Sixteen vectors may perhaps smartly be historical on all home computers except the Plus/Four.

The initialization calls (CINT, IOINIT, RAMTAS) exist on all home computers since the C64. In addition to, all these machines possess the version of the KERNAL at $FF80.

References

Be taught Extra

(Visité 30 fois, 1 aujourd'hui)

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *