[Prev][Next][Index][Thread]

Re: A92: A STRANGE AND VERY LUCKY DISCOVER...




Hi

Well it is not really safe to execute rom routines with db92 as these routines 
are likely to allocate memory, so the memory block where db92 is may move 
arround. In the Fargo I version of db92, there was a little program that 
copied db92 onto the stack and executed it from here, so that its code 
couldn't move. I didn't rewrite this program for the Fargo II version, I 
prefer to wait for the TSR support to be available.

> 
> 	Hello !
> 
> First, I want to tell you I have a 1.11 ROM.
> Here are the facts : Yesterday, I was playing with the tiger emulator 
> and the excellent db92 debbuger. 
> Here is what I made :
> 
> Well, I run db92 from my program PCT98, there isn't a test program.
> So the program point to 0x0, and print a lot of 'ori' instructions.
> I tell me 'well, ben, you could go in the ROM, for fun'.
> So I press [G] (Go function), and enter the address 420000. Why 
> 420000 could you wonder ? Why not I would answer you ?
> So I go to this offset, and press [S] (Set PC function)
> 
> There I trace it instruction by instruction. After less than around 10-20
> instruction, I see with astonishment that I am returned in my program
> PCTOOLS !!!!! I have run db92 from pctools, and I am now come back
> in PCTools with db92, and I trace it !!
> Funny, isn't it ?
> So after I think that if I ran db92 from the home, It would come
> back in the ROM, and I could trace it ! And it seems to work !!!!
> 
> So I decide to know how and Why it made that, and he is what I found :
> 
> In the 420000 offset, there is (with my comments) :
> 
> move.l	$#FFE0(a6),a7		;it put for the next rts the address
> 				;#$01F714. that is at the end of the RAM, 
> 				;it must be a Fargo function
> move.l	$#FFDC(a6),a7		;it is the file address from I run db92 I saw
> jsr	04331964		;a very short function
> move.w	#$0001,d0		
> bra	#$004200E4		
> ...
> movem.l	#3C38(a6),d2/d5??? 	;there may be more registers, but db92
> 				;had no more space
> unlnk	a6
> rts				;rts, might go to the fargo function
> 
> And after you are in the program which called db92 !!!
> 
> (When you want to exit db92, it first make a stack corrupted, and then
> a illegal instruction, but it is normal...)
> 
> 
> So We could explore the ROM, isn't it ? But only 1.11 ROM will
> be able to test that I think. 
> (we can't use a test program, since db92 check if the program is 
> terminated. But we could patch db92 to never says 'program
> terminated' and so go back in the ROM, without crashing the calc.
> 
> Well, it was funny...
> 
> 
> Benoit SCHERRER 



References: