Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!ncar!gatech!emcard!mat From: mat@emcard.UUCP (Mat Waites) Newsgroups: comp.sys.cbm Subject: Re: Loading machine language files. Message-ID: <5657@emcard.UUCP> Date: 10 Jun 88 19:00:50 GMT References: <5449@ihlpg.ATT.COM> Reply-To: mat@emcard.UUCP (Mat Waites) Organization: Emory University Cardiac Data Bank Lines: 45 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 ... >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. > >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 The problem is that commodore basic is strange. Every LOAD is treated as if you are loading another basic program. The interpreter runs the basic program in memory from the beginning after the load is finished. Of course, in your case, it is the same basic program as you started with. You need a little kludgeyness to pull it off: 05 IF A = 1 THEN 20 07 A = 1 10 LOAD "ML PROG AT $C000",8,1 20 POKE THE CIA REGS 30 OTHER BASIC STUFF 40 END This way, A is 0 the first time through and the ML is loaded. When your program runs the second time, it skips the load. Mat ps - just get a Power C compiler and give up on basic -- W Mat Waites | PHONE: (404) 727-7197 Emory Univ Cardiac Data Bank | UUCP: ...!gatech!emcard!mat Atlanta, GA 30322 |