Path: utzoo!attcan!uunet!lll-winken!lll-lcc!pyramid!cbmvax!hedley From: hedley@cbmvax.UUCP (Hedley Davis) Newsgroups: comp.sys.cbm Subject: Re: Loading machine language files. Keywords: ML loaded at $C000 Message-ID: <3995@cbmvax.UUCP> Date: 10 Jun 88 14:00:38 GMT References: <5449@ihlpg.ATT.COM> Reply-To: hedley@cbmvax.UUCP (Hedley Davis) Organization: Commodore Technology, West Chester, PA Lines: 37 In article <5449@ihlpg.ATT.COM> mnelson@ihlpg.ATT.COM (Nelson) writes: >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. The >program is loaded because if I break and type in a RUN at the next >line the program will work fine. The code looks like this: > > 10 LOAD "ML PROG AT $C000",8,1 > 20 POKE THE CIA REGS > 30 OTHER BASIC STUFF > 40 END > >If I put a PRINT statement at line 20 it will never be hit. Even >putting multiple statements on line 10 doesn't work. The extra >statements never get hit. > >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? > >Mike Nelson >ihnp4!ihlpg!mnelson > >AT&T Bell Labs Simple problem due to the wonders of Commodore basic. LOAD causes program to restart from beginning. If you didn't load over top of your basic program or its variables or stack ( as is the case with a $c000 load ), you can fix it like this. 10 IF A=0 then A=1: Load "xxx",8,1 The first time through, A=0, so it loads the ML. The second time through, A <> 0, so it skips the load. Hedley