emulenv.cc (6071:551b62d68f43) emulenv.cc (6437:ecebd7cccb06)
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use of this software in source and binary forms,
6 * with or without modification, are permitted provided that the
7 * following conditions are met:
8 *

--- 104 unchanged lines hidden (view full) ---

113 //instruction anyway, just ignore the base in those cases
114 base = NUM_INTREGS;
115 }
116 }
117 }
118 //Figure out what segment to use. This won't be entirely accurate since
119 //the presence of a displacement is supposed to make the instruction
120 //default to the data segment.
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use of this software in source and binary forms,
6 * with or without modification, are permitted provided that the
7 * following conditions are met:
8 *

--- 104 unchanged lines hidden (view full) ---

113 //instruction anyway, just ignore the base in those cases
114 base = NUM_INTREGS;
115 }
116 }
117 }
118 //Figure out what segment to use. This won't be entirely accurate since
119 //the presence of a displacement is supposed to make the instruction
120 //default to the data segment.
121 if ((base != INTREG_RBP && base != INTREG_RSP) ||
122 0/*Has an immediate offset*/) {
121 if ((base != INTREG_RBP && base != INTREG_RSP) || machInst.dispSize) {
123 seg = SEGMENT_REG_DS;
124 //Handle any segment override that might have been in the instruction
125 int segFromInst = machInst.legacy.seg;
126 if (segFromInst)
127 seg = (SegmentRegIndex)(segFromInst - 1);
128 } else {
129 seg = SEGMENT_REG_SS;
130 }
131}
132
133void EmulEnv::setSeg(const ExtMachInst & machInst)
134{
135 seg = SEGMENT_REG_DS;
136 //Handle any segment override that might have been in the instruction
137 int segFromInst = machInst.legacy.seg;
138 if (segFromInst)
139 seg = (SegmentRegIndex)(segFromInst - 1);
140}
122 seg = SEGMENT_REG_DS;
123 //Handle any segment override that might have been in the instruction
124 int segFromInst = machInst.legacy.seg;
125 if (segFromInst)
126 seg = (SegmentRegIndex)(segFromInst - 1);
127 } else {
128 seg = SEGMENT_REG_SS;
129 }
130}
131
132void EmulEnv::setSeg(const ExtMachInst & machInst)
133{
134 seg = SEGMENT_REG_DS;
135 //Handle any segment override that might have been in the instruction
136 int segFromInst = machInst.legacy.seg;
137 if (segFromInst)
138 seg = (SegmentRegIndex)(segFromInst - 1);
139}