-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
72 lines (52 loc) · 1.34 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
------------------------------------------------------------------------
This project's goal is to design a custom CPU
Instruction Set
Assembly Language
Compiled Language
Verilog FPGA Implemenation
Processor
24 Instructions
16 Registers
Assembly Language
Assembler
Emulator
Debugger
doc/ - Technical documention describing all aspects of this project.
progs/ - Programs written to run on the CPU.
hdl/ - Hardware to run
Arithmetic: 7 add,sub,adc,sbc,mul,div,cmp
Load/Store/Move: 5 ldw,ldb,stw,stb,mov
Bitwise: 6 and,or,xor,nor,lsl,lsr
Jumps: 5 jmp,jz,jnz,jl,jge
Other: 1 die,nop
--
24
die
#
# Install dependencies.
#
sudo apt-get install libncurses5 libncurses5-dev
#
# Build a ROM and binary file from assembly code.
#
./assembler.py --assemble test.asm -b test.bin > test.rom
#
# Run the ROM in the emulator.
#
./emulator -r test.rom
#
# Run the binary in the emulator.
#
./emulator -b test.bin:0x0
#
# Run the kernel in the emulator.
#
./emulator -b progs/boot.bin:0x4000 -b sd.img:0x5000 -p 0x4000 -i
#
# Run the kernel using the debugger.
#
./emulator -b progs/boot.bin:0x4000 -b sd.img:0x5000 -g progs/all.kernel.bin:0x0 -g progs/lib.bin:0x3000 -p 0x4000 -i -t 2> error.out
#
# Dump heap contents in human readable format.
#
./heap -m emulator.memory -o 0x10000 -z $(( 0x1FF0000 )) -s