about summary refs log tree commit diff stats
path: root/118parse-hex-int.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-12-28 20:01:47 -0800
committerKartik Agaram <vc@akkartik.com>2020-12-28 20:01:47 -0800
commit83bec4a59eec5a704aab037ca0d2fd6ebcd0dbc0 (patch)
treeeab790ca2dc543b21eab553175a1a16bdc6279c1 /118parse-hex-int.subx
parent6e79e84a72fac33a4f83e3dbd595888d10c22c54 (diff)
downloadmu-83bec4a59eec5a704aab037ca0d2fd6ebcd0dbc0.tar.gz
7449
There's an ambiguity in how x86 interprets disp32 fields:

- For jumps and calls they're displacements from the starting address of
  the next instruction. So far so good.

- However, when the ModR/M requires them they can also be absolute addresses.

Ideally I'd take the presence of the ModR/M byte into account in interpreting
them.

However, it's easier to assume relative addressing only for labels in the
code segment.

This commit raises an error if we ever refer to labels in the code segment
in instructions with a ModR/M byte. (I'm assuming that no instruction with
a ModR/M byte will ever use a displacement without the ModR/M byte requiring
it.)
Diffstat (limited to '118parse-hex-int.subx')
0 files changed, 0 insertions, 0 deletions
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219