summaryrefslogtreecommitdiff
path: root/spec/iex/iex-spec.txt
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2021-04-30 14:06:58 -0400
committerKyle Gunger <kgunger12@gmail.com>2021-04-30 14:06:58 -0400
commitc625ed1cfe7f7ea4ab2a75a8a0a6a6772f86431c (patch)
tree55aab8a27a6cd3b0a979002afa6899a4bda94b74 /spec/iex/iex-spec.txt
parent60f7c4f7272079e635010e464d8ce3a3a427f97f (diff)
Destroy my own code by using goto
Diffstat (limited to 'spec/iex/iex-spec.txt')
-rw-r--r--spec/iex/iex-spec.txt128
1 files changed, 128 insertions, 0 deletions
diff --git a/spec/iex/iex-spec.txt b/spec/iex/iex-spec.txt
new file mode 100644
index 0000000..6979cfc
--- /dev/null
+++ b/spec/iex/iex-spec.txt
@@ -0,0 +1,128 @@
+This is the IEX file specification.
+
+Document version (semver): 0.0.1
+Main Author: Kyle Gunger
+
+License: Apache 2.0
+
+----------------------------------
+
+Contents:
+
+Organization
+
+----------------------------------
+
+Organization
+
+Magic number starts the file "IEX" or 0x49 0x45 0x58
+
+The header of the file can be represented as such
+
+;struct IEX_HEAD {
+ raw {3}char # Always "IEX"
+ magic,
+
+ {}char
+ name,
+ arch,
+ os,
+
+ uint8 # Version info
+ major,
+ minor,
+ patch,
+ # OS abi info
+ os_major,
+ os_minor,
+ os_patch,
+
+ bool # Tells loader that the file holds a main function
+ can_execute,
+
+ ~void ({}{}char args) [int]
+ # Address of main in file
+ start_addr,
+
+ {}IEX_SECTION
+ sections,
+
+ {}IEX_LIB
+ dependencies,
+
+ IEX_MODULE
+ self
+}
+
+a section is defined as
+
+;struct IEX_SECTION {
+ {}char
+ name,
+
+ uint8 # Denotes dependency, symbol table, data, bss, text, etc.
+ type,
+
+ ~void # Points to start and end of section
+ start,
+ end
+}
+
+;struct IEX_LIB {
+ {}char
+ name,
+
+ uint8 # Version info
+ major,
+ minor,
+ patch
+}
+
+;struct IEX_MODULE {
+ {}char
+ name,
+
+ {}IEX_FUNCTION
+ func,
+
+ {}IEX_TYPE
+ types,
+
+ {}IEX_MODULE
+ sub
+}
+
+;struct IEX_FUNCTION {
+ {}char
+ name,
+
+ uint32
+ overload,
+ bytes_in,
+ bytes_out,
+
+ ~void
+ addr
+}
+
+;struct IEX_TYPE {
+ {}char
+ name,
+
+ bool
+ raw_struct,
+ interface,
+ dynamic,
+
+ uint32
+ size,
+
+ {}IEX_FUNCTION
+ methods,
+
+ {}IEX_TYPE
+ supers,
+
+ ~void
+ addr
+}