From b68eeefef34d4a742124d922e2a23613b9bcb1e5 Mon Sep 17 00:00:00 2001 From: adventuresin9 Date: Wed, 8 Mar 2023 05:14:31 +0000 Subject: sys/src/libc/mips/tas.s: _tas() for spim --- sys/src/libc/spim/tas.s | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sys/src/libc/spim/tas.s (limited to 'sys/src/libc') diff --git a/sys/src/libc/spim/tas.s b/sys/src/libc/spim/tas.s new file mode 100644 index 000000000..807fd121d --- /dev/null +++ b/sys/src/libc/spim/tas.s @@ -0,0 +1,18 @@ +/* + * 4K tas for spim + */ + +#define LL(base, rt) WORD $((060<<26)|((base)<<21)|((rt)<<16)) +#define SC(base, rt) WORD $((070<<26)|((base)<<21)|((rt)<<16)) +#define NOOP WORD $0x27 + + TEXT _tas(SB), $0 + MOVW R1, R2 /* address of key */ +tas1: + MOVW $1, R3 + LL(2, 1) + NOOP + SC(2, 3) + NOOP + BEQ R3, tas1 + RET -- cgit v1.2.3