Skip to content

Commit 4e4cf45

Browse files
committed
Make Spin2 RDPIN and RQPIN return C in bit 31; C and BASIC versions are left alone
1 parent 6ac9ec7 commit 4e4cf45

9 files changed

Lines changed: 1733 additions & 1697 deletions

File tree

Changelog.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
Version 7.6.12
1+
Version 7.7.0
22
- Added some ioctls for diskio
3+
- Made Spin2 rdpin and rqpin functions put C in bit 31
34
- Accept '[]' for array declarations in BASIC
45
- Fixed a peephole optimization bug
56
- Fixed passing an interface pointer to an interface pointer in Spin2

backends/nucode/nuir.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
X(WXPIN) /* smart pin write */ \
117117
X(WYPIN) /* smart pin write */ \
118118
X(RDPINX) /* smart pin read: returns value and c */ \
119+
X(RDPINC) /* smart pin read: returns value with c in bit 31 */ \
119120
X(RQPIN) /* smart pin read (quiet) */ \
120121
X(AKPIN) /* smart pin acknowledge */ \
121122
\

frontends/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ Aliases spin2alias[] = {
197197
{ "wypin", "_wypin" },
198198

199199
{ "akpin", "_akpin" },
200-
{ "rdpin", "_rdpin" },
200+
{ "rdpin", "_rdpin_spin" },
201201
{ "rqpin", "_rqpin" },
202202

203203
{ "polxy", "_polxy" },

sys/nucode_util.spin

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ pri _wypin(pin = long, val = long)
6060
%bytecode("WYPIN")
6161
pri _rdpinx(pin = long) : r, c
6262
%bytecode("RDPINX")
63+
pri _rdpin_spin(pin = long) : r, c
64+
%bytecode("RDPINC")
6365
pri _rqpin(pin = long) : r
6466
%bytecode("RQPIN")
6567
pri _akpin(pin = long)

sys/nucode_util.spin.h

Lines changed: 821 additions & 816 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sys/nuinterp.spin

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,8 @@ impl_WYPIN
10281028
jmp #\impl_DROP2
10291029

10301030
impl_RQPIN
1031-
_ret_ rqpin tos, tos
1031+
rqpin tos, tos wc
1032+
_ret_ bitc tos, #31
10321033

10331034
impl_AKPIN
10341035
akpin tos
@@ -1047,6 +1048,10 @@ impl_XYPOL
10471048
getqx nos
10481049
_ret_ getqy tos
10491050

1051+
impl_RDPIN_SPIN
1052+
rdpin tos, tos wc
1053+
_ret_ bitc tos, #31
1054+
10501055
impl_RDPINX
10511056
call #\impl_DUP
10521057
rdpin nos, nos wc

sys/nuinterp.spin.h

Lines changed: 343 additions & 336 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sys/p2_code.spin

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,16 +335,23 @@ pri _rdpin(pin = long) : r
335335
asm
336336
rdpin r, pin
337337
endasm
338+
338339
pri _rdpinx(pin = long) : r, c
339340
c := 0
340341
asm
341342
rdpin r, pin wc
342343
if_c neg c, #1
343344
endasm
344345

346+
pri _rdpin_spin(pin = long) : r
347+
asm
348+
rdpin r, pin wc
349+
bitc r, #31
350+
endasm
345351
pri _rqpin(pin = long) : r
346352
asm
347-
rqpin r, pin
353+
rqpin r, pin wc
354+
bitc r, #31
348355
endasm
349356
pri _akpin(pin = long)
350357
asm

sys/p2_code.spin.h

Lines changed: 549 additions & 541 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)