Nascom Newsletter |
Volume 3 · Number 1 · April 1983 |
Page 11 of 37 |
---|
81 41 42 43 C4 nn
do? Well it will add ABCD to STRDIS, but will also let Control know that this is the last routine to be called and so Control will be exited leaving PRDIS to be called – and then the next instruction.
Routine 2 – This adds the Gth item, in the following list, to STRDIS leaving HL’ pointing to one after the last character in the list. You can see that this breaks down into 3 parts,
If you use, as I did, the ‘Bit 7’ technique for your list, then part (ii) may just be a call to Routine 1. See how much work you can save by spending a little time on these routines.
Routine 3 – This is exactly the same as Routine 2, only not for G, but for H – not the in HL. In fact I will nearly do this one for you!!. Store G somewhere. Put H in G’s place, call Routine 2, replace G. Easy isn’t it?
When all these routines are done, you will find that most of the higher ones will call one lower, and so nested subroutines build up. In fact to single step through the disassembleris fascinating as you can watch the stack pointer (SP) drop like a stone as all the return addresses get pushed on. Then, as it finishes with each routine the stack pointer slowly grovels it’s may back to where it began. The first few times you match this your heart will be in your mouth as you wait with bated breath for the return addresses to be removed, or will it crash? It still fascinates me.
Routine 4 – This routine is really like accessing a two dimensional string array, and adding the string to STRDIS. There are six lists of eight elements. Don’t worry!! Not more data, no, these lists were discussed last time. The actual list will be specified in Control’s command, ie as the data bits (3, 4 & 5 – go back if you have forgotten!). The string to be added to STRDIS is, in fact the Gth item in the specified list. Easy!! Now the lists each have a code (for the data bits for Control)
Bits 345 | Name |
000 | r(G) |
001 | ss(G) |
010 | dd(G) |
011 | n(G) |
100 | c(G) |
Page 11 of 37 |
---|