DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
src/cpu/core_full/loadwrite.h
00001 /*
00002  *  Copyright (C) 2002-2020  The DOSBox Team
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License along
00015  *  with this program; if not, write to the Free Software Foundation, Inc.,
00016  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 #define SaveIP() reg_eip=(Bit32u)(inst.cseip-SegBase(cs));
00020 #define LoadIP() inst.cseip=SegBase(cs)+reg_eip;
00021 #define GetIP() (inst.cseip-SegBase(cs))
00022 
00023 #define RunException() {                                                                                \
00024         CPU_Exception(cpu.exception.which,cpu.exception.error);         \
00025         continue;                                                                                                       \
00026 }
00027 
00028 static INLINE Bit8u the_Fetchb(EAPoint & loc) {
00029         Bit8u temp=LoadMb(loc);
00030         loc+=1;
00031         return temp;
00032 }
00033         
00034 static INLINE Bit16u the_Fetchw(EAPoint & loc) {
00035         Bit16u temp=LoadMw(loc);
00036         loc+=2;
00037         return temp;
00038 }
00039 static INLINE Bit32u the_Fetchd(EAPoint & loc) {
00040         Bit32u temp=LoadMd(loc);
00041         loc+=4;
00042         return temp;
00043 }
00044 
00045 #define Fetchb() the_Fetchb(inst.cseip)
00046 #define Fetchw() the_Fetchw(inst.cseip)
00047 #define Fetchd() the_Fetchd(inst.cseip)
00048 
00049 #define Fetchbs() (Bit8s)the_Fetchb(inst.cseip)
00050 #define Fetchws() (Bit16s)the_Fetchw(inst.cseip)
00051 #define Fetchds() (Bit32s)the_Fetchd(inst.cseip)
00052 
00053 #define Push_16 CPU_Push16
00054 #define Push_32 CPU_Push32
00055 #define Pop_16 CPU_Pop16
00056 #define Pop_32 CPU_Pop32
00057