Commit dba0a4f
authored
Update read/written registers for x86 string instructions (#2790)
* stosb/w/d/q
stosq only reads/writes rcx when there is a rep prefix.
With regard to reading 'es' in 64-bit mode, the SDM says for stosd
For legacy mode, store EAX at address ES:(E)DI; For 64-bit mode store
EAX at address RDI or EDI.
* lodsb/w/d/q
With regard to reading 'ds' in 64-bit mode, the SDM says for lodsd
For legacy mode, Load dword at address DS:(E)SI into EAX. For 64-bit
mode load dword at address (R)SI into EAX.
* scasb/w/d/q
X86_REG_ES was removed from the explicit set of read registers because
it was causing duplicate entries in 'detail->regs_read'.
With regard to reading 'es' in 64-bit mode, the SDM says for scasd
Compare EAX with doubleword at ES:(E)DI or RDI then set status flags.
* cmpsb/w/d/q
The 'es' register is implicitly handled correctly. The 'ds' register
should only be read from in 16- and 32-bit mode. From the SDM for cmpsd:
For legacy mode, compare dword at address DS:(E)SI with dword at
address ES:(E)DI; For 64-bit mode compare dword at address (R|E)SI
with dword at address (R|E)DI. The status flags are set accordingly.
* movsb/w/d/q
The 'es' register is implicitly handled correctly. The 'ds' register
should only be read from in 16- and 32-bit mode. From the SDM for movsd:
For legacy mode, move dword from address DS:(E)SI to ES:(E)DI. For
64-bit mode move dword from address (R|E)SI to (R|E)DI.
* insb/w/d/q
X86_REG_EDI was removed from the explicit set of read registers because
it was causing duplicate entries in 'detail->regs_read'.
The 'ds' register should only be read from in 16- and 32-bit mode. From
the SDM for insd:
Input doubleword from I/O port specified in DX into memory location
specified in ES:(E)DI or RDI.
* outsb/w/d/q
The 'ds' register should only be read from in 16- and 32-bit mode. From
the SDM for outsd:
Output word from memory location specified in DS:(E)SI or RSI to I/O
port specified in DX.1 parent 0b61957 commit dba0a4f
File tree
6 files changed
+1253
-42
lines changed- arch/X86
- tests/details
6 files changed
+1253
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1018 | 1018 | | |
1019 | 1019 | | |
1020 | 1020 | | |
| 1021 | + | |
1021 | 1022 | | |
1022 | 1023 | | |
1023 | 1024 | | |
| |||
1114 | 1115 | | |
1115 | 1116 | | |
1116 | 1117 | | |
1117 | | - | |
1118 | 1118 | | |
1119 | 1119 | | |
1120 | 1120 | | |
| |||
1141 | 1141 | | |
1142 | 1142 | | |
1143 | 1143 | | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
1144 | 1223 | | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
1145 | 1231 | | |
1146 | 1232 | | |
1147 | 1233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6229 | 6229 | | |
6230 | 6230 | | |
6231 | 6231 | | |
6232 | | - | |
| 6232 | + | |
6233 | 6233 | | |
6234 | 6234 | | |
6235 | 6235 | | |
| |||
6271 | 6271 | | |
6272 | 6272 | | |
6273 | 6273 | | |
6274 | | - | |
| 6274 | + | |
6275 | 6275 | | |
6276 | 6276 | | |
6277 | 6277 | | |
| |||
7909 | 7909 | | |
7910 | 7910 | | |
7911 | 7911 | | |
7912 | | - | |
| 7912 | + | |
7913 | 7913 | | |
7914 | 7914 | | |
7915 | 7915 | | |
7916 | 7916 | | |
7917 | 7917 | | |
7918 | 7918 | | |
7919 | | - | |
| 7919 | + | |
7920 | 7920 | | |
7921 | 7921 | | |
7922 | 7922 | | |
7923 | 7923 | | |
7924 | 7924 | | |
7925 | 7925 | | |
7926 | | - | |
| 7926 | + | |
7927 | 7927 | | |
7928 | 7928 | | |
7929 | 7929 | | |
7930 | 7930 | | |
7931 | 7931 | | |
7932 | 7932 | | |
7933 | | - | |
| 7933 | + | |
7934 | 7934 | | |
7935 | 7935 | | |
7936 | 7936 | | |
| |||
16568 | 16568 | | |
16569 | 16569 | | |
16570 | 16570 | | |
16571 | | - | |
| 16571 | + | |
16572 | 16572 | | |
16573 | 16573 | | |
16574 | 16574 | | |
16575 | 16575 | | |
16576 | 16576 | | |
16577 | 16577 | | |
16578 | | - | |
| 16578 | + | |
16579 | 16579 | | |
16580 | 16580 | | |
16581 | 16581 | | |
16582 | 16582 | | |
16583 | 16583 | | |
16584 | 16584 | | |
16585 | | - | |
| 16585 | + | |
16586 | 16586 | | |
16587 | 16587 | | |
16588 | 16588 | | |
16589 | 16589 | | |
16590 | 16590 | | |
16591 | 16591 | | |
16592 | | - | |
| 16592 | + | |
16593 | 16593 | | |
16594 | 16594 | | |
16595 | 16595 | | |
| |||
17835 | 17835 | | |
17836 | 17836 | | |
17837 | 17837 | | |
17838 | | - | |
| 17838 | + | |
17839 | 17839 | | |
17840 | 17840 | | |
17841 | 17841 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2709 | 2709 | | |
2710 | 2710 | | |
2711 | 2711 | | |
2712 | | - | |
| 2712 | + | |
2713 | 2713 | | |
2714 | 2714 | | |
2715 | 2715 | | |
| |||
2744 | 2744 | | |
2745 | 2745 | | |
2746 | 2746 | | |
2747 | | - | |
| 2747 | + | |
2748 | 2748 | | |
2749 | 2749 | | |
2750 | 2750 | | |
2751 | 2751 | | |
2752 | | - | |
| 2752 | + | |
2753 | 2753 | | |
2754 | 2754 | | |
2755 | 2755 | | |
| |||
2784 | 2784 | | |
2785 | 2785 | | |
2786 | 2786 | | |
2787 | | - | |
| 2787 | + | |
2788 | 2788 | | |
2789 | 2789 | | |
2790 | 2790 | | |
| |||
4449 | 4449 | | |
4450 | 4450 | | |
4451 | 4451 | | |
4452 | | - | |
| 4452 | + | |
4453 | 4453 | | |
4454 | 4454 | | |
4455 | 4455 | | |
| |||
4474 | 4474 | | |
4475 | 4475 | | |
4476 | 4476 | | |
4477 | | - | |
| 4477 | + | |
4478 | 4478 | | |
4479 | 4479 | | |
4480 | 4480 | | |
4481 | 4481 | | |
4482 | | - | |
| 4482 | + | |
4483 | 4483 | | |
4484 | 4484 | | |
4485 | 4485 | | |
| |||
11834 | 11834 | | |
11835 | 11835 | | |
11836 | 11836 | | |
11837 | | - | |
| 11837 | + | |
11838 | 11838 | | |
11839 | 11839 | | |
11840 | 11840 | | |
11841 | 11841 | | |
11842 | | - | |
| 11842 | + | |
11843 | 11843 | | |
11844 | 11844 | | |
11845 | 11845 | | |
11846 | 11846 | | |
11847 | | - | |
| 11847 | + | |
11848 | 11848 | | |
11849 | 11849 | | |
11850 | 11850 | | |
11851 | 11851 | | |
11852 | | - | |
| 11852 | + | |
11853 | 11853 | | |
11854 | 11854 | | |
11855 | 11855 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2029 | 2029 | | |
2030 | 2030 | | |
2031 | 2031 | | |
2032 | | - | |
| 2032 | + | |
2033 | 2033 | | |
2034 | 2034 | | |
2035 | 2035 | | |
2036 | 2036 | | |
2037 | | - | |
| 2037 | + | |
2038 | 2038 | | |
2039 | 2039 | | |
2040 | 2040 | | |
2041 | 2041 | | |
2042 | | - | |
| 2042 | + | |
2043 | 2043 | | |
2044 | 2044 | | |
2045 | 2045 | | |
2046 | 2046 | | |
2047 | | - | |
| 2047 | + | |
2048 | 2048 | | |
2049 | 2049 | | |
2050 | 2050 | | |
| |||
2564 | 2564 | | |
2565 | 2565 | | |
2566 | 2566 | | |
2567 | | - | |
| 2567 | + | |
2568 | 2568 | | |
2569 | 2569 | | |
2570 | 2570 | | |
2571 | 2571 | | |
2572 | | - | |
| 2572 | + | |
2573 | 2573 | | |
2574 | 2574 | | |
2575 | 2575 | | |
2576 | 2576 | | |
2577 | | - | |
| 2577 | + | |
2578 | 2578 | | |
2579 | 2579 | | |
2580 | 2580 | | |
| |||
5939 | 5939 | | |
5940 | 5940 | | |
5941 | 5941 | | |
5942 | | - | |
| 5942 | + | |
5943 | 5943 | | |
5944 | 5944 | | |
5945 | 5945 | | |
5946 | 5946 | | |
5947 | | - | |
| 5947 | + | |
5948 | 5948 | | |
5949 | 5949 | | |
5950 | 5950 | | |
5951 | 5951 | | |
5952 | | - | |
| 5952 | + | |
5953 | 5953 | | |
5954 | 5954 | | |
5955 | 5955 | | |
5956 | 5956 | | |
5957 | | - | |
| 5957 | + | |
5958 | 5958 | | |
5959 | 5959 | | |
5960 | 5960 | | |
| |||
0 commit comments