Re: A83: Using Interups, and strings


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

Re: A83: Using Interups, and strings




Yes, the problem comes from relocation of the code...
in your code text1, is just a name for the address Pointer of the string (eg 
$9dAA) so when you copy your code for interrupt to another location, 
probably $9a9a (i'll use this in the example) so text1 = $9daa but the what 
it should be to really point the string, it should be relative to $9a9a...

IntStart:
ld hl,text1-intstart+$9a9a ; Make it relative to 9a9a (text1-intstart makes 
it relative to intstart, and then add the 9a9a offset...)
bcall(_puts)
text1:	.db "Sample String",0


Then another note:
using B_CALLing in an interrupt isn't bad, it doesn't leave the rom page 
switched, this can be proven just by saying that if it didn't restore the 
original rom page, even APPs would not be working...
Someone please confirm this.... I hope you understand what I mean...

>From: "Robby Proie" <playnogamz@nls.net>
>
>
>Hi:
>
>	Here is a puzzle that I have not yet been able to figure out.  Ok, to 
>start
>out with, I am creating my own interup, with most of the core code comming
>from the the interrupt guide at www.ticalc.org/pub/text/ .  I want it to
>display a string, but when I set it up as a regular program that would
>display a string...
>
>
>(More Code)
>
>
>ld hl,text1
>
>bcall(_puts)
>
>text1:	.db "Sample String",0
>
>
>(More code)
>
>It only displays a bunch a garbled information when you press the right 
>key.
>How do I copy the string so it will be displayed correctly when the user
>presses the right key.
>
>Thanks in advnce
>Rob
>
>
>P.S. My interupt routine itself works just fine, I have tested it with 
>other
>operations, like clearing the screen, and it performs without a problem.
>
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.




Follow-Ups: