;copy write 1999 Samuel Stearley sstear@calvin.edu #include "asm86.h" #include "ti86asm.inc" #include "ti86math.inc" #include "ti86ops.inc" #include "ti86abs.inc" .org _asm_exec_ram ;there are 58 variables to search for ;there are 6 extra between the upper and ;lower case letters, i could skip them ;but i would have to put in extra code ;but it doesn't matter because they can ;not exist ; ; ; ; +---------- goes into the h register and into memory after l ; | multiplying it by 256 forces the 40h into the upper ; | byte. it is the same as: ld h,40h ; | ; | ; | ; | +----- goes into the l register and into memory before h. ; | | it is the same as: ld l,1 ; | | ; | | ld hl,256*40h+1 ;what is added goes first into l and will ;then be written first into memory at _OP1+1 ;it is a one because their is only one ;charcter in the title string. ;What is multiplied will go into h and be ;written into memory after the one at _OP1+2 ;here it is a 40h but it will be incrimented ;into a 41h, the character code for an ;upper case A , then it will be incrimented ;again into an upper case B and so forth ;till it is a lower case z. Then the program is ;done ;The name length byte and the character byte ;fit into one register pair. Loop: inc h ;now to point it to the next variable ;the upper byte, the h register contains the ;title and it needs to be changed to look for ;the next variable. push hl ;save the variable counter, when i get ;it back I have to incriment ;h to look for the next variable ;The rst 10h routine will destroy hl, so hl needs ;to be pushed sometime before it is used. ld (_OP1+1),hl ;move it for the find system call rst 10h ;same as the find system call but one byte smaller call nc,_delvar ;it is a nc only if the var exists so then ;it must be deleted pop hl ;got it back ld a,7Ah ;we go till the character 7Ah, the lower case cp h ;z character jr nz,Loop ;i do it again if the we have not reached the ;z character ret ;now return .end