[net.micro.cbm] machine load problem

kwf@ncsu.UUCP (01/31/86)

Recently, I discovered a malfunction in my c64.  I'm stumped as to what
could be causing it, and would appreciate some help.  The story goes like this:

I turned on my c64 and typed LOAD "PRT",8,1.

Prt is a simple routine which prints the current screen contents to the
printer.

The program loaded correctly at $c000.  However, the c64 also sets the
end of basic pointers (start of variable space) to the last address loaded,
namely, $c0d4.

I then typed "10 REM" and hit return, the system prints an OUT OF MEMORY
error, because the basic pointers are corrupt.

Basic programs still load and run perfectly on the computer.
In fact, I've found no other problems other than the one above.

I conducted the following steps to try to discover the problem:

1) First, I tried loading a another ml program, thinking that "PRT" might
be totally screwed.  Every ml program I tried gave the save results.
I also turned the c64 off and on to clear memory each time.

2) Then I connected my c64 to a friend's 1571, but the problem remained.

I tried to think of why one and only one command would stop working on a
computer system.

If it were a hardware problem, other commands would mostly likely fail
also.

3) Maybe a RAM location used by the load routine is burned-out!  I wrote a
ml program to test the ram from $0002 to $0800 by writing first $00, then
$FF, checking to be sure that the location wrote correctly.  All the ram
checked-out ok.

I have not checked the ram from $0800 to $ffff.  I'll try that tonight.

*** Does the kernal or basic use any memory in this space? ***

4) By this point, I was at a loss.  My next thought was that possibly a
ROM location in the kernal or basic load routines had been damaged by a
static discharge or something (although losing only one or a few locations is
very unlikely).  However, I dumped the entire ROM contents to disk and 
compared them to the contents of my neighbors c64.  They matched perfectly!

**********************************************************

Summary of the problem:

1 - ML loads reset the basic pointers as if they were basic loads.
2 - Basic loads work normally.
3 - Basic and ML programs run normally.
4 - The disk drive is not the problem.

**********************************************************

For some the reason, the c64 doesn't seem to fully realize that the load
is a ml load, although it does load the program where it belongs.

I need help!!!!  If anyone can think of a reason why this would happen,
or know of a hardware problem that could cause it, PLEASE let me know by mail
of the net.



-- 
----------------------------------------

                    Kenneth Fernald
                    ...decvax!mcnc!ncsu!kwf

al@genrad.UUCP (Al Gudaitis) (02/04/86)

> Recently, I discovered a malfunction in my c64.  I'm stumped as to what
> could be causing it, and would appreciate some help.  The story goes like this:
> 
> I turned on my c64 and typed LOAD "PRT",8,1.
> 
> Prt is a simple routine which prints the current screen contents to the
> printer.
> 
> The program loaded correctly at $c000.  However, the c64 also sets the
> end of basic pointers (start of variable space) to the last address loaded,
> namely, $c0d4.
> 
> I then typed "10 REM" and hit return, the system prints an OUT OF MEMORY
> error, because the basic pointers are corrupt.
> 

There is nothing peculiar about your C64.  They ALL have this problem.  If one
disassembles BASIC in the area of the LOAD command, one discovers that the end
of program pointer always gets updated to point to the last memory location
loaded, even if it is a machine language program (BASIC makes no distinction).
If the program loaded below $A000, the problem usually won't even be noticed
though the amount of memory available for variables could be drastically
reduced.  With program loads above the "normal" top of memory used by BASIC,
there will be problems with trying to type in program lines or creating
variables because the "end of program" and "variable area" pointers will be in
the wrong order which BASIC interprets as an OUT OF MEMORY error.  I forget
how I came across the problem exactly, but try typing something like:

A$="TEST"

after your program load and I think you will see the same OUT OF MEMORY
message.

joels@tekred.UUCP (Joel Swank) (02/04/86)

> Recently, I discovered a malfunction in my c64.  I'm stumped as to what
> could be causing it, and would appreciate some help.  The story goes like this:
> 
> I turned on my c64 and typed LOAD "PRT",8,1.
> 
> Prt is a simple routine which prints the current screen contents to the
> printer.
> 
> The program loaded correctly at $c000.  However, the c64 also sets the
> end of basic pointers (start of variable space) to the last address loaded,
> namely, $c0d4.

There is nothing wrong with your C64. This is the way it works. The ',1' on
the LOAD only keeps the file from being relocated to the BASIC buffer.
It is not an 'ML' load. To restore the BASIC pointers after the load,
just type 'NEW' and everything will be normal.

Joel Swank
Tektronix, Redmond Oregon