[A83] Re: Ambivalent Ion programs


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

[A83] Re: Ambivalent Ion programs




> would it be possible to let an Ion program do one thing if ran from Ion
> and another thing when ran from TIOS??

I think I knwo how you could do that:

If you look at the Ion source, (I always keep a paper copy if it :)
you will see that it calls to "progstart+1".
As you probably know, the TIOS calls to "progstart"

So you can check if the value at the stack pointer is progstart or not

[..Ion header..]
.start:
	pop	hl	; HL = entry-point
	push	hl
	ld	de,progstart
	or	a
	sbc	hl,de
	jp	z,_TIOS_start
[bunch of code for Ion execution]
	...
	...
	ret
._TIOS_start:
[bunch of code for TIOS execution]
	...
	...
	ret

This is nice, you could make your program say "This program requires Ion
Graphical User Interface". Like if you execute a MICROS~1 Windows(TM)
program under plain-MS-DOS(TM).

	Henk Poley


PS: if I'm not mistaken, the TIOS loads the value of progstart into HL and
then does a "JP (HL)", so you could also check for that.

PPS: Search in the Ion (v1.6) source for "ret | xor a", mail to this
mailinglist what's written directly after it :)   (you can also just read
it without mailing...)