M2-Planet/test/common_armv7l/armv7l_defs.M1

114 lines
2.2 KiB
Plaintext
Raw Normal View History

2019-03-10 01:22:29 +00:00
## 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 <http://www.gnu.org/licenses/>.
2019-03-30 13:25:52 +00:00
# M2-Planet standards
DEFINE NOP 00000000
2019-03-10 13:33:45 +00:00
# Registers
2019-03-10 01:22:29 +00:00
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
2019-03-17 00:03:56 +00:00
DEFINE BP C
2019-03-10 01:22:29 +00:00
DEFINE R13 D
DEFINE SP D
DEFINE R14 E
DEFINE LR E
DEFINE R15 F
DEFINE PC F
2019-03-10 13:33:45 +00:00
# Register masks for push/pop16
DEFINE {R0} 0100
DEFINE {R1} 0200
2019-03-23 22:29:19 +00:00
DEFINE {R2} 0400
DEFINE {R3} 0800
DEFINE {R4} 1000
2019-03-17 00:03:56 +00:00
DEFINE {R11} 0008
DEFINE {BP} 0010
DEFINE {LR} 0040
# Bitshift constants
DEFINE NO_SHIFT 0
DEFINE LEFT 1
2019-03-17 03:27:52 +00:00
DEFINE RIGHT 3
2019-03-17 00:03:56 +00:00
DEFINE ARITH_RIGHT 5
2019-03-10 13:33:45 +00:00
2019-03-10 01:22:29 +00:00
# LOAD/STORE
DEFINE MEMORY E5
DEFINE STORE32 08
DEFINE STORE8 0C
DEFINE LOAD32 09
DEFINE LOAD8 0D
DEFINE LOADI8_ALWAYS 0A0E3
2019-03-10 15:24:13 +00:00
DEFINE LOADI8_G 0A0C3
DEFINE LOADI8_GE 0A0A3
DEFINE LOADI8_EQUAL 0A003
DEFINE LOADI8_NE 0A013
DEFINE LOADI8_LE 0A0D3
2019-03-10 17:07:19 +00:00
DEFINE LOADI8_L 0A0B3
2019-03-10 01:22:29 +00:00
# JUMP/BRANCH
2019-03-17 00:03:56 +00:00
DEFINE JUMP_ALWAYS EA
2019-03-10 15:24:13 +00:00
DEFINE JUMP_EQUAL 0A
2019-03-17 03:27:52 +00:00
DEFINE JUMP_NE 1A
2019-03-10 13:33:45 +00:00
DEFINE CALL_ALWAYS EB
2019-03-18 02:34:26 +00:00
DEFINE CALL_REG_ALWAYS FF2FE1
2019-03-30 13:25:52 +00:00
DEFINE RETURN FF2FE1
2019-03-10 01:22:29 +00:00
# Data movement
2019-03-17 00:03:56 +00:00
DEFINE MOVE_ALWAYS A0E1
2019-03-10 17:07:19 +00:00
DEFINE MVN_ALWAYS 0E0E1
2019-03-23 22:29:19 +00:00
DEFINE MVN_LT 0E0B1
2019-03-18 02:34:26 +00:00
DEFINE MVNI8_EQUAL 0E003
2019-03-10 13:33:45 +00:00
DEFINE PUSH_ALWAYS 2DE9
2019-03-23 22:29:19 +00:00
DEFINE POP_ALWAYS BDE8
2019-03-10 13:33:45 +00:00
2019-03-10 17:07:19 +00:00
# Arithmetic/logic
2019-03-10 15:24:13 +00:00
DEFINE AUX_ALWAYS E1
DEFINE IMM_ALWAYS E3
2019-03-10 13:33:45 +00:00
DEFINE ARITH_ALWAYS E2
2019-03-23 22:29:19 +00:00
DEFINE ARITH_GE A2
DEFINE ARITH_LT B2
DEFINE ARITH_NE 12
2019-03-10 17:07:19 +00:00
DEFINE ARITH2_ALWAYS E0
2019-03-23 22:29:19 +00:00
DEFINE ARITH2_GE A0
2019-03-30 13:25:52 +00:00
DEFINE ADC 0A
2019-03-23 22:29:19 +00:00
DEFINE ADCS 0B
2019-03-10 13:33:45 +00:00
DEFINE ADD 08
2019-03-23 22:29:19 +00:00
DEFINE ADDS 09
2019-03-17 00:03:56 +00:00
DEFINE AND 00
2019-03-10 15:24:13 +00:00
DEFINE CMP 005
DEFINE CMPI8 005
2019-03-17 00:03:56 +00:00
DEFINE MUL 0
DEFINE MULS 1
2019-03-17 00:03:56 +00:00
DEFINE OR 08
DEFINE SHIFT A0
2019-03-10 17:07:19 +00:00
DEFINE SUB 04
2019-03-23 22:29:19 +00:00
DEFINE RSUB 06
2019-03-17 00:03:56 +00:00
DEFINE XOR 02
2019-03-10 01:22:29 +00:00
# SYSCALL
DEFINE SYSCALL_ALWAYS 000000EF