Skip to content

Commit e7191fb

Browse files
committed
Added getregs and setregs for P1 and P2 asm
1 parent 71ce9b9 commit e7191fb

6 files changed

Lines changed: 584 additions & 479 deletions

File tree

Changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Version 7.6.3
2+
- Added implementations of getregs and setregs
3+
14
Version 7.6.2
25
- Added check for `NO_COLOR` environment variable (thanks to Ada)
36
- Added a warning for P1 code with _clkfreq but no _clkmode

sys/p1_code.spin

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,28 @@ pri wordfill(ptr, val, count)
362362
pri bytefill(ptr, val, count)
363363
__builtin_memset(ptr, val, count)
364364

365+
'' copy count longs from cogptr to hubptr
366+
pri getregs(hubptr, cogptr, count)
367+
if count==0
368+
return
369+
repeat count
370+
asm
371+
wrlong cogptr, hubptr
372+
add cogptr, #1
373+
add hubptr, #4
374+
endasm
375+
376+
'' copy count longs to cogptr from hubptr
377+
pri setregs(hubptr, cogptr, count)
378+
if count==0
379+
return
380+
repeat count
381+
asm
382+
rdlong cogptr, hubptr
383+
add cogptr, #1
384+
add hubptr, #4
385+
endasm
386+
365387

366388
'' create a method pointer
367389
'' for P1, addresses fit in 16 bits,

0 commit comments

Comments
 (0)