Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
FALL <strong>1980</strong><br />
THE APPLE ORCHARD<br />
PAGE 61<br />
LINKING MACHINE LANGUAGE<br />
ROUTINES TO APPLESOFT<br />
PROGRAMS<br />
Adding binary information or<br />
programs that load with an <strong>Apple</strong>soft<br />
program is fairly easy. This note<br />
will show how to hide a binary<br />
program that will follow the <strong>Apple</strong>soft<br />
program but won't show up on<br />
a LIST. One use for this techique is<br />
loading a program and it's shape<br />
table for creating Hi-Res images.<br />
When <strong>Apple</strong>soft lists a program it<br />
continues listing until it finds three<br />
hexadecimal zeros in a row.<br />
However, when the program is<br />
saved, <strong>Apple</strong>soft looks at the end of<br />
program pointer, $AF,BO.<br />
So to save machine language<br />
programs you need to:<br />
1. LOAD the <strong>Apple</strong>soft program<br />
2. Enter the monitor (CALL -151)<br />
3. Load the binary starting at the<br />
address pointed to by $AF,BO<br />
4. Change $AF,BO to point to the<br />
end of your binary program<br />
5. Re-enter <strong>Apple</strong>soft<br />
6. SAVE the combined program as<br />
a normal <strong>Apple</strong>soft program<br />
7. Reload the program before running<br />
it<br />
This works both with tape and<br />
disk. See <strong>Apple</strong>soft Renumber for<br />
an example.<br />
Using the machine language<br />
program is a little harder because it<br />
moves around in memory as you<br />
modify the <strong>Apple</strong>soft program. This<br />
means that the 6502 program<br />
should be relocatable. Here is one<br />
way to find out where the binary<br />
program is at a given time. Form a<br />
pointer from the contents of<br />
$AF,BO (175,176 decimal) and subtract<br />
the length of the binary<br />
program. For example, if the binary<br />
program was 100 bytes long then<br />
we could<br />
100 Bl =PEEK (175) +PEEK (176)<br />
* 256 - 100<br />
110 CALL Bl<br />
This same technique will work<br />
for shape tables where line 110<br />
would be replaced by<br />
110 POKE 232,Bl-INT(Bl/256)<br />
*256<br />
. 120 POKE 233,Bl/256<br />
NOTE: Renumbering a program<br />
after adding binary information<br />
won't work and might destroy the<br />
program or at least kill the binary<br />
information.<br />
CREATING COMMON ACCESS<br />
"SOURCE" FILES<br />
It is my opin10.n that all users<br />
should be aware of how to share<br />
information in their files with<br />
others. You can control the<br />
information you want to share; the<br />
systems manuals tell you the gory<br />
details (DAT A SYS DOC). Here's the<br />
lowdown for the most common<br />
case:<br />
Suppose you are TCA 123 and your<br />
password is XYZ. You have an ASCII<br />
file you made with the editor that<br />
you want anybody to be able to<br />
read; it is called NOTICE. Here we<br />
go:<br />
> PASSWD You are going to<br />
remove the password protection<br />
from "non-owner" access<br />
to your files.<br />
Old Password : XYZ You type<br />
old password.<br />
New Password: XYZ, Restate<br />
your password. The comma<br />
tells the system that the second<br />
("non-owner") password is<br />
non-existent.<br />
Enter it again: XYZ, The system is<br />
just making sure.<br />
At this point, you have eliminated<br />
the password requirement.<br />
You still have to tell the<br />
system just what files you want<br />
to make public.<br />
>PROTEC NOTICE 7 1 This<br />
allows you (the owner) all<br />
rights (that is, read, write, and<br />
delete) to NOTICE, but nonowners<br />
can only read.<br />
That does it. Now anyone on<br />
your system (SYS10 or SYS11) can<br />
say TY TCA123>NOTICE and see<br />
your file. If you change your mind<br />
about access, just say PROTEC<br />
NOTICE 7 0 and your file is private<br />
again. To makeotherfilesavailable,<br />
you only need to use the PROTEC<br />
command; no further PASSWD<br />
work is ever necessary. ·<br />
If you do a FILES command, the<br />
files that other can read will appear<br />
with a lower-case "r" at the righthand<br />
edge of the line.<br />
This method of "unprotecting"<br />
your files makes them accessible to<br />
other on the same system (10or11)<br />
as you are. Users on the other<br />
system can't get to them. As far as I<br />
know, the best way for a SYS11 user<br />
to see a public SYS10 file is this:<br />
1. CHAT a user who is signed on<br />
to SYS10, and ask him/her to<br />
help you for a few minutes.<br />
2. Ask your correspondent to<br />
MAIL the file to you . In case<br />
he does not know how, tell<br />
him to type out this file (TY<br />
TCD728 > SHARE) . If the SYS10<br />
correspondent is, say, CL0987,<br />
you are TCH555, and you want<br />
to see TCA123 > NOTICE,<br />
CMAIL SEND<br />
To: TCH555<br />
Subject: File request<br />
Text:<br />
.LOAD TCA123 >NOTICE<br />
42 lines loaded<br />
.SEND<br />
TCH555 -- Sent<br />
><br />
3. The file will appear more or<br />
less immediately in your mailbox.<br />
Of course, if you want to<br />
save it for future reference,<br />
you can use the SAVE disposition<br />
when reading your mail.<br />
I realize this procedure is rather<br />
cumbersome, but at least it gets the<br />
message through.