Author Topic: Write BIN file to DSK  (Read 223 times)

0 Members and 1 Guest are viewing this topic.

Offline SkulleateR

  • 464 Plus
  • *****
  • Posts: 471
  • Country: de
    • Awards
Write BIN file to DSK
« on: 14:13, 27 May 21 »
Ok, I'm doing some testing here in ASM but I cannot write a BIN file to DSK it seems ....


The code is very simple :


Code: [Select]
org &4000
ld a,99
ld (&4FFF),a
ret


So, if I assemble it, everythings fine, I can also call it from basic and execute it, but I cannot write the bin file on the DSK ... what I tried :


1.) put a WRITE"B:TEST.BIN" in the asm code
2.) assemble it and in basic do a SAVE"B:TEST.BIN",B,&4000


Now if I try to load it from disk it ALWAYS gives me "Memory Full" Error ??? Help ...

like
0
No reactions

Offline arnolde

  • CPC464
  • **
  • Posts: 21
  • Country: at
    • Awards
Re: Write BIN file to DSK
« Reply #1 on: 14:16, 27 May 21 »
Yes, you have to tell Basic first to make space for your binary by typing
MEMORY &3FFF
(3FFF being destination of bin - 1)
« Last Edit: 14:31, 27 May 21 by arnolde »
like
0
No reactions

Offline arnolde

  • CPC464
  • **
  • Posts: 21
  • Country: at
    • Awards
Re: Write BIN file to DSK
« Reply #2 on: 14:21, 27 May 21 »

But I just realized that your problem occurs when saving the bin. And that's because you have to specify the size of your program. In your case, I guess it's 6 bytes, so:
SAVE"B:TEST.BIN",B,&4000,6

(The "memory" bit is what you will need when loading...)
« Last Edit: 14:33, 27 May 21 by arnolde »
like
0
No reactions

Offline SkulleateR

  • 464 Plus
  • *****
  • Posts: 471
  • Country: de
    • Awards
Re: Write BIN file to DSK
« Reply #3 on: 14:38, 27 May 21 »
Yes, you have to tell Basic first to make space for your binary by typing
MEMORY &3FFF
(3FFF being destination of bin - 1)


Thx, got nearly no sleep for 3 days now, guess my brain already begins to melt  :picard: :picard: :picard:


Quote
But I just realized that your problem occurs when saving the bin. And that's because you have to specify the size of your program. In your case, I guess it's 6 bytes, so:SAVE"B:TEST.BIN",B,&4000,6(The "memory" bit is what you will need when loading...)


Yes, did that, just forgot to post it above .... but anyway -> SOLVED  :laugh:
« Last Edit: 14:40, 27 May 21 by SkulleateR »
like
0
No reactions