💾 Archived View for mirrors.apple2.org.za › archive › ground.icaen.uiowa.edu › MiscInfo › Programmin… captured on 2023-01-29 at 10:17:37.
-=-=-=-=-=-=-
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In article <ek273vcmbhe8g33rgad43o0bsies9mvqah@4ax.com>, Jeff Blakeney <CUTjblakeney@sentex.net> wrote: >On Sun, 26 Jan 2003 06:18:08 GMT, "Terry & Utahna" ><tolsen64@hotmail.com> wrote: > >>It's been many years since I've done any assembly programming. Now I'm >>working on a project but for the life of me I can't remember the "inline >>print" routine I used to use. It went something like: >> >> jsr PrintRoutine >> asc "Hello World!",00 >> ...continue assembly code here >> >>The print routine somehow knew to RTS to the instruction just after the 00 >>termination on that string. I think the return address was pulled from the >>stack and the "modified" return address was pushed just before the RTS...Am >>I close???? > >Yes, that is what you can do for an inline print routine. > >The print routine needs to pull the RTS address off the stack and use >that as the address of the first character to print and when it hits >the $00 at the end of the string it needs to push the address of the >location after the $00 and do an RTS. Here's one that I used in a hex editor I wrote. In my program, strings were surrounded by nulls on each side to tell the relocating loader where they were. If you put the string right after the JSR, change the ADC #2 near the top to ADC #1.