Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerliu committed Oct 12, 2016
1 parent 4ff9f92 commit 2608641
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/instr_file.txt
@@ -0,0 +1,40 @@
/*
*
* MOMENT OF INERTIA STANDARD BYTECODE FILE FORMAT - .moi files
*
* Created by Tyler Liu on 2016/09/23.
* Copyright © 2016 Tyler Liu. All rights reserved.
*
* PUBLISHED UNDER THE GNU GENERAL PUBLIC LICENSE v3.0.
*
* Byte -1: total instruction count
* pointer: point to the location of the desired byte instruction
*
* #define INERTIA_ADD 0x0 // Addition
* #define INERTIA_DIV 0x1 // Division
* #define INERTIA_MUL 0x2 // Multiplication
*
* #define INERTIA_LTN 0x3 // Less Than
* #define INERTIA_EQL 0x4 // Equal To
* #define INERTIA_AND 0x5 // Bitwise AND
* #define INERTIA_NOT 0x6 // Bitwise NOT
* #define INERTIA_OR 0x7 // Bitwise OR
* #define INERTIA_SHIFTL 0x8 //Bitwise SHIFTL
* #define INERTIA_SHIFTR 0x9 //Bitwise SHIFTR
*
* #define INERTIA_PRINT 0xA // Print to stdout
* #define INERTIA_LOAD 0xB // Load value
* #define INERTIA_GOTO 0xC //goto
* #define INERTIA_IF 0xD //if reg1 = false, skip to reg2
* #define INERTIA_RETURN 0xE //return
* #define INERTIA_CALL 0xF // call function
*
* //0 as memory, 1 as register, 2 as const
*
* instruction set as the first 4 bits
* type of input as following 2 bits, 2*3 = 6 bits
* field for register as following 2 bits, 2*3 = 6bits
* field for memory as folloing 16 bits, 16 + 16* 2 = 48 bits, later two in second unsigned
* field for const as following unsigned, optional(does not need without use of it).
*/

0 comments on commit 2608641

Please sign in to comment.