0 Members and 1 Guest are viewing this topic.
ld HL,ProgName ; Get the program name data rst 20h ; and load it into OP1 (_Mov9ToOp1) bcall(_ChkFindSym) ; then use _ChkFindSym to find it (_FindSym doesn't work on programs) ex DE,HL ; and load the pointer to the size bytes (returned as DE) into HL ld E,(HL) ; then use that to load the low byte into E inc HL ; and the high byte into D ld D,(HL) ; effectively loading the size of the program into DE inc HL ; then inc HL so it points to the actual data push HL ; push it to save it for later push DE ; and do the same for DE
ld HL,StrName ; Get the string name data rst 20h ; and load it into OP1 (_Mov9ToOp1) rst 10h ; then use _FindSym to find it jr c,Nonex ; jumping ahead if it already doesn't exist bcall(_DelVarArc) ; otherwise deleting itNonex: ; so it's clean pop HL ; and popping the DE we saved earlier into HL push HL ; pushing it again to save it again bcall(_CreateStrng) ; we create the string (_CreateStrng takes the size of the new string in HL)
pop BC ; Pop the size into BC pop HL ; and the pointer to the program back into HL inc DE ; and inc DE twice to skip the size bytes inc DE ; so it points to the data section of the new string ldir ; and load the data in ret ; and we're done :)
ProgName:.db ProgObj,tM,tY,tP,tR,tO,tG,$00StrName:.db StrngObj,tVarStrng,tStr9,$00
Well i saw Celtic3, it made data in program to str9, (prgm name in str0), so i tried making it, but i didnt know where to start.. point is im trying to use the program to read what's inside other program