Author Topic: boot_call disk commands  (Read 343 times)

0 Members and 1 Guest are viewing this topic.

Offline doppelheathen

  • Windows user
  • *
  • Posts: 8
  • Activity:
    0%
  • Reputation: 0
  • With us since: 01/05/2011
    YearsYears
    • View Profile
boot_call disk commands
« on: May 17, 2012, 05:57 AM »
So I've been studying the C128 ROMs on the side on and off, and I haven't gotten very far yet, but right now I'm working on the BOOT_CALL kernal routine.  I'm confused about one of the things that gets sent to the disk drive.  Here's the snippet of code I'm looking at:

Code: [Select]
lda #$01
ldx #$15      ;set filename length and pointer
ldy #$fa
jsr $f731    ;update filename
lda #$00
ldy #$0f      ;set file number 0, device number 8 and address 15
ldx $ba
jsr $f738   ;update numbers
jsr $ffc0     ;do an open 0,8,15,"I" to send init command
bcs $f8eb     ;branch if error
lda #$01
ldx #$16      ;set new pointer
ldy #$fa
jsr $f731    ;update filename
lda #$0d
tay           ;set file number 13 and address 13
ldx $ba
jsr $f738   ;update numbers
jsr $ffc0     ;do an open 13,8,13 to send...a hash mark???
(code continues here)

at $fa15 there is this:
.db "I#"


So far as I can tell, an initialize command is being sent on channel 15 to the disk drive.  That makes sense.  What doesn't make sense is the next command, a hash mark.  According to the Mapping the 128, it is only described as a "channel number" command, but I can't find any information on such a command on any 1571 docs that I've read.

The only thing I can figure, being that it's doing an OPEN on channel 13 instead of 15, is that it isn't really a command at all, but some sort of dummy filename.  Is there anyone that can confirm my observations?  Or if I'm wrong, what's really going on here?

Offline Hydrophilic

  • 128D user
  • *******
  • Posts: 1214
  • Age: 41
  • Location: Earth... still!
  • Activity:
    0%
  • Reputation: 232
  • Gender: Male
  • With us since: 25/01/2007
    YearsYearsYearsYearsYearsYears
    • View Profile
    • H2Obsesson
Re: boot_call disk commands
« Reply #1 on: May 18, 2012, 02:01 AM »
It is opening a direct access channel, also known as sector buffer.  There are two formats for this disk command:
#
or
#n
 
where n is a value 0 to MAX.  I believe MAX is 5 for 1541/71, and 30? for 1581, who knows about CMD-HD?
 
If no number follows #, then the drive will choose one.
 
The sector buffer is used for block-read commands used next by KERNAL.  Actually it uses the "replacement" U1 command instead of the original/buggy B-R command.
I'm kupo for kupo nuts!

Offline doppelheathen

  • Windows user
  • *
  • Posts: 8
  • Activity:
    0%
  • Reputation: 0
  • With us since: 01/05/2011
    YearsYears
    • View Profile
Re: boot_call disk commands
« Reply #2 on: May 18, 2012, 05:52 AM »
Figures.  I kept looking over the 1571 texts, trying to find something, and surely enough, I don't actually end up finding it until after I read your post.  I still can't believe I missed the section in the 1571 manual about opening a direct access channel.  Thanks, that clears everything up! :-)

 



Back to top