Re: LZ: mystical function(or not?)


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

Re: LZ: mystical function(or not?)



Joshua Lynch wrote:
> 
> today I was experimenting with ROM_CALL's and other things and I found a weird
> chunk of code that i had put together and i do not have the slightest what
> it is exactly doing.here it is:
> 
> #include "TI-85.H"
> 
> .org
> .db "Tests",0
> 
>         ROM_CALL(CLEARLCD)
>         ld a,(ROM_VERS)
>         ROM_CALL(M_CHARPUT)
> .end
> 
> i know its far from beautiful but it was supposed to display the ROM version at
> 0,0 coordinates. but what it actually does is far wierder. it actually runs
> the last program to be erased fron memory.
> 
> it may be a dumb peice of code but it leads me to belive that when programs
> are erased from RAM they are not compltely gone?
> 
> plese shed some light upon this...
> 
> josh lynch
> josh17@winternet.com
> 
> BTW forgive my spelling, I'm am not an english major!! :))


You see, the problem here is that there's no ret in the end. (You also 
don't have any kind of pause to allow you to see what you printed) 
Therefore the program just continues to execute. Now when programs are 
erased from memory, only their VAT entries are removed, they are still 
there until overwritten by something else. Therefore, when the Z80 didn't 
encounter a ret, it continued and ran the next program.


References: