📄 cpu86instr.vhd
字号:
-------------------------------------------------------------------------------
-- CPU86 - VHDL CPU8088 IP core --
-- Copyright (C) 2005-2008 HT-LAB --
-- --
-- Contact/bugs : http://www.ht-lab.com/misc/feedback.html --
-- Web : http://www.ht-lab.com --
-- --
-- CPU86 is released as open-source under the Aladdin Free Public License. --
-- Contact HT-Lab for commercial applications and/or support contracts. --
-- --
-- Full details of the license can be found in the file "cpu86_license.txt" --
-- which is included in the distribution zip file. --
-------------------------------------------------------------------------------
LIBRARY ieee;USE ieee.std_logic_1164.all;PACKAGE cpu86instr IS------------------------------------------------------------------------------- INC/DEC Word Register -----------------------------------------------------------------------------constant INCREG0 : std_logic_vector(7 downto 0) := X"40"; -- Inc Registerconstant INCREG1 : std_logic_vector(7 downto 0) := X"41"; constant INCREG2 : std_logic_vector(7 downto 0) := X"42"; constant INCREG3 : std_logic_vector(7 downto 0) := X"43"; constant INCREG4 : std_logic_vector(7 downto 0) := X"44"; constant INCREG5 : std_logic_vector(7 downto 0) := X"45"; constant INCREG6 : std_logic_vector(7 downto 0) := X"46"; constant INCREG7 : std_logic_vector(7 downto 0) := X"47"; constant DECREG0 : std_logic_vector(7 downto 0) := X"48"; -- DEC Registerconstant DECREG1 : std_logic_vector(7 downto 0) := X"49"; constant DECREG2 : std_logic_vector(7 downto 0) := X"4A"; constant DECREG3 : std_logic_vector(7 downto 0) := X"4B"; constant DECREG4 : std_logic_vector(7 downto 0) := X"4C"; constant DECREG5 : std_logic_vector(7 downto 0) := X"4D"; constant DECREG6 : std_logic_vector(7 downto 0) := X"4E"; constant DECREG7 : std_logic_vector(7 downto 0) := X"4F"; ------------------------------------------------------------------------------- IN -----------------------------------------------------------------------------constant INFIXED0 : std_logic_vector(7 downto 0) := X"E4"; -- Fixed Port Byteconstant INFIXED1 : std_logic_vector(7 downto 0) := X"E5"; -- Fixed Port Wordconstant INDX0 : std_logic_vector(7 downto 0) := X"EC"; -- DX Byteconstant INDX1 : std_logic_vector(7 downto 0) := X"ED"; -- DX Word------------------------------------------------------------------------------- OUT -----------------------------------------------------------------------------constant OUTFIXED0 : std_logic_vector(7 downto 0) := X"E6"; -- Fixed Port Byteconstant OUTFIXED1 : std_logic_vector(7 downto 0) := X"E7"; -- Fixed Port Wordconstant OUTDX0 : std_logic_vector(7 downto 0) := X"EE"; -- DX Byteconstant OUTDX1 : std_logic_vector(7 downto 0) := X"EF"; -- DX Word------------------------------------------------------------------------------- Move Immediate to Register-----------------------------------------------------------------------------constant MOVI2R0 : std_logic_vector(7 downto 0) := X"B0"; -- Immediate to Registerconstant MOVI2R1 : std_logic_vector(7 downto 0) := X"B1"; -- Byteconstant MOVI2R2 : std_logic_vector(7 downto 0) := X"B2";constant MOVI2R3 : std_logic_vector(7 downto 0) := X"B3";constant MOVI2R4 : std_logic_vector(7 downto 0) := X"B4";constant MOVI2R5 : std_logic_vector(7 downto 0) := X"B5";constant MOVI2R6 : std_logic_vector(7 downto 0) := X"B6";constant MOVI2R7 : std_logic_vector(7 downto 0) := X"B7";constant MOVI2R8 : std_logic_vector(7 downto 0) := X"B8"; -- Wordconstant MOVI2R9 : std_logic_vector(7 downto 0) := X"B9";constant MOVI2R10 : std_logic_vector(7 downto 0) := X"BA";constant MOVI2R11 : std_logic_vector(7 downto 0) := X"BB";constant MOVI2R12 : std_logic_vector(7 downto 0) := X"BC";constant MOVI2R13 : std_logic_vector(7 downto 0) := X"BD";constant MOVI2R14 : std_logic_vector(7 downto 0) := X"BE";constant MOVI2R15 : std_logic_vector(7 downto 0) := X"BF";------------------------------------------------------------------------------- Move Immediate to Register/memory-----------------------------------------------------------------------------constant MOVI2RM0 : std_logic_vector(7 downto 0) := X"C6"; constant MOVI2RM1 : std_logic_vector(7 downto 0) := X"C7"; -- Word------------------------------------------------------------------------------- Segment Register to Register or Memory-----------------------------------------------------------------------------constant MOVS2RM : std_logic_vector(7 downto 0) := X"8C"; ------------------------------------------------------------------------------- Register or Memory to Segment Register-----------------------------------------------------------------------------constant MOVRM2S : std_logic_vector(7 downto 0) := X"8E"; ------------------------------------------------------------------------------- Memory to Accumulator ADDRL,ADDRH-----------------------------------------------------------------------------constant MOVM2A0 : std_logic_vector(7 downto 0) := X"A0"; constant MOVM2A1 : std_logic_vector(7 downto 0) := X"A1"; ------------------------------------------------------------------------------- Accumulator to Memory to Accumulator ADDRL,ADDRH-----------------------------------------------------------------------------constant MOVA2M0 : std_logic_vector(7 downto 0) := X"A2"; constant MOVA2M1 : std_logic_vector(7 downto 0) := X"A3"; ------------------------------------------------------------------------------- Register/Memory to/from Register-----------------------------------------------------------------------------constant MOVRM2R0 : std_logic_vector(7 downto 0) := X"88"; constant MOVRM2R1 : std_logic_vector(7 downto 0) := X"89"; constant MOVRM2R2 : std_logic_vector(7 downto 0) := X"8A"; constant MOVRM2R3 : std_logic_vector(7 downto 0) := X"8B"; ------------------------------------------------------------------------------- Segment Override Prefix-----------------------------------------------------------------------------constant SEGOPES : std_logic_vector(7 downto 0) := X"26";constant SEGOPCS : std_logic_vector(7 downto 0) := X"2E";constant SEGOPSS : std_logic_vector(7 downto 0) := X"36";constant SEGOPDS : std_logic_vector(7 downto 0) := X"3E";------------------------------------------------------------------------------- ADD/ADC/SUB/SBB/CMP/AND/OR/XOR Register/Memory to Register-----------------------------------------------------------------------------constant ADDRM2R0 : std_logic_vector(7 downto 0) := X"00"; constant ADDRM2R1 : std_logic_vector(7 downto 0) := X"01"; constant ADDRM2R2 : std_logic_vector(7 downto 0) := X"02"; constant ADDRM2R3 : std_logic_vector(7 downto 0) := X"03"; constant ADCRM2R0 : std_logic_vector(7 downto 0) := X"10"; constant ADCRM2R1 : std_logic_vector(7 downto 0) := X"11"; constant ADCRM2R2 : std_logic_vector(7 downto 0) := X"12"; constant ADCRM2R3 : std_logic_vector(7 downto 0) := X"13";constant SUBRM2R0 : std_logic_vector(7 downto 0) := X"28"; constant SUBRM2R1 : std_logic_vector(7 downto 0) := X"29"; constant SUBRM2R2 : std_logic_vector(7 downto 0) := X"2A"; constant SUBRM2R3 : std_logic_vector(7 downto 0) := X"2B";constant SBBRM2R0 : std_logic_vector(7 downto 0) := X"18"; constant SBBRM2R1 : std_logic_vector(7 downto 0) := X"19"; constant SBBRM2R2 : std_logic_vector(7 downto 0) := X"1A"; constant SBBRM2R3 : std_logic_vector(7 downto 0) := X"1B";constant CMPRM2R0 : std_logic_vector(7 downto 0) := X"38"; constant CMPRM2R1 : std_logic_vector(7 downto 0) := X"39"; constant CMPRM2R2 : std_logic_vector(7 downto 0) := X"3A"; constant CMPRM2R3 : std_logic_vector(7 downto 0) := X"3B";constant ANDRM2R0 : std_logic_vector(7 downto 0) := X"20"; constant ANDRM2R1 : std_logic_vector(7 downto 0) := X"21"; constant ANDRM2R2 : std_logic_vector(7 downto 0) := X"22"; constant ANDRM2R3 : std_logic_vector(7 downto 0) := X"23"; constant ORRM2R0 : std_logic_vector(7 downto 0) := X"08"; constant ORRM2R1 : std_logic_vector(7 downto 0) := X"09"; constant ORRM2R2 : std_logic_vector(7 downto 0) := X"0A"; constant ORRM2R3 : std_logic_vector(7 downto 0) := X"0B";constant XORRM2R0 : std_logic_vector(7 downto 0) := X"30"; constant XORRM2R1 : std_logic_vector(7 downto 0) := X"31"; constant XORRM2R2 : std_logic_vector(7 downto 0) := X"32"; constant XORRM2R3 : std_logic_vector(7 downto 0) := X"33";------------------------------------------------------------------------------- OPCODE 80,81,83, ADD/ADC/SUB/SBB/CMP/AND/OR/XOR Immediate to Reg/Mem -- Instruction defined in reg field-----------------------------------------------------------------------------constant O80I2RM : std_logic_vector(7 downto 0) := X"80"; constant O81I2RM : std_logic_vector(7 downto 0) := X"81"; --constant O82I2RM : std_logic_vector(7 downto 0) := X"82"; constant O83I2RM : std_logic_vector(7 downto 0) := X"83"; ------------------------------------------------------------------------------- ADD/ADC/SUB/SBB/CMP/AND/OR/XOR Immediate with ACCU -----------------------------------------------------------------------------constant ADDI2AX0 : std_logic_vector(7 downto 0) := X"04"; constant ADDI2AX1 : std_logic_vector(7 downto 0) := X"05"; constant ADCI2AX0 : std_logic_vector(7 downto 0) := X"14"; constant ADCI2AX1 : std_logic_vector(7 downto 0) := X"15"; constant SUBI2AX0 : std_logic_vector(7 downto 0) := X"2C"; constant SUBI2AX1 : std_logic_vector(7 downto 0) := X"2D"; constant SBBI2AX0 : std_logic_vector(7 downto 0) := X"1C"; constant SBBI2AX1 : std_logic_vector(7 downto 0) := X"1D"; constant CMPI2AX0 : std_logic_vector(7 downto 0) := X"3C"; constant CMPI2AX1 : std_logic_vector(7 downto 0) := X"3D"; constant ANDI2AX0 : std_logic_vector(7 downto 0) := X"24"; constant ANDI2AX1 : std_logic_vector(7 downto 0) := X"25"; constant ORI2AX0 : std_logic_vector(7 downto 0) := X"0C"; constant ORI2AX1 : std_logic_vector(7 downto 0) := X"0D"; constant XORI2AX0 : std_logic_vector(7 downto 0) := X"34"; constant XORI2AX1 : std_logic_vector(7 downto 0) := X"35"; ------------------------------------------------------------------------------- TEST (Same as AND but without returning any results) -----------------------------------------------------------------------------constant TESTRMR0 : std_logic_vector(7 downto 0) := X"84"; constant TESTRMR1 : std_logic_vector(7 downto 0) := X"85"; constant TESTI2AX0 : std_logic_vector(7 downto 0) := X"A8"; constant TESTI2AX1 : std_logic_vector(7 downto 0) := X"A9"; ------------------------------------------------------------------------------- NOT/TEST F6/F7 Shared Instructions -- TEST regfield=000 -- NOT regfield=010 -- MUL regfield=100-- IMUL regfield=101-- DIV regfield=110
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -