home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.sys.apple2      Discussion about Apple II micros      56,720 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 54,895 of 56,720   
   I am Rob to All   
   Re: Embed binary code in Applesoft progr   
   14 Jul 21 23:40:33   
   
   From: gids.rs@sasktel.net   
      
   The idea of where to place a binary program so that it is protected and can   
   not be tromped on by variables, strings and expanding programs is a subject   
   that has been discussed many times, and is still difficult to give a good   
   answer to.   
      
   I played with the idea of putting binary code between the end of the program   
   and the start of variable space (also known as LOMEM:, which usually follows   
   the end of the program in memory).   
      
   * EP = end of program address   
   * BS = binary program start address   
   * BL = binary program length   
   * binary program can be loaded or poked to the address at EP + 15   
   * The +15 is needed to skip past the two variables EP & BL, which are   
   temporarily preserved after the end of the program until the new LOMEM:   
   command is encountered, then the variables are reloaded to the new LOMEM:   
   address.   
   * The binary program length is from Prodos, change to 43634 & 43635 for DOS   
      
      
    1  GOTO 63998 : REM Must be done before any variables are assigned   
    2  CALL BS : END   
      
    63998  GOSUB 63999: PRINT  CHR$ (4)"BLOAD BIN.PGRM,A"EP + 15: LOMEM: EP + BL   
   + 15: GOSUB 63999:BS = EP +15: GOTO 2   
      
    63999 EP =  PEEK (105) + 256 *  PEEK (106):BL =  PEEK (48859) + 256 *  PEEK   
   (48860): RETURN   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca