Update of /cvsroot/wisp/wisp/modules
In directory usw-pr-cvs1:/tmp/cvs-serv4772a/modules
Modified Files:
universal.wrti wisptyp.wrti
Log Message:
Added a few Worth macros for completeness.
Index: universal.wrti
===================================================================
RCS file: /cvsroot/wisp/wisp/modules/universal.wrti,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- universal.wrti 7 Sep 2002 22:03:51 -0000 1.14
+++ universal.wrti 11 Sep 2002 17:36:14 -0000 1.15
@@ -509,6 +509,7 @@
2dup < if swap then drop swap)
;; Memory calculations
+
(macro wydes
1 lshift)
@@ -521,13 +522,17 @@
(macro cells
tetras)
- (macro cell+
- 1 cells +)
+ (macro wyde+ 1 wydes +)
+ (macro wyde- 1 wydes -)
- (macro cell-
- 1 cells -)
+ (macro tetra+ 1 tetras +)
+ (macro tetra- 1 tetras -)
+
+ (macro cell+ tetra+)
+ (macro cell- tetra-)
;; Memory operations
+
(macro byte@
(->ureg 0)
,(zex ,0 (byte ,0)))
@@ -541,23 +546,41 @@
,(mov ,0 (tetra ,0)))
(macro byte!
- (flush)
- ,(pop %edx)
- ,(pop %eax)
- ,(mov (byte %edx) %al))
+ (->reg 1 %eax)
+ ,(mov (byte ,0) %al)
+ drop drop)
(macro wyde!
- (flush)
- ,(pop %edx)
- ,(pop %eax)
- ,(mov (wyde %edx) %ax))
+ (->reg 1 %eax)
+ ,(mov (wyde ,0) %ax)
+ drop drop)
(macro tetra!
(->reg 0)
,(mov (tetra ,0) ,1)
drop drop)
+ (macro byte@++
+ dup 1+ swap byte@)
+
+ (macro wyde@++
+ dup 1 wydes + swap wyde@)
+
+ (macro tetra@++
+ dup 1 tetras + swap tetra@)
+
+ (macro --byte@
+ 1- dup swap byte@)
+
+ (macro --wyde@
+ 1 wydes - dup swap wyde@)
+
+ (macro --tetra@
+ 1 tetras - dup swap tetra@)
+
(macro cell@ tetra@) ; ia32 is a 32-bit architecture
+ (macro cell@++ tetra@++)
+ (macro --cell@ --tetra@)
(macro cell! tetra!)
(macro fill
Index: wisptyp.wrti
===================================================================
RCS file: /cvsroot/wisp/wisp/modules/wisptyp.wrti,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- wisptyp.wrti 7 Sep 2002 22:02:40 -0000 1.10
+++ wisptyp.wrti 11 Sep 2002 17:36:14 -0000 1.11
@@ -42,6 +42,9 @@
(macro untag-node
-16 and)
+ (macro string-data
+ dup 2 cells + swap cell@ NC_C8STRING = if cell@ then)
+
;; Unique node pointers
(macro NULL 0)
|