Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!labrea!rutgers!mtunx!osu-cis!dsacg1!nfs0294 From: nfs0294@dsacg1.UUCP (Glendell R. Midkiff) Newsgroups: comp.sys.cbm Subject: Re: Loading machine language files. Message-ID: <466@dsacg1.UUCP> Date: 10 Jun 88 12:00:54 GMT References: <5449@ihlpg.ATT.COM> Organization: Defense Logistics Agency Systems Automation Center, Columbus Lines: 30 From article <5449@ihlpg.ATT.COM>, by mnelson@ihlpg.ATT.COM (Nelson): > I am writing a program that uses a ML routine at $C000. I know I have > seen programs that use LOAD statments to load other parts of the > program and then jumps off to them (boot programs, etc). However, > when I have the program try to load the ML routine it seems to loop on > that line, ei. it LED on the drive keeps going on and off. > Does anyone out there know a trick to get this to work, or do I have > to load the ML through DATA statements? Is the $C000 location the > problem? It has been a while since I did any programming on the C64 but I think I know what your problem is. When you do a LOAD from within a BASIC program, the system begins execution at the beginning after the load so you are looping between the beginning of your program and the LOAD instruction. The fix for this if I remember correctly is to use a switch to control the load. Use something like: 100 IF LOADSW$ = 0 THEN LOADSW$=1: LOAD "PRG",8,1 Like I said, it has been quite a while since I did this so the syntax may need some work, but you get the idea. You do not have to load from data statements, but you must specify the ,1 which will cause the code to be loaded into the same address it was saved from. Hope this helps.... -- |-----------------------------------------------------------------------| |Glen Midkiff cboscd!osu-cis!dsacg1!gmidkiff | | Phone: (614)-238-9643@DLA, Systems Automation Center, Columbus, Oh. | |-----------------------------------------------------------------------|