Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Digital Archaeology » Computer Arcana » Commodore » Commodore 8-bit » C64 LOAD/RUN from ML upon exit?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
C64 LOAD/RUN from ML upon exit? [message #270812] Thu, 16 October 2014 13:21 Go to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
I am working on a program for cc65 called DirMenu. It is a menu program for some CBM models (the most popular ones) that allows the user to select a program to run. An earlier version is on the cc65 contribs site. Right now, the C64 and C16 versions should both fit into 8 blocks. However, I still want to continue optimizing it. I am thinking that, for the C64 version, writing a LOAD/RUN series to the keyboard would cut down on the number of characters that need to be written to the screen, thereby cutting down the program size by a few bytes. How do I do this?
Re: C64 LOAD/RUN from ML upon exit? [message #271111 is a reply to message #270812] Tue, 21 October 2014 08:52 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
On Thursday, October 16, 2014 1:21:54 PM UTC-4, Harry Potter wrote:
> I am working on a program for cc65 called DirMenu. It is a menu program for some CBM models (the most popular ones) that allows the user to select a program to run. An earlier version is on the cc65 contribs site. Right now, the C64 and C16 versions should both fit into 8 blocks. However, I still want to continue optimizing it. I am thinking that, for the C64 version, writing a LOAD/RUN series to the keyboard would cut down on the number of characters that need to be written to the screen, thereby cutting down the program size by a few bytes. How do I do this?

I'm wondering if I'm unclear. I want to call the kernal routine of a C64 that writes the LOAD/RUN series to the screen when the Shift+Run/Stop keys are pressed. If I can execute this routine to help run the selected program, I won't need to write the RUN command myself or add two returns to the keyboard buffer to run the selected program. I'll just need to write the Load command and call the mentioned kernal routine just before exiting.
Re: C64 LOAD/RUN from ML upon exit? [message #271120 is a reply to message #271111] Tue, 21 October 2014 09:23 Go to previous messageGo to next message
Paul Förster is currently offline  Paul Förster
Messages: 415
Registered: April 2012
Karma: 0
Senior Member
Hi Joseph,

On 2014-10-21 12:52:47 +0000, Harry Potter said:
> On Thursday, October 16, 2014 1:21:54 PM UTC-4, Harry Potter wrote:
>> I am thinking that, for the C64 version, writing a LOAD/RUN series to
>> the keyboard would cut down on the number of characters that need to be
>> written to the screen, thereby cutting down the program size by a few
>> bytes. How do I do this?
> I want to call the kernal routine of a C64 that writes the LOAD/RUN
> series to the screen when the Shift+Run/Stop keys are pressed.

there is AFAIK no such routine. AFAIK all the shift-run key combination
does is exactly that: Write the commands to the keyboard buffer. So you
either do that, or do it right by setting all necessary parameters and
call both routines from ML as they're supposed to. I wouldn't resort to
sort of hacks just to (unnecessarily!) save 4 bytes.
--
cul8er

Paul
paul.foerster@gmx.net
Re: C64 LOAD/RUN from ML upon exit? [message #271121 is a reply to message #271120] Tue, 21 October 2014 09:37 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
On Tuesday, October 21, 2014 9:23:28 AM UTC-4, Paul Förster wrote:
> there is AFAIK no such routine. AFAIK all the shift-run key combination
> does is exactly that: Write the commands to the keyboard buffer. So you
> either do that, or do it right by setting all necessary parameters and
> call both routines from ML as they're supposed to. I wouldn't resort to
> sort of hacks just to (unnecessarily!) save 4 bytes.
>
Thank you. I thought that there was a kernal routine that writes the commands to the keyboard buffer, saving from the RUN command and the necessary CRs to offset and the overhead to write two CRs to the keyboard buffer manually. I thought this would save at least 10 bytes. Thank you, anyway. :)
Re: C64 LOAD/RUN from ML upon exit? [message #271132 is a reply to message #271111] Tue, 21 October 2014 13:14 Go to previous messageGo to next message
rusure is currently offline  rusure
Messages: 1030
Registered: March 2012
Karma: 0
Senior Member
On Tuesday, October 21, 2014 6:52:47 AM UTC-6, Harry Potter wrote:
> On Thursday, October 16, 2014 1:21:54 PM UTC-4, Harry Potter wrote:
>
>> I am working on a program for cc65 called DirMenu. It is a menu program for some CBM models (the most popular ones) that allows the user to select a program to run. An earlier version is on the cc65 contribs site. Right now, the C64 and C16 versions should both fit into 8 blocks. However, I still want to continue optimizing it. I am thinking that, for the C64 version, writing a LOAD/RUN series to the keyboard would cut down on the number of characters that need to be written to the screen, thereby cutting down the program size by a few bytes. How do I do this?
>
>
>
> I'm wondering if I'm unclear. I want to call the kernal routine of a C64 that writes the LOAD/RUN series to the screen when the Shift+Run/Stop keys are pressed. If I can execute this routine to help run the selected program, I won't need to write the RUN command myself or add two returns to the keyboard buffer to run the selected program (by. I'll just need to write the Load command and call the mentioned kernal routine just before exiting.

There was a RUN C64 program to accelerate loads from 1571s & 1581s by Michael Miller. The user selected a program from a directory on the screen. I was more interested in the acceleration load code rather than the directory loading portion of the program. It's probably in the December 1989 issue Page 44.
Re: C64 LOAD/RUN from ML upon exit? [message #271138 is a reply to message #270812] Tue, 21 October 2014 15:10 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: Frank Buss

Harry Potter wrote:
> I am working on a program for cc65 called DirMenu. It is a menu
> program for some CBM models (the most popular ones) that allows the
> user to select a program to run.

There are already some of these programs, with full source code
released. In assembler:

http://www.vic20.it/cbmfilebrowser/

In C for CC65:

http://cbmcommand.codeplex.com/releases/view/113590

http://www.mobilefx.de/html/dracopy.html (DraBrowse)

The projects support different platforms, some are C64, C128, Plus4, CBM
610, PET 8096 and VIC20. You might find what you are searching for in
the source code.

--
Frank Buss, http://www.frank-buss.de
C64 MIDI interface, preorder: http://www.frank-buss.de/c64/midi/buy.html
Re: C64 LOAD/RUN from ML upon exit? [message #271167 is a reply to message #271132] Tue, 21 October 2014 18:58 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
On Tuesday, October 21, 2014 1:14:39 PM UTC-4, rusure wrote:
> There was a RUN C64 program to accelerate loads from 1571s & 1581s by Michael Miller. The user selected a program from a directory on the screen. I was more interested in the acceleration load code rather than the directory loading portion of the program. It's probably in the December 1989 issue Page 44.

It seems that the mentioned program beats my DirMenu program by offering accelerated loads. Of course, my program only requires only 8 blocks for the C64 and C16 and 9 blocks for the C128. Is that at least something? Is DirMenu still worth pursuing?
Re: C64 LOAD/RUN from ML upon exit? [message #271248 is a reply to message #271167] Wed, 22 October 2014 17:40 Go to previous messageGo to next message
rusure is currently offline  rusure
Messages: 1030
Registered: March 2012
Karma: 0
Senior Member
On Tuesday, October 21, 2014 4:58:57 PM UTC-6, Harry Potter wrote:
> On Tuesday, October 21, 2014 1:14:39 PM UTC-4, rusure wrote:
>> There was a RUN C64 program to accelerate loads from 1571s & 1581s by Michael Miller. The user selected a program from a directory on the screen. I was more interested in the acceleration load code rather than the directory loading portion of the program. It's probably in the December 1989 issue Page 44.
>
> It seems that the mentioned program beats my DirMenu program by offering accelerated loads. Of course, my program only requires only 8 blocks for the C64 and C16 and 9 blocks for the C128. Is that at least something? Is DirMenu still worth pursuing?

You can download a ReRun disk image from

ftp://arnold.c64.org/pub/magazines/

for details like the program's disk space requirements.
The program only accelerates loads from 71s & 81s. It doesn't effect loads from 1541s, its clones, or any CMD drive. All I was interested in was the load accelerator. I found loading from long directories nearly useless. For those you may want to program a paging feature with something like 20 directory entries per page and a capability to page through a directory until the entry to be loaded is displayed.

In January 1990 COMPUTE GAZETTE published an accelerator for the 1581. The RUN's program had a wider selection of drives to accelerate loads from. Be careful when loading from 1571s. The program stores code in the 1571 which normally contains disk systems information. Prior to exiting the accelerator, my program issues a drive I0 command.
Re: C64 LOAD/RUN from ML upon exit? [message #271350 is a reply to message #271248] Fri, 24 October 2014 02:10 Go to previous messageGo to next message
rusure is currently offline  rusure
Messages: 1030
Registered: March 2012
Karma: 0
Senior Member
On Wednesday, October 22, 2014 3:40:32 PM UTC-6, rusure wrote:
> On Tuesday, October 21, 2014 4:58:57 PM UTC-6, Harry Potter wrote:
>> On Tuesday, October 21, 2014 1:14:39 PM UTC-4, rusure wrote:
>>> There was a RUN C64 program to accelerate loads from 1571s & 1581s by Michael Miller. The user selected a program from a directory on the screen. I was more interested in the acceleration load code rather than the directory loading portion of the program. It's probably in the December 1989 issue Page 44.
>>
>> It seems that the mentioned program beats my DirMenu program by offering accelerated loads. Of course, my program only requires only 8 blocks for the C64 and C16 and 9 blocks for the C128. Is that at least something? Is DirMenu still worth pursuing?
>
> You can download a ReRun disk image from
>
> ftp://arnold.c64.org/pub/magazines/
>
> for details like the program's disk space requirements.
> The program only accelerates loads from 71s & 81s. It doesn't effect loads from 1541s, its clones, or any CMD drive. All I was interested in was the load accelerator. I found loading from long directories nearly useless. For those you may want to program a paging feature with something like 20 directory entries per page and a capability to page through a directory until the entry to be loaded is displayed.
>
> In January 1990 COMPUTE GAZETTE published an accelerator for the 1581. The RUN's program had a wider selection of drives to accelerate loads from. Be careful when loading from 1571s. The program stores code in the 1571 which normally contains disk systems information. Prior to exiting the accelerator, my program issues a drive I0 command.

With the arrival of my mew USB <---> serial cable, I was able to transfer the relevant ReRun disk image from my PC to my Commodore 128D. The directory speed loader (DSL) on the disk works as described by loading and running programs from directories printed on a screen, and accelerates loads from 1571 or 1581 directories, but secondary load operations are not accelerated. I am certain that my modification accelerates all 71 & 81 loads. I setup my C64 assembler system to be loaded at accelerated speeds from a 1581 disk. Although, I could have used a COMPUTE GAZETTE 1581 accelerator, I wanted accelerated loads from my 1571 internal drive from my C128D. I am almost positive that DSL could be modified to use or ignore my accelerator modification. I only brought up the RUN program because you need a directory loading operation that is part of the original RUN program. You might be better off using JIFFYDOS to accelerate loads from 1581 internal drives on your C65.
Re: C64 LOAD/RUN from ML upon exit? [message #271356 is a reply to message #271350] Fri, 24 October 2014 06:51 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
I already created the program, DirMenu. It is more minimal than the ones you described. However, the C64 and C16 versions take up only 8 blocks each.. DirMenu was designed for the 1541 and should work on the 1571. Also, DirMenu displays the first 40 programs found. Do these mean anything?
Re: C64 LOAD/RUN from ML upon exit? [message #271425 is a reply to message #271356] Fri, 24 October 2014 19:45 Go to previous messageGo to next message
rusure is currently offline  rusure
Messages: 1030
Registered: March 2012
Karma: 0
Senior Member
On Friday, October 24, 2014 4:51:34 AM UTC-6, Harry Potter wrote:
> I already created the program, DirMenu. It is more minimal than the ones you described. However, the C64 and C16 versions take up only 8 blocks each. DirMenu was designed for the 1541 and should work on the 1571. Also, DirMenu displays the first 40 programs found. Do these mean anything?

I need to rescue my 1541 II from the bottom of of my Bermuda triangle.

I compared conventional & the RUN program loads of the 111 sector STEREOPLAYERV10 on the internal 1571 in my C128D and from a Creative Micro Design's (CMD) 1541 hard drive partition. STEREOPLAYER loads and runs like a C64 BASIC program. In addition, STEREOPLAYER loads in turn audio, text, and graphics files. The RUN program does not accelerate STEREOPLAYER loads on either of the 2 drives in this test. The only time the RUN program accelerates loads are those from a 1571 or a 1581 floppy disk directory. The RUN program LOADS and runs BASIC programs from all Commodore compatible drives but loads from drives other than 1571 or 1581 drives are never accelerated.

The C65 must have an 80 column screen and you must use both sides of your C65 screen to show 2 directory entry columns of 20 directory entries in each column. The C64 RUN program shows 1 directory column of about 20 directory entries.

I only introduced the RUN topic to add a possible additional directory loading method. The RUN accelerated loads are now obsolete and I would encourage the use of JIFFYDos for load acceleration needs.
Re: C64 LOAD/RUN from ML upon exit? [message #272540 is a reply to message #271425] Sat, 08 November 2014 10:45 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
DirMenu is for loading in BASIC programs from disk on a 1541/1571. It works on a C64, C16 and C128. Although the C128 has a burst mode, DirMenu has no other accelerator. I didn't check the C16 and C128 versions, but the C64 version is currently 1,983 bytes long. Besides that, the program displays programs in 2 columns of 20 programs each. Is this worth it?

BTW, it seems that DirMenu has been removed from the cc65 contribs site.
Re: C64 LOAD/RUN from ML upon exit? [message #272541 is a reply to message #272540] Sat, 08 November 2014 10:57 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
Missed something...! According to my calculations, writing LOAD/RUN to the keyboard using the kernal and just the LOAD arguments to the screen instead of the full LOAD/RUN commands to the screen and two Returns to the keyboard should save 12-14 bytes on the C64 version. I'm looking for the address of the C64 kernel function if it exists that writes this to the keyboard buffer--I couldn't find it in the Mapping book.
Re: C64 LOAD/RUN from ML upon exit? [message #272547 is a reply to message #272541] Sat, 08 November 2014 12:30 Go to previous messageGo to next message
Paul Förster is currently offline  Paul Förster
Messages: 415
Registered: April 2012
Karma: 0
Senior Member
Hi Joseph,

On 2014-11-08 15:57:03 +0000, Harry Potter said:
> I'm looking for the address of the C64 kernel function if it exists
> that writes this to the keyboard buffer--I couldn't find it in the
> Mapping book.

there is none (AFAIK). Start by looking where they key combination
SHIFT-RUN/STOP is processed. That will answer all your questions and
probably reveal that your undertaking to save a few bytes is in vain.
--
cul8er

Paul
paul.foerster@gmx.net
Re: C64 LOAD/RUN from ML upon exit? [message #272548 is a reply to message #272541] Sat, 08 November 2014 12:57 Go to previous messageGo to next message
Paul Förster is currently offline  Paul Förster
Messages: 415
Registered: April 2012
Karma: 0
Senior Member
Hi Jospeh,

On 2014-11-08 15:57:03 +0000, Harry Potter said:
> I'm looking for the address of the C64 kernel function if it exists
> that writes this to the keyboard buffer--I couldn't find it in the
> Mapping book.

ok, just played around a little. This merely prints

LOAD{CR}
RUN{CR}

to the screen. Here's the code:

*= $2000

loadrun = $ece7
strout = $ab1e

lda #<loadrun
ldy #>loadrun
jsr strout
... ; your other code here

hope this helps.
--
cul8er

Paul
paul.foerster@gmx.net
Re: C64 LOAD/RUN from ML upon exit? [message #272549 is a reply to message #272548] Sat, 08 November 2014 13:39 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
On Saturday, November 8, 2014 12:57:04 PM UTC-5, Paul Förster wrote:
> ok, just played around a little. This merely prints
>
> LOAD{CR}
> RUN{CR}
>
> to the screen. Here's the code:
>
> *= $2000
>
> loadrun = $ece7
> strout = $ab1e
>
> lda #<loadrun
> ldy #>loadrun
> jsr strout
> ... ; your other code here
>
> hope this helps.
>
Oh. :( I was looking for a magic JSR <write-code-to-keybuf> to write the string to the keyboard buffer. If you're right, that already kills four bytes. :( Let me check strout ($AB1E) at what it does.
Re: C64 LOAD/RUN from ML upon exit? [message #272555 is a reply to message #272549] Sat, 08 November 2014 14:05 Go to previous messageGo to next message
Paul Förster is currently offline  Paul Förster
Messages: 415
Registered: April 2012
Karma: 0
Senior Member
Hi Joseph,

On 2014-11-08 18:39:51 +0000, Harry Potter said:
>> strout = $ab1e
> Oh. :( I was looking for a magic JSR <write-code-to-keybuf> to write
> the string to the keyboard buffer. If you're right, that already kills
> four bytes. :( Let me check strout ($AB1E) at what it does.

$ab1e prints out a C string (zero terminated) at the address given in
A/Y as low/high.

And my short demo only prints, it does not execute!
--
cul8er

Paul
paul.foerster@gmx.net
Re: C64 LOAD/RUN from ML upon exit? [message #272556 is a reply to message #272549] Sat, 08 November 2014 14:28 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
On Saturday, November 8, 2014 1:39:54 PM UTC-5, Harry Potter wrote:
> Oh. :( I was looking for a magic JSR <write-code-to-keybuf> to write the string to the keyboard buffer. If you're right, that already kills four bytes. :( Let me check strout ($AB1E) at what it does.

I thank you for pointing out strout to me. It could help me out with CBMSimpleIO. However, I'm looking for a method to optimize the output of the load routine of DirMenu. Right now, the code for the C64 version to put the LOAD/SAVE commands on the screen, written in cc65 C/assembler and using CBMSimpleIO for screen writes, is as follows:
-------------------------------
//prints() writes a string to the screen, and prg is the program to run
prints ("\f\n\nlO\""); prints (prg);
prints ("\",8,1\n\n\n\n\n"
"rU\x13");
//Writes two returns to the keyboard buffer
*((char*)0xC6)=2; //# keys to write to buffer.
*((char*)0x277)=//13; //Write two Returns.
*((char*)0x278)=13;
------------------------------
My plan is something like this:
------------------------------
prints ("\f\n\nload\""); prints (prg);
prints ("\",8,1\x13");
writeloadrun(); //wrapper to write LOAD/RUN to the keyboard.
------------------------------
This way, I don't have to write the RUN after returns to the screen or fill the buffer manually.
Re: C64 LOAD/RUN from ML upon exit? [message #272566 is a reply to message #272556] Sat, 08 November 2014 17:23 Go to previous messageGo to next message
Paul Förster is currently offline  Paul Förster
Messages: 415
Registered: April 2012
Karma: 0
Senior Member
Hi Joseph,

On 2014-11-08 19:28:03 +0000, Harry Potter said:
> I thank you for pointing out strout to me. It could help me out with
> CBMSimpleIO. However, I'm looking for a method to optimize the output
> of the load routine of DirMenu. Right now, the code for the C64
> version to put the LOAD/SAVE commands on the screen, written in cc65
> C/assembler and using CBMSimpleIO for screen writes, is as follows:
> -------------------------------
> //prints() writes a string to the screen, and prg is the program to run
> prints ("\f\n\nlO\""); prints (prg);
> prints ("\",8,1\n\n\n\n\n"
> "rU\x13");
> //Writes two returns to the keyboard buffer
> *((char*)0xC6)=2; //# keys to write to buffer.
> *((char*)0x277)=//13; //Write two Returns.
> *((char*)0x278)=13;
> ------------------------------
> My plan is something like this:
> ------------------------------
> prints ("\f\n\nload\""); prints (prg);
> prints ("\",8,1\x13");
> writeloadrun(); //wrapper to write LOAD/RUN to the keyboard.
> ------------------------------
> This way, I don't have to write the RUN after returns to the screen or
> fill the buffer manually.

why not just copy the C string at $ece7 to the keyboard buffer? A call
for strcpy() or memcpy() may be way shorter than the massive printf()
code. Just a thought...
--
cul8er

Paul
paul.foerster@gmx.net
Re: C64 LOAD/RUN from ML upon exit? [message #272567 is a reply to message #272566] Sat, 08 November 2014 17:36 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
On Saturday, November 8, 2014 5:23:24 PM UTC-5, Paul Förster wrote:
> why not just copy the C string at $ece7 to the keyboard buffer? A call
> for strcpy() or memcpy() may be way shorter than the massive printf()
> code. Just a thought...

I'm not using printf(): it has proven to produce huge code. I'm using functions from my CBMSimpleIO library, mainly prints(), which prints a string to the screen directly through the kernal. However, the use of strcpy() might save a couple bytes in spite of the overhead of the function call. I'll try it now.
Re: C64 LOAD/RUN from ML upon exit? [message #272568 is a reply to message #272567] Sat, 08 November 2014 17:44 Go to previous messageGo to next message
Paul Förster is currently offline  Paul Förster
Messages: 415
Registered: April 2012
Karma: 0
Senior Member
Hi Joseph,

On 2014-11-08 22:36:12 +0000, Harry Potter said:
> I'm not using printf(): it has proven to produce huge code. I'm using
> functions from my CBMSimpleIO library, mainly prints(), which prints a
> string to the screen directly through the kernal. However, the use of
> strcpy() might save a couple bytes in spite of the overhead of the
> function call. I'll try it now.

also give memcpy() a try. Just for the sake of complete testing. ;-)
--
cul8er

Paul
paul.foerster@gmx.net
Re: C64 LOAD/RUN from ML upon exit? [message #272572 is a reply to message #272566] Sat, 08 November 2014 18:15 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
On Saturday, November 8, 2014 5:23:24 PM UTC-5, Paul Förster wrote:
> why not just copy the C string at $ece7 to the keyboard buffer? A call
> for strcpy() or memcpy() may be way shorter than the massive printf()
> code. Just a thought...
Thank you. You saved me 4 bytes. It's not much, but it counts to me.
Re: C64 LOAD/RUN from ML upon exit? [message #272573 is a reply to message #272568] Sat, 08 November 2014 18:24 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
On Saturday, November 8, 2014 5:44:08 PM UTC-5, Paul Förster wrote:
> also give memcpy() a try. Just for the sake of complete testing. ;-)

I doubt that this would help, as it would require an extra parameter and code that's not otherwise used, but I'll try it now.
Re: C64 LOAD/RUN from ML upon exit? [message #272574 is a reply to message #272568] Sat, 08 November 2014 18:36 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
On Saturday, November 8, 2014 5:44:08 PM UTC-5, Paul Förster wrote:
> also give memcpy() a try. Just for the sake of complete testing. ;-)

strcpy() and memcpy() broke even. But using this technique gave me 4 bytes.. :)
Re: C64 LOAD/RUN from ML upon exit? [message #272588 is a reply to message #272574] Sun, 09 November 2014 04:00 Go to previous messageGo to next message
Paul Förster is currently offline  Paul Förster
Messages: 415
Registered: April 2012
Karma: 0
Senior Member
Hi Harry,

On 2014-11-08 23:36:29 +0000, Harry Potter said:
> On Saturday, November 8, 2014 5:44:08 PM UTC-5, Paul Förster wrote:
>> also give memcpy() a try. Just for the sake of complete testing. ;-)
> strcpy() and memcpy() broke even. But using this technique gave me 4
> bytes. :)

wasn't your original intention to save a few bytes? Well, 4 is more
than 0. ;-) You're welcome.
--
cul8er

Paul
paul.foerster@gmx.net
Re: C64 LOAD/RUN from ML upon exit? [message #272592 is a reply to message #272548] Sun, 09 November 2014 04:51 Go to previous messageGo to next message
Somebody is currently offline  Somebody
Messages: 26
Registered: March 2012
Karma: 0
Junior Member
Il 08/11/2014 18:57, Paul Förster ha scritto:
>
> loadrun = $ece7

The code that takes the string at $ece7 and writes to the keyboard
buffer starts at $e5ee.

..C:e5ee A2 09 LDX #$09
..C:e5f0 78 SEI
..C:e5f1 86 C6 STX $C6
..C:e5f3 BD E6 EC LDA $ECE6,X
..C:e5f6 9D 76 02 STA $0276,X
..C:e5f9 CA DEX
..C:e5fa D0 F7 BNE $E5F3
..C:e5fc F0 CF BEQ $E5CD

The problem is, it is deeply integrated in the code that loops to listen
for key presses, and does not end with RTS. One solution could be to
reproduce these few bytes and replace the final instruction with RTS.
Re: C64 LOAD/RUN from ML upon exit? [message #272594 is a reply to message #272592] Sun, 09 November 2014 06:41 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
On Sunday, November 9, 2014 4:51:50 AM UTC-5, Somebody wrote:
> Il 08/11/2014 18:57, Paul Förster ha scritto:
>>
>> loadrun = $ece7
>
> The code that takes the string at $ece7 and writes to the keyboard
> buffer starts at $e5ee.
>
> .C:e5ee A2 09 LDX #$09
> .C:e5f0 78 SEI
> .C:e5f1 86 C6 STX $C6
> .C:e5f3 BD E6 EC LDA $ECE6,X
> .C:e5f6 9D 76 02 STA $0276,X
> .C:e5f9 CA DEX
> .C:e5fa D0 F7 BNE $E5F3
> .C:e5fc F0 CF BEQ $E5CD
>
> The problem is, it is deeply integrated in the code that loops to listen
> for key presses, and does not end with RTS. One solution could be to
> reproduce these few bytes and replace the final instruction with RTS.

Maybe I'll replace strcpy() with my own function. Thank you! :)
Re: C64 LOAD/RUN from ML upon exit? [message #272595 is a reply to message #272594] Sun, 09 November 2014 07:00 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
On Sunday, November 9, 2014 6:41:01 AM UTC-5, Harry Potter wrote:
> Maybe I'll replace strcpy() with my own function. Thank you! :)

It worked! I saved five bytes. :)
Re: C64 LOAD/RUN from ML upon exit? [message #272596 is a reply to message #272588] Sun, 09 November 2014 07:05 Go to previous messageGo to next message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
On Sunday, November 9, 2014 4:00:54 AM UTC-5, Paul Förster wrote:
> wasn't your original intention to save a few bytes? Well, 4 is more
> than 0. ;-) You're welcome.

Yes, it was, and I thank you for that. :)
Re: C64 LOAD/RUN from ML upon exit? [message #275055 is a reply to message #272592] Sun, 07 December 2014 09:25 Go to previous message
Harry Potter is currently offline  Harry Potter
Messages: 1304
Registered: March 2012
Karma: 0
Senior Member
On Sunday, November 9, 2014 4:51:50 AM UTC-5, Somebody wrote:
> Il 08/11/2014 18:57, Paul Förster ha scritto:
>>
>> loadrun = $ece7
>
> The code that takes the string at $ece7 and writes to the keyboard
> buffer starts at $e5ee.
>
Where does it start on the CBM264 series and the 128? OT: Now that I'm here, where is the kernal HOME routine on the Vic20 and the CBM264?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Official FAQ comp.binaries.cbm (semimonthly posting)
Next Topic: LOAD/RUN writer kernal location on C16?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Apr 19 14:00:34 EDT 2024

Total time taken to generate the page: 0.03108 seconds