#+TITLE: Fifth - virtual machine, operating system, programming language
-* (document settings) :noexport:
-** use dark style for TWBS-HTML exporter
-#+HTML_HEAD: <link href="https://bootswatch.com/3/darkly/bootstrap.min.css" rel="stylesheet">
-#+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
-#+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
-#+HTML_HEAD: <style type="text/css">
-#+HTML_HEAD: footer {background-color: #111 !important;}
-#+HTML_HEAD: pre {background-color: #111; color: #ccc;}
-#+HTML_HEAD: </style>
* General
- This program is free software: released under Creative Commons Zero
(CC0) license
- Lots of enthusiasm.
* Numbers representation within Fifth
+Because we are in full experimentation mode here (no regard for
+compatibility whatsoever), why not to try also alternative number
+representation ?
+
+Here alternative hexadecimal number representation format is devised:
+
[[file:numbers.png][file:numbers.png]]
-Because I can define everything, starting from CPU, why not try also
-alternative and unique number representation ?
+Essentially square is split into 4 triangles. Each triangle represents
+one bit.
+
+Fifth uses this hexadecimal format as primary throughout entire
+system.
+
+See also: [[https://en.wikipedia.org/wiki/Bibi-binary][Bibi-binary]].
-Fifth uses its hexdecimal number representation as primary. Numbers
-shape is formed by dividing a square into four parts. And manipulating
-their color (black or white).
* Disk file map, and it's data structures
Core and high-level boot code is stored outside of the filesystem to
allow easy access to it, at early booting time, when filesystem is not
click buffer, and draw mouse cursor to "screen".
#+END_VERSE
** 2D graphic library
-#+BEGIN_VERSE
-lineh ( color len x y imgbuf -- ) draws horisontal line
- from X,Y coordinates to right, with specified length.
-linev ( color len x y imgbuf -- ) draws vertical line
- down, from coordinates X,Y, with specified length.
-box ( color x2 x1 y2 y1 imgbuf -- ) draws rectangular
- box. x2 bust be >= x1, y2 must be >= y1.
- x1,y1-----------+
- | |
- | |
- +-----------x2,y2
-
-flipv ( imgbuf -- ) flip image vertically.
-imgcoltrans ( ImgBuf Color ToColor -- ) Translate all pixels in
- specified image with "Color" into "ToColor".
-imgfill ( color x y imgbuf -- ) Fill image region starting at location
- X & Y with specified color.
-#+END_VERSE
+
++ lineh ( color len x y imgbuf -- ) :: draws horisontal line from X,Y
+ coordinates to right, with specified length.
+
++ linev ( color len x y imgbuf -- ) :: draws vertical line down, from
+ coordinates X,Y, with specified length.
+
++ box ( color x2 x1 y2 y1 imgbuf -- ) :: draws rectangular box. x2
+ bust be >= x1, y2 must be >= y1.
+
+ #+begin_example
+ x1,y1-----------+
+ | |
+ | |
+ +-----------x2,y2
+ #+end_example
+
++ flipv ( imgbuf -- ) :: flip image vertically.
+
++ imgcoltrans ( ImgBuf Color ToColor -- ) :: Translate all pixels in
+ specified image with "Color" into "ToColor".
+
++ imgfill ( color x y imgbuf -- ) :: Fill image region starting at
+ location X & Y with specified color.
+
+
** Trigonometry functions
*** sin ( a -- result )
:PROPERTIES: