-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow Spin2 structs to access their parent's symbols
- Loading branch information
1 parent
f00fd01
commit 7bc1389
Showing
3 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
con | ||
_clkfreq = 20000000 | ||
_clkmode = 16779595 | ||
ARR_SIZ = 12 | ||
dat | ||
nop | ||
cogid pa | ||
coginit pa,##$404 | ||
orgh $10 | ||
long 0 'reserved | ||
long 0 ' clock frequency: will default to 20000000 | ||
long 0 ' clock mode: will default to $100094b | ||
orgh $400 | ||
_ret_ mov result1, #0 | ||
org 0 | ||
entry | ||
|
||
_zb | ||
add arg02, arg01 | ||
rdbyte result1, arg02 | ||
add result1, #12 | ||
_zb_ret | ||
ret | ||
builtin_bytefill_ | ||
shr arg03, #1 wc | ||
if_c wrbyte arg02, arg01 | ||
if_c add arg01, #1 | ||
movbyts arg02, #0 | ||
builtin_wordfill_ | ||
shr arg03, #1 wc | ||
if_c wrword arg02, arg01 | ||
if_c add arg01, #2 | ||
setword arg02, arg02, #1 | ||
builtin_longfill_ | ||
wrfast #0,arg01 | ||
cmp arg03, #0 wz | ||
if_nz rep #1, arg03 | ||
if_nz wflong arg02 | ||
ret | ||
|
||
result1 | ||
long 0 | ||
COG_BSS_START | ||
fit 480 | ||
orgh | ||
org COG_BSS_START | ||
arg01 | ||
res 1 | ||
arg02 | ||
res 1 | ||
fit 480 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{$Spin2_v46} | ||
|
||
CON | ||
ARR_SIZ = 12 | ||
STRUCT st( byte a[ARR_SIZ] ) | ||
|
||
PUB zb(^st b, i) : r | ||
r := b.a[i] + sizeof(b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters