Hi all,

One of the things I struggled with in trying to build 8085 subroutines for
BASIC program was the lack of a relative jump command.

So far, the approach I have taken to embed ML programs into BASIC has been
to poke them into arrays, thus allowing BASIC to manage the routines within
memory. However, I then have to use BASIC to get VARPTR of the array and
update all JMP locations before calling the subroutine, just in case BASIC
has moved the array.

The other thought I had was, can I have the ML program modify itself when
it runs? I was racking my brain reading the Inten 8085 documentation, and
as far as I can tell there is no easy way to read the program counter into
any of the register pairs, which I would want to do in order to calculate
offsets and update JMP locations.

However I had one thought. It seems that both CALL and RST instructions
push the program counter onto the stack. Is it possible to leverage either
of these and then RET to return to my program, and then immediately
decrement the stack pointer and to retrieve the previous value.

Then I can use that value to calculate all the offsets and update the JMP
locations.

Does anyone have any constructive input here?

-George

Reply via email to