diff options
author | oharboe <oharboe> | 2008-04-16 12:49:31 +0000 |
---|---|---|
committer | oharboe <oharboe> | 2008-04-16 12:49:31 +0000 |
commit | af5b54efbbcbe6e80478ddb24ac2e95a33e63a2d (patch) | |
tree | c2213bf62271dd70ec60fafd5206296ac51a6bb0 | |
parent | f0ef5e051f422887eff80cd8e6d8ab224e5e9114 (diff) | |
download | zpu-af5b54efbbcbe6e80478ddb24ac2e95a33e63a2d.zip zpu-af5b54efbbcbe6e80478ddb24ac2e95a33e63a2d.tar.gz |
* zpu/doc/zpupresentation_old.odt: interesting bits moved into zpu_arch.html
* zpu/doc/zpupresentation.*: interesting bits moved into zpu_arch.html
-rw-r--r-- | zpu/ChangeLog | 2 | ||||
-rw-r--r-- | zpu/docs/zpu_arch.html | 47 | ||||
-rw-r--r-- | zpu/docs/zpupresentation.odp | bin | 78518 -> 0 bytes | |||
-rw-r--r-- | zpu/docs/zpupresentation.ppt | bin | 150016 -> 0 bytes | |||
-rw-r--r-- | zpu/docs/zpupresentation_old.odt | bin | 126772 -> 0 bytes |
5 files changed, 49 insertions, 0 deletions
diff --git a/zpu/ChangeLog b/zpu/ChangeLog index 052c479..3c432e8 100644 --- a/zpu/ChangeLog +++ b/zpu/ChangeLog @@ -1,4 +1,6 @@ 2008-04-16 Øyvind Harboe
+ * zpu/doc/zpupresentation_old.odt: interesting bits moved into zpu_arch.html
+ * zpu/doc/zpupresentation.*: interesting bits moved into zpu_arch.html
* zpu/docs/zpu_arch.html: added Phi memory map to end of zpu_arch.html
* zpu/docs/zpuphiregs.odt: retired
* zpu/docs/zpu_arch.html: added. Need to define instruction set.
diff --git a/zpu/docs/zpu_arch.html b/zpu/docs/zpu_arch.html index df692a7..a1f61a1 100644 --- a/zpu/docs/zpu_arch.html +++ b/zpu/docs/zpu_arch.html @@ -1,5 +1,52 @@ <html> <body> +<h1>Introduction</h1> +The ZPU is a zero operand, or stack based CPU. The opcodes have a fixed width of 8 bits. +<p> +Example: +<p> +<div style="white-space:pre;background-color:#dddddd;"> + <code style="white-space:pre;background-color:#dddddd;"> + IM 5 ; push 5 onto the stack + LOADSP 20 ; push value at memory location SP+20 + ADD ; pop 2 values on the stack and push the result + </code> +</div> +As can be seen, a lot of information is packed into the 8 bits, e.g. the IM instruction pushes a 7 bit signed integer onto the stack. +<p> +The choice of opcodes is intimately tied to the GCC toolchain capabilities. +<p> +<div style="white-space:pre;background-color:#dddddd;"> + <code style="white-space:pre;background-color:#dddddd;"> + /* simple program showing some interesting qualities of the ZPU toolchain */ + void bar(int); + int j; + void foo(int a, int b, int c) + { + a++; + b+=a; + j=c; + bar(b); + } + +foo: + loadsp 4 ; a is at memory location SP+4 + im 1 + add + loadsp 12 ; b is now at memory location SP+12 + add + loadsp 16 ; c is now at memory location SP+16 + im 24 ; «j» is at absolute memory location 24. +; Notice how the ZPU toolchain is using link-time relaxation +; to squeeze the address into a single no-op + store + im 22 ; the fn bar is at address 22 + call + im 12 + return ; 12 bytes of arguments + return from fn +</code> +</div> + <h1>Instruction set</h1> Only the base instructions are implemented in the architecture. More advanced instructions, like ASHIFTLEFT are emulated in the illegal instruction vector. diff --git a/zpu/docs/zpupresentation.odp b/zpu/docs/zpupresentation.odp Binary files differdeleted file mode 100644 index 28d9a7b..0000000 --- a/zpu/docs/zpupresentation.odp +++ /dev/null diff --git a/zpu/docs/zpupresentation.ppt b/zpu/docs/zpupresentation.ppt Binary files differdeleted file mode 100644 index 100c4a4..0000000 --- a/zpu/docs/zpupresentation.ppt +++ /dev/null diff --git a/zpu/docs/zpupresentation_old.odt b/zpu/docs/zpupresentation_old.odt Binary files differdeleted file mode 100644 index 53e1f98..0000000 --- a/zpu/docs/zpupresentation_old.odt +++ /dev/null |