cpu_logical.h

Go to the documentation of this file.
00001 /* ES40 emulator.
00002  * Copyright (C) 2007-2008 by the ES40 Emulator Project
00003  *
00004  * Website: http://sourceforge.net/projects/es40
00005  * E-mail : camiel@camicom.com
00006  * 
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  * 
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00020  * 
00021  * Although this is not required, the author would appreciate being notified of, 
00022  * and receiving any modifications you may make to the source code that might serve
00023  * the general public.
00024  */
00025 
00053 #define DO_AND      state.r[REG_3] = state.r[REG_1] & V_2;
00054 #define DO_BIC      state.r[REG_3] = state.r[REG_1] &~V_2;
00055 #define DO_BIS      state.r[REG_3] = state.r[REG_1] | V_2;
00056 #define DO_EQV      state.r[REG_3] = state.r[REG_1] ^ ~V_2;
00057 #define DO_ORNOT    state.r[REG_3] = state.r[REG_1] | ~V_2;
00058 #define DO_XOR      state.r[REG_3] = state.r[REG_1] ^ V_2;
00059 
00060 #define DO_CMOVEQ   if(!state.r[REG_1]) \
00061     state.r[REG_3] = V_2;
00062 #define DO_CMOVGE   if((s64) state.r[REG_1] >= 0) \
00063     state.r[REG_3] = V_2;
00064 #define DO_CMOVGT   if((s64) state.r[REG_1] > 0) \
00065     state.r[REG_3] = V_2;
00066 #define DO_CMOVLBC  if(!(state.r[REG_1] & U64(0x1))) \
00067     state.r[REG_3] = V_2;
00068 #define DO_CMOVLBS  if(state.r[REG_1] & U64(0x1)) \
00069     state.r[REG_3] = V_2;
00070 #define DO_CMOVLE   if((s64) state.r[REG_1] <= 0) \
00071     state.r[REG_3] = V_2;
00072 #define DO_CMOVLT   if((s64) state.r[REG_1] < 0) \
00073     state.r[REG_3] = V_2;
00074 #define DO_CMOVNE   if(state.r[REG_1]) \
00075     state.r[REG_3] = V_2;
00076 
00077 #define DO_SLL      state.r[REG_3] = state.r[REG_1] << (V_2 & 63);
00078 #define DO_SRA      state.r[REG_3] = (V_2 & 63) ?                      \
00079     (                                                                  \
00080       (state.r[REG_1] >> (V_2 & 63)) |                                 \
00081         ((state.r[REG_1] >> 63) ? (X64_QUAD << (64 - (V_2 & 63))) : 0) \
00082     ) : state.r[REG_1];
00083 #define DO_SRL      state.r[REG_3] = state.r[REG_1] >> (V_2 & 63);

SourceForge.net Logo
Project space on SourceForge.net