Skip to content

Commit f72150f

Browse files
committed
Update readme, add flowcharts
1 parent 6b1edfe commit f72150f

File tree

3 files changed

+73
-2
lines changed

3 files changed

+73
-2
lines changed

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ As this is not on crates.io, dependency is specified using this repository itsel
4747

4848
```TOML
4949
[dependencies]
50-
emulator_8086_lib = { git = "https://github.com/YJDoc2/8086-Emulator" }
50+
emulator_8086 = { git = "https://github.com/YJDoc2/8086-Emulator" }
5151
```
5252

5353
This will allow to import and use the core library of this in your project :
@@ -67,7 +67,7 @@ or use it under different name :
6767
```TOML
6868
...
6969
[dependencies]
70-
a_different_name = { git = "https://github.com/YJDoc2/8086-Emulator" }
70+
a_different_name = { git = "https://github.com/YJDoc2/8086-Emulator", package="emulator_8086"}
7171
...
7272
```
7373

@@ -127,6 +127,7 @@ The complete project has following file structure :
127127
├── LICENSE-APACHE -> Licence file
128128
├── LICENCE-MIT -> Licence file
129129
├── syntax.md -> file containing syntax for the assembler
130+
├── flowcharts.md -> Markdown file containing flowcharts for various parts of emulator
130131
└── .gitignore -> gitignore file for the repository
131132
```
132133

@@ -151,6 +152,8 @@ The flow of the complete process is :
151152
- The driver checks for errors, start labels, and if all labels that are used before declaration (in jump commands) are declared or not. Then it gives data list of preprocessor output to data parser, which interprets data commands and stores the data into vm's memory
152153
- The driver checks for errors and runs an unconditional loop, in which it gives the code instructions to interpreter, checks its return state, and accordingly gives next input. If it is run in interpreted mode / encounters int 3 or trap flag is set, it also provides user prompt and interprets and runs print commands. Driver also has responsibility to handle DOS and BIOS interrupts.
153154

155+
Flowcharts for various parts of emulator are in the [flowcharts.md](./flowcharts.md) file.
156+
154157
---
155158

156159
## License

examples/hello_world.s

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
; Program to show use of interrupts
2+
; Also, Hello World program !
3+
hello: DB "Hello World" ; store string
4+
5+
; actual entry point of the program, must be present
6+
start:
7+
MOV AH, 0x13 ; move BIOS interrupt number in AH
8+
MOV CX, 11 ; move length of string in cx
9+
MOV BX, 0 ; mov 0 to bx, so we can move it to es
10+
MOV ES, BX ; move segment start of string to es, 0
11+
MOV BP, OFFSET hello ; move start offset of string in bp
12+
MOV DL, 0 ; start writing from col 0
13+
int 0x10 ; BIOS interrupt

flowcharts.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
```mermaid
2+
graph TD
3+
subgraph Overall Flowchart
4+
start([Start])-->read
5+
read[Read Code]-->preprocess
6+
preprocess[Process code in Preprocessor]-->|Data instruction|data
7+
preprocess[Process code in Preprocessor]-->|Code instruction|driver
8+
data[For each instruction]-->data_processor
9+
data_processor[Input instruction to data processor]-->data
10+
driver[Driver]-->instr
11+
instr[Input instruction to Interpreter]-->status
12+
status[Get Status code]-->status_action
13+
status_action[Take appropriate action]-->instr
14+
status_action[Take appropriate action]-->|Error|error
15+
error[Display Error Information]-->halt
16+
status_action[Take appropriate action]-->|Halt instruction|halt
17+
halt[Stop the emulator]
18+
end
19+
```
20+
21+
```mermaid
22+
graph TD
23+
subgraph Interpreter Process Flowchart
24+
start([Start])-->instr_command
25+
instr_command[Parse Instruction Command]-->action
26+
action[Take appropriate Action]-->return
27+
return([Return Status Value])
28+
end
29+
```
30+
31+
```mermaid
32+
graph TD
33+
subgraph Data Process Flowchart
34+
start([Start])-->data_command
35+
data_command[Parse Data command]-->action
36+
action[Store Data in memory accordingly]-->return
37+
return([Return])
38+
end
39+
```
40+
41+
```mermaid
42+
graph TD
43+
subgraph Preprocess Flowchart
44+
start([Start])-->input
45+
input(User Enters Code)-->|preprocess|case
46+
case[Make the case Uniform and parse numbers]-->labels
47+
labels[Process and store label locations]-->macro
48+
macro[Replace and process <br/>macro declaration and invocation]-->function
49+
function[Process and store function locations]-->verify
50+
verify[Verify syntax]-->|IR|split
51+
verify[Verify syntax]-->|error|error([Return Error])
52+
split[Split data and program instructions]-->return
53+
return([Return Data and Code instructions <br/> Along with context information])
54+
end
55+
```

0 commit comments

Comments
 (0)