-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
165 lines (106 loc) · 3.66 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
-*- text -*-
Mikode
Mikode is an Assembly language Compiler and Emulator, written as a tool to
teach kids. The Syntax is a little less daunting, with Instructions like
LoadImm instead of LDA or Increment instead of INC.
The Compiler parses this faux Assembly code into binary instructions based
off the Atmel AVR MCU.
The Emulator has an address space of 64K including Monitor ROM to display
characters to the screen.
The inspiration to write this program came from the desire to teach kids
and interested adults about the foundations of computer logic.
Using Mikode, one should ultimately be able to teach how to write simple
games in Assembly.
Doesn't that sound like fun?
Be sure to read BUGS and INSTALL.
Mail suggestions to reburns@protonmail.com, report bugs
and submit patches to https://github.com/bobburns/mikode
-----
Building
Mikode uses a fork of the recursie descent parse, TinyExpr
that has been modified to handle bitwise instructions. Nothing
needs to be done for this.
Mikode requires the ncurses library. This can be installed
via apt install libcurses-dev
See INSTALL for detailed instructions, but you should be able
to build with './configure; make' and then 'sudo make install'
-----
Usage
mikode [-rg] [-s] [--run] [--gpio] [--sleep=TIME] file
-----
Examples
Checkout the examples directory and compile example1.asm with
'mikode example1.asm' then run it with 'mikode -r example1'
-----
Documentation and Tutorials
The instruction set for Mikode can be found at
https://github.com/bobburns/mikode/wiki
Tutorials will be coming soon.
-----
Memory
Stack
0xf000 - 0xffff
Screen Rom
0xc000 - 0xd400 Set to 128 (0x80) by 40 (0x28)
Key in
0xe000 Load from this address to get key input
This will return ascii coded byte. Also,
special keys: left arrow (4), right arrow (5)
up arrow (3), down arrow (2)
GPIO
Requires root. Works with the Raspberry Pi A+,B+,2B,3B
Register bits correspond to gpio 6, 13, 19, 26, 12, 16, 20, 21
0xe100 - output
0xe101 - set direction
0xe102 - input
See examples/blink.asm
Random
0xe004 - 0xe007 Random int value every cycle
Registers
r0 - r15
X = r13:r12
Y = r15:r14
Flags - Sreg
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| - | - | - | - | - | - | - | - |
| - | T | - | S | V | N | Z | C |
[T] Transfer flag
[S] Sign flag
[V] Overflow flag
[N] Negative flag
[Z] Zero flag
[C] Carry flag
-----
Special Keys during execution
F1 - toggle display registers
F2 - clear display registers
F3 - break (quit)
F4 - stop/start execution
F5 - step
-----
Ideas
Implement address space that interfaces with Raspberry Pi GPIO
Tarball available at
https://people.ucsc.edu/~reburns/downloads
-----
Caveates
** There must be no space between .db values. example:
.db 0,0 not .db 0, 0
Licensing
Mikode is released under the General Public License version 3 (GPLv3+).
Additionally, Autoconf includes a licensing exception in some of its
source files; see the respective copyright notices for how your
project is impacted by including scripts generated by Autoconf, and the
COPYING.EXCEPTION file for the exception in terms of the Additional
Permissions as described in section 7 of GPLv3.
For more licensing information, see
<http://www.gnu.org/licenses/gpl-faq.html> and
<http://www.gnu.org/licenses/exceptions.html>.
For any copyright year range specified as YYYY-ZZZZ in this package
note that the range specifies every single year in that closed interval.
-----
Copyright (C) 2017 Bob Burns
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.