Re: MONJANA translation

From: Rob Eaglestone <robert.eaglestone_at_gmail.com>
Date: Thu, 17 Dec 2015 08:58:47 -0600
Message-ID: <CABNTyr_DE9UC_1OV4oKH9F_ZTV26fUQ1gmUo1g=R8QNOuCMDbw@mail.gmail.com>
*English Corrections up to section 3.1:*


This type of sorting is iterative.
The value of the first record in the row is compared with the value of
the second one.
When the second record is smaller, it is swapped with the first one.
Then the first record is compared with the third record, and swapped if needed.
This is repeated until the end of the list of records.
This procedure is repeated but now starting with the second record.
After that the procedure is repeated for the third, fourth and all
other records until the last one.
The result is that the first record contains the smallest value, the
second record the second smallest value, and so on.



The longer the list becomes, the more time the program will need to run.
For N=100 the sorting will need about 1.5 minutes.
For N=250 it will need about 10 minutes (see figure 1).



The assembly program to be created should work in the same way as the
shown BASIC routine (see figure 2).
However the list isn't made out of strings T$(1) to T$(N) but out of
arrays with length L,
stored sequentially starting from address A.
The program itself is stored in the buffer for the cassette recorder
#2 i.e. at address $033A.




3. The programming and testing of the subroutines

It is recommended to program and test the seperate parts of the
subroutine before
we combine them with the main program.
For example we can start with swapping two arrays (compare with BASIC
line 1030).



3.1 Swapping two arrays

We can use indirect addressing using Y as an index for swapping two arrays.
The start addresses of the two arrays to be swapped should be stored
in the memory
addresses $09-$0A and $0C-$0D. The number of bytes to be swapped can be found
in $05, the length of the array L. Because the length of an array
starts counting from
1 but the displacement starts counting from 0, the contents of $05 has
to be decreased
by 1 first. During the swap, register X is used as in-between-store.
In the BASIC program we used the variable S$.

     DEY          Decrease Y by 1




At the end we have to input the code 10 for BPL and the according
relative address.
We just count back and we wll find that F5 should be OK.
After entering >10 F5< we see we made an error.
Instead of $0503 the address $0505 is shown as destination.
Therefore we go back the last entered line and obtain by the correct
correction: 10 F3  BPL $0503.





On Thu, Dec 17, 2015 at 8:10 AM, <Ruud@baltissen.org> wrote:

> Hallo allemaal,
>
>
> My English translation can be found here
>
>     http://www.baltissen.org/temp/Monjana.txt
>
> But some remarks on forehand:
> - I'm Dutch and German isn't my native language. Understanding a
> language doesn't mean you are able to translate it. Several times I
> knew what a word meant but still needed a dictionary to find the
> one-to-one translation.
> - English isn't my native language either.
> - Therefore the result isn't always a one-to-one translation. In
> some cases I wasn't sure or even had no idea at all. These parts are
> marked with question marks.
> - The original author was someone who liked complex long sentences.
> That didn't make it easy as well.
>
> I would appreciate it if both German and English native speaking
> guys would have a look at it and send me the needed corrections.
>
> Thank you!
>
>
> --
>
> Kind regards / Met vriendelijke groet, Ruud Baltissen
> www.Baltissen.org
>
>
>
>
>
>
>
>        Message was sent through the cbm-hackers mailing list
>


       Message was sent through the cbm-hackers mailing list
Received on 2015-12-17 15:01:07

Archive generated by hypermail 2.2.0.