[Coco] DEF USR and strings?

Allen Huffman alsplace at pobox.com
Sat Nov 1 11:26:03 EDT 2025


> On Oct 31, 2025, at 4:43 PM, Sean Conner via Coco <coco at maltedmedia.com> wrote:
> 
>  Based on all that, I think the best method might be (completely untested):
> 
> 	mycode		cmpx	#mycode
> 			beq	called_by_exec
> 		; otherwise, assume called by USR/USRn

Indeed. Needing to know the version of BASIC is a hassle.

I did a test:

start       cmpx	    #start  ;* Called by EXEC?
            beq         yes
            leax        nomsg,pcr
            lbsr        print
            rts
yes         leax        yesmsg,pcr
            lbsr        print
            rts

nomsg       fcc         "YES"
            fcb         0

yesmsg      fcc         "NO"
            fcb         0

If I EXEC &H3E00 is prints “NO”.

Then if I EXEC (it remembers that last address) is prints “YES”.

Almost.

I did a STX 1024 so I could PEEK the value from BASIC.

With EXEC xxxx, it has the xxxx value there.

With just EXEC after that, it has ABAB.

That seems to be the address of the EXEC token in Color BASIC.

ABAB A5 3E FDB EXEC EXEC A2

I’ll check that 9D location next.

Thanks for the ideas!

		- A



More information about the Coco mailing list