I can't load a bin file , load pal can yes.

All aspects of programming on the Commander X16.
Post Reply
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

I can't load a bin file , load pal can yes.

Post by funkheld »

Hi good afternoon.

I can't load a bin file.
What kind of address does this store have to have in the bin?
Pal files can be loaded.

does a head have to go there please?

pal :
00 00 FF 0F 08 00 FA 0E 4C 0C C0 05 00 0A EE 07.......

bin:
3C 66 6E 6E 60 62 3C 00 00 00 3C 06 3E 66 3E 00

Thanks.
greeting

------------------------------------
procedure veraCharLoad(filename: String); assembler;
asm
phx
lda #1; // logical file number
ldx #8; // device number
ldy #2; // doing bvload
jsr SETLFS

lda #<(adr.filename+1)
sta r12L
lda #>(adr.filename+1)
sta r12H

lda adr.filename
// get pointer into x,y registers
ldx r12L
ldy r12H
jsr SETNAM

lda #3; // BVLOAD
ldx #$00
ldy #$f0
jsr LOAD
plx
end;
------------------------------------
User avatar
ahenry3068
Posts: 1146
Joined: Tue Apr 04, 2023 9:57 pm

Re: I can't load a bin file , load pal can yes.

Post by ahenry3068 »

funkheld wrote: Sun Apr 07, 2024 7:57 am Hi good afternoon.

I can't load a bin file.
What kind of address does this store have to have in the bin?
Pal files can be loaded.

does a head have to go there please?

pal :
00 00 FF 0F 08 00 FA 0E 4C 0C C0 05 00 0A EE 07.......

bin:
3C 66 6E 6E 60 62 3C 00 00 00 3C 06 3E 66 3E 00

Thanks.
greeting

------------------------------------
procedure veraCharLoad(filename: String); assembler;
asm
phx
lda #1; // logical file number
ldx #8; // device number
ldy #2; // doing bvload
jsr SETLFS

lda #<(adr.filename+1)
sta r12L
lda #>(adr.filename+1)
sta r12H

lda adr.filename
// get pointer into x,y registers
ldx r12L
ldy r12H
jsr SETNAM

lda #3; // BVLOAD
ldx #$00
ldy #$f0
jsr LOAD
plx
end;
------------------------------------
In BASIC you have LOAD (Skips first 2 bytes, uses them as Load Address) BLOAD (Does Not Skip the first 2 bytes, Address is specified in the Command).

At the ROM level they both call load.

The behaviour is determined by the .Y value in the previous call to SETLFS

0 - LOAD Uses .X, .Y address, skips first 2 bytes
1- LOAD Uses first 2 bytes in the file as the LOAD address, Does not load them
2- LOAD Loads entire File to the address in .X, .Y (BLOAD behavior)

THIS is in the SETLFS call prior to LOAD. Not the call to LOAD.
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

Re: I can't load a bin file , load pal can yes.

Post by funkheld »

hello, thanks for info.
I keep forgetting that.

greeting.
Post Reply