## Copyright (C) 2016 Jeremiah Orians ## This file is part of stage0. ## ## stage0 is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## stage0 is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with stage0. If not, see . # Registers DEFINE R0 0 DEFINE R1 1 DEFINE R2 2 DEFINE R3 3 DEFINE R4 4 DEFINE R5 5 DEFINE R6 6 DEFINE R7 7 DEFINE R8 8 DEFINE R9 9 DEFINE R10 A DEFINE R11 B DEFINE R12 C DEFINE R13 D DEFINE SP D DEFINE R14 E DEFINE LR E DEFINE R15 F DEFINE PC F # Register masks for push/pop16 DEFINE {R0} 0100 DEFINE {R1} 0200 DEFINE {R12} 0010 DEFINE {R14} 0040 # LOAD/STORE DEFINE MEMORY E5 DEFINE STORE32 08 DEFINE STORE8 0C DEFINE LOAD32 09 DEFINE LOAD8 0D DEFINE LOADI8_ALWAYS 0A0E3 DEFINE LOADI8_G 0A0C3 DEFINE LOADI8_GE 0A0A3 DEFINE LOADI8_EQUAL 0A003 DEFINE LOADI8_NE 0A013 DEFINE LOADI8_LE 0A0D3 DEFINE LOADI8_L 0A0B3 # JUMP/BRANCH DEFINE JUMP EA DEFINE JUMP_EQUAL 0A DEFINE CALL_ALWAYS EB # Data movement DEFINE MOVE_ALWAYS 0A0E1 DEFINE MVN_ALWAYS 0E0E1 DEFINE PUSH_ALWAYS 2DE9 DEFINE POP_ALWAYS bde8 # Arithmetic/logic DEFINE AUX_ALWAYS E1 DEFINE IMM_ALWAYS E3 DEFINE ARITH_ALWAYS E2 DEFINE ARITH2_ALWAYS E0 DEFINE ADD 08 DEFINE XOR 02 DEFINE CMP 005 DEFINE CMPI8 005 DEFINE SUB 04 # SYSCALL DEFINE SYSCALL_ALWAYS 000000EF