back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorscratko <m@scratko.xyz>2024-03-28 02:58:37 +0300
committerscratko <m@scratko.xyz>2024-03-28 02:58:37 +0300
commit37f7978b517e2f00243703d510a6a53d4ea56f1e (patch)
tree6f4afce8605eb0157a2bdaa073b622cb3ce3f475 /README.md
parent21f616b5593d87d6381c1f3d67a3df0c442dba44 (diff)
downloadtrigonometric-table-37f7978b517e2f00243703d510a6a53d4ea56f1e.tar.gz
trigonometric-table-37f7978b517e2f00243703d510a6a53d4ea56f1e.tar.bz2
trigonometric-table-37f7978b517e2f00243703d510a6a53d4ea56f1e.zip
added readme
Diffstat (limited to 'README.md')
-rw-r--r--README.md60
1 files changed, 60 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..80add1a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,60 @@
+# Trigonometric functions table generator (assembler NASM)
+
+<img scr="trigonometric-table.png" />
+
+## Introduction
+
+The table generator that contains values of trigonometric functions for given
+angles. This program saves the result to a file.
+
+Trigonometric functions:
+
+- sine
+- cosine
+- tangent
+- cotangent
+
+## Implementation (TL;DR)
+
+Floating point arithmetic is implemented via an arithmetic coprocessor.
+
+It is a kind of stack of its own registers R0, R1, ..., R7. Each of the
+registers can be the top of the stack (indicated by ST0).
+
+The coprocessor uses its own commands for data exchange (e.g., load to the top
+of the stack, also called register, fild), state flag registers (CR, SR, TW),
+commands for arithmetic operations (fsin, fcos, fptan).
+
+Fptan calculates a value in a very interesting way: it places 1 on the top of
+the stack (ST0), and places the result (the tangent value) behind the top (ST1).
+
+That is done to simplify the calculation of cotangent ($`1/tang`$).
+
+Therefore, we divide ST0 by ST1 using the fdivp command, and the result is
+written to the top of the stack.
+
+## Building
+
+
+```
+git clone https://git.scratko.xyz/trigonometric-table
+cd trigonometric-table
+make
+```
+
+## Usage
+
+After executing above commands:
+
+```
+./trigonometric-table <1st> <2nd> <3rd> <4th>
+```
+
+Where:
+
+- <1st> name of a file
+- <2nd> initial angle
+- <3rd> final angle
+- <4th> distance step
+
+In the same directory there will be the file with the result.