08.04.2013 Views

Your Commodore - Commodore Is Awesome

Your Commodore - Commodore Is Awesome

Your Commodore - Commodore Is Awesome

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

U<br />

assembler n entering machine code data<br />

is l a real problem. Since machine code<br />

is<br />

e<br />

simply a series of numbers, entering<br />

them into your computer leads to all<br />

sorts<br />

s<br />

of errors, resulting in your<br />

program's s total inability to functions.<br />

y <strong>Your</strong> <strong>Commodore</strong> uses Basic<br />

loaders o to help people to enter<br />

machine u code programs from the<br />

magazines.<br />

h<br />

These Basic loaders hold<br />

the numbers that make up the machine<br />

code<br />

a<br />

program in a line of data, the last<br />

number v being a checksu in. The Loader<br />

program e when RUN, reads the DATA<br />

into a memory, adding each number<br />

together, c then the total of each line is<br />

compared c with its checksum, if they<br />

are<br />

e<br />

not the same then you have done<br />

something wrong.<br />

s In the March 1986 issue of <strong>Your</strong><br />

<strong>Commodore</strong> s we printed a Basic<br />

program t for the 64 (Datamaker) that<br />

would o read a machine code file from<br />

disk a and generate a machine code<br />

program.<br />

n<br />

This worked fine except for a<br />

couple of small problems. Firstly the<br />

program was very slow. Secondly, you<br />

had to have a disk drive to use it.<br />

With this article we are printing<br />

two new machine code to data<br />

statement conversion programs. One<br />

of them is for the C64 but this time the<br />

program is written in machine code<br />

and will now take machine code from<br />

memory as well as from disk. The<br />

second program is for the Cl28, this<br />

program isn't quite as fast as the one<br />

for the C64 but it does have the<br />

advantage that it generates its own<br />

SAVE routine at the end of the data so<br />

that, when RUN, the program will<br />

SAVE the machine code on to disk.<br />

C64 Data Maker<br />

As I mentioned earlier, this version of<br />

the data maker program is better than<br />

the old one. A further facility that has<br />

been added is an extra check in the<br />

C64 AND C1281 CI<br />

Datamaker<br />

Turn your machine code into Data with these two<br />

programs from M. Catley and K. °non.<br />

loader program. If, in the old version<br />

of the program, you omitted a number<br />

from a line of DATA, the computer<br />

would read the checksum and try to<br />

POKE it into memory. Since the<br />

checksum is usually greater than 255<br />

this resulted in an illegal quantity error<br />

in the line that held the POKE<br />

statement.<br />

This new version of the program<br />

has a check that stops the program if<br />

the number to be POKEd into memory<br />

is greater than 255, giving the line from<br />

which the DATA was read, not the line<br />

of the POK E statement. As you can see<br />

this makes finding typing errors even<br />

easier.<br />

The CM Datamaker is presented<br />

here in the form of a Basic loader. In<br />

fact the program was used to make this<br />

loader.<br />

As already mentioned this is a<br />

machine code file that should be<br />

WADed and RUN at memory location<br />

49152 ($C000 hex).<br />

To start the program you enter the<br />

following commands:<br />

NEW<br />

SYS 49152<br />

As soon as you press RETURN the<br />

screen will clear and a promt 'INSERT<br />

READER PROGRAM Y/N' will<br />

appear. If yes is selected the simple<br />

loader program shown in Figure I will<br />

be entered into memory.<br />

Data maker will work out the last<br />

line of any program already in<br />

YOUR COMMODORE november 1986:76<br />

memory, add 10 to it and start its own<br />

numbering from there. This allows<br />

DATA statements to be added on to<br />

an existing program.<br />

Once the reader has been entered<br />

or if no (N) was selected a second<br />

prompt •SELECT DISK OR<br />

MEMORY' will be displayed.<br />

If MEMORY is selected further<br />

prompts for start and end addresses<br />

will be displayed. These numbers may<br />

be entered in decimal or in hex by<br />

prefixing the number with a dollar<br />

sign.<br />

If DISK is selected a filename will<br />

be requested.<br />

Once the end has been reached<br />

Data Maker will insert the number of<br />

blocks, line number and memory start<br />

address into the reader part (only if the<br />

reader was entered of course.) It will<br />

then return to Basic with the READY<br />

prompt.<br />

Data Maker 128<br />

Data Maker 128 is a utility program<br />

for the C128 computer with a disk<br />

drive. The program will take any file,<br />

the SOURCE program, from the disk,<br />

convert it into DATA statements and<br />

write it back to the disk under a<br />

supplied filename, the TARGET<br />

program. You will also be requested to<br />

supply a START LINE NUMBER and<br />

an increment value for the DATA<br />

STATEMENTS. Twenty individual

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!