Shop OBEX P1 Docs P2 Docs Learn Events
Issue using @@ in Spin2 — Parallax Forums

Issue using @@ in Spin2

I've found an issue when using the @@symbol with a pointer list.
You need to be aware when your pointers need to be WORD or LONG offsets.
The compiler seems to switch from expecting WORD lists to LONG lists.
The example below shows reading WORDs as LONGS and then flips?

Changing to LONG pointers fixes the problem.
The compiler needs to check overflow of the WORD pointers and possibly warn of the switch over to expecting LONG lists.
The SPIN2 docs show WORD examples only.
	_clkfreq = 180_000_000

pub main()|x

	debug(uhex(@list))  'list address
	repeat x from 0 to 3
		debug(uhex(@@list[x]),udec(x),zstr(@@list[x]))
	repeat

dat	
unk	long	0[$3ffc]

str0	byte	"zero",0
str1	byte	"one",0
str2	byte	"two",0
str3	byte	"three",0

'list	long	@str0,@str1,@str2,@str3

list	word	@str0,@str1,@str2,@str3



848 x 524 - 104K
1582 x 383 - 63K

Comments

  • cgraceycgracey Posts: 14,155
    Thanks for finding and reporting this, Ozpropdev. I will try to put a check into the assembler.
Sign In or Register to comment.