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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
//! An implementation of the [`pir-8` ISA](https://github.com/thecoshman/pir-8/blob/master/ISA.md).
//!
//! # The library
//!
//! [`pir-8-emu`](https://github.com/LoungeCPP/pir-8-emu) can be thought of as consisting of layers:
//!
//! The first layer is the [`isa`](isa/) module,
//! which contains a pure implementation of the [`pir-8` ISA](https://github.com/thecoshman/pir-8/blob/master/ISA.md),
//! and can be used on its own to parse/generate binaries and assembly at the instruction level.
//!
//! The second layer is the [`vm`](vm/) module,
//! which contains parts of VM memory and port handling.
//!
//! The third layer is the [`micro`](micro/) module,
//! which contains a full stack-based microcode implementation,
//! and can be used to fully emulate a `pir-8` machine (see example inside).
//!
//! The fourth layer is the various [`binutils`](binutils/),
//! which contain useful parts of the executables,
//! like [`AssemblerDirective`](binutils/pir_8_as/enum.AssemblerDirective.html) and
//!      [`OutputWithQueue`](binutils/pir_8_as/struct.OutputWithQueue.html),
//! or [`NativePortHandler`](binutils/pir_8_emu/struct.NativePortHandler.html).
//!
//! These utilities can be used to quickly and correctly build off existing solutions,
//! but may have some quirks or be less absolutely generic
//! (e.g. [`Vm`](binutils/pir_8_emu/struct.Vm.html) will allow you to integrate
//!  a fully (as-emulator) controllable and functional `pir-8` virtual machine in about 5 lines,
//!  but it needs to have the `INS` SP register be observed after each μOp (see example inside)).
//!
//! # The binaries
//!
//! The headers link to manpages with more detailed usage instructions:
//!
//! ## [`pir-8-as`](https://rawcdn.githack.com/LoungeCPP/pir-8-emu/man/pir-8-as.1.html)
//!
//! An assembler with an… idiosyncratic syntax:
//!
//! ```p8a
//! LOAD IMM WIDE C&D
//! :label load-offset full message -1
//!
//! :label save loop
//! MOVE D X
//! LOAD IMM BYTE Y
//! 1
//! ALU ADD
//! MOVE S D
//! MOVE C X
//! LOAD IMM BYTE Y
//! 0
//! ALU ADDC
//! MOVE S C
//! MADR WRITE C&D
//!
//! LOAD IMM BYTE A
//! 0                ; port number
//! LOAD IND B
//! PORT OUT B
//!
//! MOVE B S
//! COMP S
//!
//! LOAD IMM WIDE ADR
//! :label load full end
//! JMZG
//! LOAD IMM WIDE ADR
//! :label load full loop
//! JUMP
//!
//! :label save end
//! HALT
//!
//!
//! :label save message
//! :literal "*pounces on u* OwO what's whis?"
//! ```
//!
//! If you'd rather use a more normal syntax, [CatPlusPlus](https://github.com/TheCatPlusPlus) has also made
//! a [`fasm`-based assembler](https://github.com/TheCatPlusPlus/pir8/tree/master/Assembler):
//!
//! ```asm
//! include 'pir8.finc'
//!
//! origin 0x0002
//!
//! 	load a, [0x0000]
//! 	load b, [0x0001]
//!
//! top:
//! 	move x, a
//! 	move y, b
//! 	sub
//!
//! 	jmpz exit
//!
//! 	move s, a
//! 	comp b
//!
//! 	jmpl lt
//!
//! 	sub
//! 	move a, s
//! 	jump top
//!
//! lt:
//! 	move y, a
//! 	move x, b
//! 	sub
//! 	move b, s
//! 	jump top
//!
//! exit:
//! 	move d, a
//! 	halt
//! ```
//!
//! ## [`pir-8-disasm`](https://rawcdn.githack.com/LoungeCPP/pir-8-emu/man/pir-8-disasm.1.html)
//!
//! A dissassembler with a [`ndisasm`](https://www.nasm.us)-based frontend:
//!
//! ```plaintext
//! $ pir-8-disasm -k 0x27,31 test-data/copy-any-length-literal-to-port.p8b
//! 00000000   1E   LOAD IMM C
//! 00000001   00 D 0x00
//! 00000002   1A   LOAD IMM X
//! 00000003   27 D 0x27
//! 00000004   1B   LOAD IMM Y
//! 00000005   01 D 0x01
//! 00000006   31   ALU SUB
//! 00000007   4A   MOVE S X
//! 00000008   4F   MOVE S D
//! 00000009   7A   MOVE D X
//! 0000000A   1B   LOAD IMM Y
//! 0000000B   01 D 0x01
//! 0000000C   30   ALU ADD
//! 0000000D   4F   MOVE S D
//! 0000000E   72   MOVE C X
//! 0000000F   1B   LOAD IMM Y
//! 00000010   00 D 0x00
//! 00000011   32   ALU ADDC
//! 00000012   4E   MOVE S C
//! 00000013   0D   MADR WRITE C&D
//! 00000014   1C   LOAD IMM A
//! 00000015   00 D 0x00
//! 00000016   25   LOAD IND B
//! 00000017   E5   PORT OUT B
//! 00000018   69   MOVE B S
//! 00000019   F1   COMP S
//! 0000001A   1C   LOAD IMM A
//! 0000001B   00 D 0x00
//! 0000001C   1D   LOAD IMM B
//! 0000001D   26 D 0x26
//! 0000001E   0C   MADR WRITE A&B
//! 0000001F   14   JMZG
//! 00000020   1C   LOAD IMM A
//! 00000021   00 D 0x00
//! 00000022   1D   LOAD IMM B
//! 00000023   09 D 0x09
//! 00000024   0C   MADR WRITE A&B
//! 00000025   17   JUMP
//! 00000026   FF   HALT
//! 00000027      S skipping 0x1F bytes
//! ```
//!
//! ## [`pir-8-emu`](https://rawcdn.githack.com/LoungeCPP/pir-8-emu/man/pir-8-emu.1.html)
//!
//! The emulator in-of itself:
//!
//! ![Emulator screenshot](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoYAAAGdCAMAAAC4rUKOAAADAFBMVEUvMDOenp4zMzNcOjfDWlD////+/v78/Pz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BhCULUYoncIJWMomWqWLs6RLohAJSSoDQVGj1IPV1lxiiFg6AcrY+PrajduMBFtSHlBlfz9IIjsG1pLxVS8NRvDITabF6PNrTW5CKQQRAxRuFB/wBBauzZ07QxZDOn9LOtyvZo9G7TNvmHMCS9VG9q1necxCyMVKHWkDAyhFTAMBrl3DQi1E07aHBpTI+gV4gxDmx2iQBAwhIAhBAFDCBgCQwgYQlAcw9T5FczHQJMx9B+Fp+ed+TW5NDtDrDFDIgx5ukT4AEMoH0PT791Q+4WiKVF2hiqQzjggKASGPobDWrFjKWPVXoI1Z82kU66XUdwFYMhiqMi+IecdVI4hHqyHUmpDBkM1eoHVOmxnSKdzKASHkD9hY/QLudrQbZztoQZvdU3VfRiiQMAQ2gaGirEXDI2UrUgARDpgCMUwnCDgBAFDCBjigTuoktoQgoAhBAwhCBhCwBCCgCEEDCEIGELAEIKAIQQMIQgYQsAQgoAhBAwhCBhCwBCCgCEEDCEIGELAEIKAIQQMIQgYQsAQgoAhBAwhCBhCwBCCgCEEDCEIGELAEIKAIQQMIQgYQsAQGELAEIKAIQQMIQgYQsAQgoAhBAwhCBhCwBCCgCEEDCEIGELAEIKAIQQMIQgYQsAQgoAhBAwhCBhCwBCCgCEEDCEIGELAEIKAIQQMIQgYQsAQgoAhBAwhCBhCwBCCgCEEDCEIGELAEIKAIQQMIQgYQsAQgoAhBAwhCBhCwBCCgCEEDCEIGELAEIKAIQQMIQgYQsAQgoAhBAwhCBhCwBCCgCEEDCFoRQwhaF0BQ6gODCFodf0/hrA8Bve1qgEAAAAASUVORK5CYII=)
//!
//! # Example programs
//!
//! Apart from the two forthlaid above,
//! take a look at the [`test-data/`](https://github.com/LoungeCPP/pir-8-emu/tree/master/test-data) directory in the git repo,
//! which contains a mix of assembler programs (`.p8a`), program binaries (`.p8b`), and derivations/hand-assemblies (`.diz`).
//!
//! # Native handlers
//!
//! For more information,
//! consult the documentation on [`RawNativePortHandler`](binutils/pir_8_emu/struct.RawNativePortHandler.html).
//!
//! For examples, take a look at the [`handler-examples/`](https://github.com/LoungeCPP/pir-8-emu/tree/master/handler-examples)
//! directory in the git repo.
//! Running `make` at the root thereof *should* build them without much hassle,
//! if it doesn't, please [open an issue](https://github.com/LoungeCPP/pir-8-emu/issues).
//!
//! The
//! [`include/pir-8-emu/port_handler.h`](https://github.com/LoungeCPP/pir-8-emu/tree/master/include/pir-8-emu/port_handler.h)
//! file contains C declarations.
//!
//! # Special thanks
//!
//! To all who support further development on [Patreon](https://patreon.com/nabijaczleweli), in particular:
//!
//!   * ThePhD

extern crate bear_lib_terminal;
#[macro_use]
extern crate downcast_rs;
#[macro_use]
extern crate lazy_static;
extern crate arraydeque;
#[macro_use]
extern crate const_cstr;
extern crate num_traits;
extern crate dlopen;
extern crate serde;
#[macro_use]
extern crate clap;
extern crate libc;
extern crate dirs;
extern crate toml;

mod rw;

pub mod vm;
pub mod isa;
pub mod util;
pub mod micro;
pub mod options;
pub mod binutils;

pub use self::rw::{ReadWriteMarker, ReadWritable};