/ README.md
README.md
 1  # BIT HAVOC
 2  
 3  ## What is bit havoc
 4  
 5  bit havoc is a binary style language for writing little toy OS's.
 6  
 7  ## The language
 8  
 9  The language consists of 4 charactors
10  1,0, ,\n
11  in the BitHavocEditor those are the only charactors you can type and the rest will be 1 if it is on the left side of the keyboard and 0 if it is on the right.
12  
13  ## How to use bitHavoc
14  
15  clone the Repo
16  
17  ```
18  git clone https://github.com/Freeboardtortoise/BitHavoc.git
19  cd BitHavoc
20  ```
21  
22  Install python
23  
24  ```
25  --- arch based OS ---
26  sudo pacman -S python3
27  --- ubuntu based OS ---
28  sudo apt install python3
29  --- windows ---
30  figure it out
31  ```
32  
33  start editing a .bh file with the bhEditor
34  
35  ```
36  python3 editor.py main.bh
37  ```
38  
39  create persistant storage (if needed)
40  
41  ```
42  python3 main.py create-persistant-storage
43  ```
44  
45  run the bitHavoc file
46  
47  ```
48  python3 main.py run main.bh
49  ```
50  
51  ## what is the bitHavocEditor
52  
53  The bitHavoc editor is an editor that prioritises speed and you can only type 1 0 space or enter
54  
55  ## commands and controls for the BH editor
56  
57  | Command | what does it do                                                                                          |
58  | ------- | -------------------------------------------------------------------------------------------------------- |
59  | q       | quits the editor                                                                                         |
60  | s       | saves the file (if there is no file you opened or not saved to anything eg. new file it will prompt you) |
61  | l       | loads a file (will prompt you for a file name or path)                                                   |
62  
63  ## bitHavoc op Codes
64  
65  | Op code  | function                          |
66  | -------- | --------------------------------- |
67  | 00000001 | set [1] to value of address [2]   |
68  | 00000010 | read from user 1 bit into [1]     |
69  | 00000011 | write memory adress [1] to screen |
70  
71  If statements
72  |Opt Code|function|
73  |--------|--------|
74  | 00100001 |if [0] == [1] goto line [2] |
75  | 00100010 |if [0] >= [1] goto line [2] |
76  | 00100011 |if [0] <= [1] goto line [2] |
77  | 00100110 |if [0] > [1] goto line [2] |
78  | 00100111 |if [0] < [1] goto line [2] |
79  | 00100101 |if [0] != [1] goto line [2] |
80  
81  running from memory
82  | Opt Code | function |
83  |-----|-----|
84  | 00001111 | run from memory [1] with args [memory[line[2]:]] |
85  
86  persistant storage
87  | Opt Code | function |
88  | 00001010 | load from persistant memory from [1] to [2] in memory |
89  | 00010101 | write to persistant memory from memory at [1] to persistant at [2] |
90  
91  Threading
92  | Opt Code | function |
93  | 01011111 | threading start new thread at line [0] and end at line [1], start at time [2] and call it [3]
94  
95  Time
96  | Opt Code | function |
97  | ------------- | ----------- |
98  | 01001010 | waits [1] secconds |