Re: C128 Inter-Bank SYS call?
- From: rusure <r_u_sure@xxxxxxxxxxxxxxx>
- Date: Sat, 7 Jun 2008 14:47:37 -0700 (PDT)
On May 24, 3:08 pm, Harry Potter <maspethro...@xxxxxxx> wrote:
Let's say I'm in a function ROM on a C128 and I want to call a BASIC
or kernal routine when it's not visible. I tried calling the code at
$02CD, but it requires the kernal to be visible. I am currently using
the following code to call the BASIC CLR routine, but it breaks into
the monitor:
;Call BASIC CLR routine so that new BASIC memory cfg. takes hold.
ldx #$0F ;MMU cfg. for BASIC/kernal ROMs/IO
stx $02
lda #$F8 ;Address of routine.
sta $03
lda #$51
sta $04
jsr $02CD ;BANK call.
Earlier in the subroutine, I wrote #$06 to address $FF00 to make the
kernal and my ROM visible. Am I missing something?
If you need to call a program in another bank, than the subroutine at
$02CD (or the KERNAL ROUTINE at JSRFAR) should do the memory
management for you without confusing the program by storing a value in
the MMU($FF00). JSRFAR usage is documented in the COMMODORE 128
PTOGRAMMER'S REFERENCE GUIDE page 453 and 454. Download the C128 PRG
from :
http://www.devili.iki.fi/pub/Commodore/docs/books/
If your calling and target routines aren't in a standard bank
configuration, then a call to JSRFAR can't be used, and a nonstandard
value needs to be stored in the MMU
In the December 1991 issue of COMPUTE, in the DAZETTE section page
G25, a BANK configuration aid program appeared. The disk image can be
downloaded from :
ftp://arnold.c64.org/pub/magazines/Gaz-Type/
For a bank configuration register value of #6, the confusing output
looks something like:
$0000 $FFFF
RAM 0 (BASIC program text)
$C000 $FFFF
SYSTEM ROM
$8000 $BFFF
MID internal (user EPROM) ROM
$4000 $7FFF
Exposed RAM
$D000 $DFFF
I / O devices
This is equivalent to BANK 12
The program can assist in selecting another memory configuration value
if the above configuration is inappropriate for your needs.
.
- Prev by Date: Re: Diagnosing a C64 problem
- Next by Date: Re: Is the X1541 shop down?
- Previous by thread: Re: C128 Inter-Bank SYS call?
- Next by thread: On the subject of 64HDD - I seem to have a new problem.
- Index(es):
Relevant Pages
|