[Coco] DEF USR and strings?
William Astle
lost at l-w.ca
Wed Oct 29 17:47:05 EDT 2025
On 2025-10-29 15:26, Allen Huffman via Coco wrote:
> Ah, I have something else wrong. I “ldd #42” then “jmp GIVABF” to return, and see my return value is indeed 42, but the ?TM ERROR remains.
>
> A$=“1234”
> X=USR0(A$)
>
> X=USR0(“1234”)
>
> I am running in CoCo 3 mode. I just switched to a CoCo 2 and get the same thing.
>
> My test code is now this:
>
> org $7f00
>
> start
> jsr INTCNV * get passed in value in D
> std 1024 * for debugging
> ldd #42
> jmp GIVABF
>
> I do a CLEAR 200,&H7F00 before running the loader.
My first thought was that maybe GIVABF didn't reset the value type to
numeric but that's actually the first thing it does.
However, upon engaging my eyeballs and reading what you have there,
you're trying to convert the string parameter you're passing to USR0 to
a number with JSR INTCNV. That's clearly the wrong thing to do since a
string isn't a number.
More information about the Coco
mailing list