Best Syzkaller code snippet using x86.imm16
instructions.go
Source:instructions.go
...97}98// SupportedOperandTypes contains all operand types supported by SGN99var SupportedOperandTypes = []string{100 "imm8",101 "imm16",102 "imm32",103 "imm64",104 "r8",105 "r16",106 "r32",107 "r64",108 "r/m8",109 "r/m16",110 "r/m32",111 "r/m64",112 "m",113 "m8",114 "m16",115 "m32",116 "m64",117 "RAX",118 "RCX",119 "RDX",120 "RBX",121 "RSP",122 "RBP",123 "RSI",124 "RDI",125 "EAX",126 "ECX",127 "EDX",128 "EBX",129 "ESP",130 "EBP",131 "ESI",132 "EDI",133 "AX",134 "CX",135 "DX",136 "BX",137 "SP",138 "BP",139 "SI",140 "DI",141 "AH",142 "AL",143 "CH",144 "CL",145 "DH",146 "DL",147 "BH",148 "BL",149 "SPL",150 "BPL",151 "SIL",152 "DIL",153}154// JMP 2 -> Jumps to next instruction155// func addGarbageJumpMnemonics() {156// // for _, i := range ConditionalJumpMnemonics {157// // GarbageMnemonics = append(GarbageMnemonics, i+" 2")158// // }159// for _, i := range ConditionalJumpMnemonics {160// GarbageMnemonics = append(GarbageMnemonics, i+" {L};{G};{L}:")161// }162// }163/*164 !! BLACKLISTED INSTRUCTIONS !!165 * XCHG166 * UD1167 * CMPXCHG168 * CMPXCHG8B169*/170// INSTRUCTIONS contains the ENTIRE x86/x64 instruction set171const INSTRUCTIONS string = `172[173 {174 "Mnemonic": "AAD",175 "V64": true,176 "V32": true,177 "Operands": [178 {179 "Types": [180 "imm8"181 ]182 }183 ]184 },185 {186 "Mnemonic": "AAM",187 "V64": true,188 "V32": true,189 "Operands": [190 {191 "Types": [192 "imm8"193 ]194 }195 ]196 },197 {198 "Mnemonic": "ADC",199 "V64": true,200 "V32": true,201 "Operands": [202 {203 "Types": [204 "AL",205 "AX",206 "EAX",207 "RAX",208 "r/m8",209 "r/m8",210 "r/m16",211 "r/m32",212 "r/m64",213 "r/m16",214 "r/m32",215 "r/m64",216 "r/m8",217 "r/m8",218 "r/m16",219 "r/m32",220 "r/m64",221 "r8",222 "r8",223 "r16",224 "r32",225 "r64"226 ]227 },228 {229 "Types": [230 "imm8",231 "imm16",232 "imm32",233 "imm32",234 "imm8",235 "imm8",236 "imm16",237 "imm32",238 "imm32",239 "imm8",240 "imm8",241 "imm8",242 "r8",243 "r8",244 "r16",245 "r32",246 "r64",247 "r/m8",248 "r/m8",249 "r/m16",250 "r/m32",251 "r/m64"252 ]253 }254 ]255 },256 {257 "Mnemonic": "ADCX",258 "V64": true,259 "V32": true,260 "Operands": [261 {262 "Types": [263 "r32",264 "r64"265 ]266 },267 {268 "Types": [269 "r/m32",270 "r/m64"271 ]272 }273 ]274 },275 {276 "Mnemonic": "ADD",277 "V64": true,278 "V32": true,279 "Operands": [280 {281 "Types": [282 "AL",283 "AX",284 "EAX",285 "RAX",286 "r/m8",287 "r/m8",288 "r/m16",289 "r/m32",290 "r/m64",291 "r/m16",292 "r/m32",293 "r/m64",294 "r/m8",295 "r/m8",296 "r/m16",297 "r/m32",298 "r/m64",299 "r8",300 "r8",301 "r16",302 "r32",303 "r64"304 ]305 },306 {307 "Types": [308 "imm8",309 "imm16",310 "imm32",311 "imm32",312 "imm8",313 "imm8",314 "imm16",315 "imm32",316 "imm32",317 "imm8",318 "imm8",319 "imm8",320 "r8",321 "r8",322 "r16",323 "r32",324 "r64",325 "r/m8",326 "r/m8",327 "r/m16",328 "r/m32",329 "r/m64"330 ]331 }332 ]333 },334 {335 "Mnemonic": "ADOX",336 "V64": true,337 "V32": true,338 "Operands": [339 {340 "Types": [341 "r32",342 "r64"343 ]344 },345 {346 "Types": [347 "r/m32",348 "r/m64"349 ]350 }351 ]352 },353 {354 "Mnemonic": "AND",355 "V64": true,356 "V32": true,357 "Operands": [358 {359 "Types": [360 "AL",361 "AX",362 "EAX",363 "RAX",364 "r/m8",365 "r/m8",366 "r/m16",367 "r/m32",368 "r/m64",369 "r/m16",370 "r/m32",371 "r/m64",372 "r/m8",373 "r/m8",374 "r/m16",375 "r/m32",376 "r/m64",377 "r8",378 "r8",379 "r16",380 "r32",381 "r64"382 ]383 },384 {385 "Types": [386 "imm8",387 "imm16",388 "imm32",389 "imm32",390 "imm8",391 "imm8",392 "imm16",393 "imm32",394 "imm32",395 "imm8",396 "imm8",397 "imm8",398 "r8",399 "r8",400 "r16",401 "r32",402 "r64",403 "r/m8",404 "r/m8",405 "r/m16",406 "r/m32",407 "r/m64"408 ]409 }410 ]411 },412 {413 "Mnemonic": "BLSI",414 "V64": true,415 "V32": true,416 "Operands": [417 {418 "Types": [419 "r32",420 "r64"421 ]422 },423 {424 "Types": [425 "r/m32",426 "r/m64"427 ]428 }429 ]430 },431 {432 "Mnemonic": "BLSMSK",433 "V64": true,434 "V32": true,435 "Operands": [436 {437 "Types": [438 "r32",439 "r64"440 ]441 },442 {443 "Types": [444 "r/m32",445 "r/m64"446 ]447 }448 ]449 },450 {451 "Mnemonic": "BLSR",452 "V64": true,453 "V32": true,454 "Operands": [455 {456 "Types": [457 "r32",458 "r64"459 ]460 },461 {462 "Types": [463 "r/m32",464 "r/m64"465 ]466 }467 ]468 },469 {470 "Mnemonic": "BSF",471 "V64": true,472 "V32": true,473 "Operands": [474 {475 "Types": [476 "r16",477 "r32",478 "r64"479 ]480 },481 {482 "Types": [483 "r/m16",484 "r/m32",485 "r/m64"486 ]487 }488 ]489 },490 {491 "Mnemonic": "BSR",492 "V64": true,493 "V32": true,494 "Operands": [495 {496 "Types": [497 "r16",498 "r32",499 "r64"500 ]501 },502 {503 "Types": [504 "r/m16",505 "r/m32",506 "r/m64"507 ]508 }509 ]510 },511 {512 "Mnemonic": "BSWAP",513 "V64": true,514 "V32": true,515 "Operands": [516 {517 "Types": [518 "r32",519 "r64"520 ]521 }522 ]523 },524 {525 "Mnemonic": "BT",526 "V64": true,527 "V32": true,528 "Operands": [529 {530 "Types": [531 "r/m16",532 "r/m32",533 "r/m64",534 "r/m16",535 "r/m32",536 "r/m64"537 ]538 },539 {540 "Types": [541 "r16",542 "r32",543 "r64",544 "imm8",545 "imm8",546 "imm8"547 ]548 }549 ]550 },551 {552 "Mnemonic": "BTC",553 "V64": true,554 "V32": true,555 "Operands": [556 {557 "Types": [558 "r/m16",559 "r/m32",560 "r/m64",561 "r/m16",562 "r/m32",563 "r/m64"564 ]565 },566 {567 "Types": [568 "r16",569 "r32",570 "r64",571 "imm8",572 "imm8",573 "imm8"574 ]575 }576 ]577 },578 {579 "Mnemonic": "BTR",580 "V64": true,581 "V32": true,582 "Operands": [583 {584 "Types": [585 "r/m16",586 "r/m32",587 "r/m64",588 "r/m16",589 "r/m32",590 "r/m64"591 ]592 },593 {594 "Types": [595 "r16",596 "r32",597 "r64",598 "imm8",599 "imm8",600 "imm8"601 ]602 }603 ]604 },605 {606 "Mnemonic": "BTS",607 "V64": true,608 "V32": true,609 "Operands": [610 {611 "Types": [612 "r/m16",613 "r/m32",614 "r/m64",615 "r/m16",616 "r/m32",617 "r/m64"618 ]619 },620 {621 "Types": [622 "r16",623 "r32",624 "r64",625 "imm8",626 "imm8",627 "imm8"628 ]629 }630 ]631 },632 {633 "Mnemonic": "CALL",634 "V64": true,635 "V32": true,636 "Operands": [637 {638 "Types": [639 "r/m16",640 "r/m32",641 "r/m64"642 ]643 }644 ]645 },646 {647 "Mnemonic": "CLFLUSH",648 "V64": true,649 "V32": true,650 "Operands": [651 {652 "Types": [653 "m8"654 ]655 }656 ]657 },658 {659 "Mnemonic": "CLFLUSHOPT",660 "V64": true,661 "V32": true,662 "Operands": [663 {664 "Types": [665 "m8"666 ]667 }668 ]669 },670 {671 "Mnemonic": "CLWB",672 "V64": true,673 "V32": true,674 "Operands": [675 {676 "Types": [677 "m8"678 ]679 }680 ]681 },682 {683 "Mnemonic": "CMOVA",684 "V64": true,685 "V32": true,686 "Operands": [687 {688 "Types": [689 "r16",690 "r32",691 "r64"692 ]693 },694 {695 "Types": [696 "r/m16",697 "r/m32",698 "r/m64"699 ]700 }701 ]702 },703 {704 "Mnemonic": "CMOVAE",705 "V64": true,706 "V32": true,707 "Operands": [708 {709 "Types": [710 "r16",711 "r32",712 "r64"713 ]714 },715 {716 "Types": [717 "r/m16",718 "r/m32",719 "r/m64"720 ]721 }722 ]723 },724 {725 "Mnemonic": "CMOVB",726 "V64": true,727 "V32": true,728 "Operands": [729 {730 "Types": [731 "r16",732 "r32",733 "r64"734 ]735 },736 {737 "Types": [738 "r/m16",739 "r/m32",740 "r/m64"741 ]742 }743 ]744 },745 {746 "Mnemonic": "CMOVBE",747 "V64": true,748 "V32": true,749 "Operands": [750 {751 "Types": [752 "r16",753 "r32",754 "r64"755 ]756 },757 {758 "Types": [759 "r/m16",760 "r/m32",761 "r/m64"762 ]763 }764 ]765 },766 {767 "Mnemonic": "CMOVC",768 "V64": true,769 "V32": true,770 "Operands": [771 {772 "Types": [773 "r16",774 "r32",775 "r64"776 ]777 },778 {779 "Types": [780 "r/m16",781 "r/m32",782 "r/m64"783 ]784 }785 ]786 },787 {788 "Mnemonic": "CMOVE",789 "V64": true,790 "V32": true,791 "Operands": [792 {793 "Types": [794 "r16",795 "r32",796 "r64"797 ]798 },799 {800 "Types": [801 "r/m16",802 "r/m32",803 "r/m64"804 ]805 }806 ]807 },808 {809 "Mnemonic": "CMOVG",810 "V64": true,811 "V32": true,812 "Operands": [813 {814 "Types": [815 "r16",816 "r32",817 "r64"818 ]819 },820 {821 "Types": [822 "r/m16",823 "r/m32",824 "r/m64"825 ]826 }827 ]828 },829 {830 "Mnemonic": "CMOVGE",831 "V64": true,832 "V32": true,833 "Operands": [834 {835 "Types": [836 "r16",837 "r32",838 "r64"839 ]840 },841 {842 "Types": [843 "r/m16",844 "r/m32",845 "r/m64"846 ]847 }848 ]849 },850 {851 "Mnemonic": "CMOVL",852 "V64": true,853 "V32": true,854 "Operands": [855 {856 "Types": [857 "r16",858 "r32",859 "r64"860 ]861 },862 {863 "Types": [864 "r/m16",865 "r/m32",866 "r/m64"867 ]868 }869 ]870 },871 {872 "Mnemonic": "CMOVLE",873 "V64": true,874 "V32": true,875 "Operands": [876 {877 "Types": [878 "r16",879 "r32",880 "r64"881 ]882 },883 {884 "Types": [885 "r/m16",886 "r/m32",887 "r/m64"888 ]889 }890 ]891 },892 {893 "Mnemonic": "CMOVNA",894 "V64": true,895 "V32": true,896 "Operands": [897 {898 "Types": [899 "r16",900 "r32",901 "r64"902 ]903 },904 {905 "Types": [906 "r/m16",907 "r/m32",908 "r/m64"909 ]910 }911 ]912 },913 {914 "Mnemonic": "CMOVNAE",915 "V64": true,916 "V32": true,917 "Operands": [918 {919 "Types": [920 "r16",921 "r32",922 "r64"923 ]924 },925 {926 "Types": [927 "r/m16",928 "r/m32",929 "r/m64"930 ]931 }932 ]933 },934 {935 "Mnemonic": "CMOVNB",936 "V64": true,937 "V32": true,938 "Operands": [939 {940 "Types": [941 "r16",942 "r32",943 "r64"944 ]945 },946 {947 "Types": [948 "r/m16",949 "r/m32",950 "r/m64"951 ]952 }953 ]954 },955 {956 "Mnemonic": "CMOVNBE",957 "V64": true,958 "V32": true,959 "Operands": [960 {961 "Types": [962 "r16",963 "r32",964 "r64"965 ]966 },967 {968 "Types": [969 "r/m16",970 "r/m32",971 "r/m64"972 ]973 }974 ]975 },976 {977 "Mnemonic": "CMOVNC",978 "V64": true,979 "V32": true,980 "Operands": [981 {982 "Types": [983 "r16",984 "r32",985 "r64"986 ]987 },988 {989 "Types": [990 "r/m16",991 "r/m32",992 "r/m64"993 ]994 }995 ]996 },997 {998 "Mnemonic": "CMOVNE",999 "V64": true,1000 "V32": true,1001 "Operands": [1002 {1003 "Types": [1004 "r16",1005 "r32",1006 "r64"1007 ]1008 },1009 {1010 "Types": [1011 "r/m16",1012 "r/m32",1013 "r/m64"1014 ]1015 }1016 ]1017 },1018 {1019 "Mnemonic": "CMOVNG",1020 "V64": true,1021 "V32": true,1022 "Operands": [1023 {1024 "Types": [1025 "r16",1026 "r32",1027 "r64"1028 ]1029 },1030 {1031 "Types": [1032 "r/m16",1033 "r/m32",1034 "r/m64"1035 ]1036 }1037 ]1038 },1039 {1040 "Mnemonic": "CMOVNGE",1041 "V64": true,1042 "V32": true,1043 "Operands": [1044 {1045 "Types": [1046 "r16",1047 "r32",1048 "r64"1049 ]1050 },1051 {1052 "Types": [1053 "r/m16",1054 "r/m32",1055 "r/m64"1056 ]1057 }1058 ]1059 },1060 {1061 "Mnemonic": "CMOVNL",1062 "V64": true,1063 "V32": true,1064 "Operands": [1065 {1066 "Types": [1067 "r16",1068 "r32",1069 "r64"1070 ]1071 },1072 {1073 "Types": [1074 "r/m16",1075 "r/m32",1076 "r/m64"1077 ]1078 }1079 ]1080 },1081 {1082 "Mnemonic": "CMOVNLE",1083 "V64": true,1084 "V32": true,1085 "Operands": [1086 {1087 "Types": [1088 "r16",1089 "r32",1090 "r64"1091 ]1092 },1093 {1094 "Types": [1095 "r/m16",1096 "r/m32",1097 "r/m64"1098 ]1099 }1100 ]1101 },1102 {1103 "Mnemonic": "CMOVNO",1104 "V64": true,1105 "V32": true,1106 "Operands": [1107 {1108 "Types": [1109 "r16",1110 "r32",1111 "r64"1112 ]1113 },1114 {1115 "Types": [1116 "r/m16",1117 "r/m32",1118 "r/m64"1119 ]1120 }1121 ]1122 },1123 {1124 "Mnemonic": "CMOVNP",1125 "V64": true,1126 "V32": true,1127 "Operands": [1128 {1129 "Types": [1130 "r16",1131 "r32",1132 "r64"1133 ]1134 },1135 {1136 "Types": [1137 "r/m16",1138 "r/m32",1139 "r/m64"1140 ]1141 }1142 ]1143 },1144 {1145 "Mnemonic": "CMOVNS",1146 "V64": true,1147 "V32": true,1148 "Operands": [1149 {1150 "Types": [1151 "r16",1152 "r32",1153 "r64"1154 ]1155 },1156 {1157 "Types": [1158 "r/m16",1159 "r/m32",1160 "r/m64"1161 ]1162 }1163 ]1164 },1165 {1166 "Mnemonic": "CMOVNZ",1167 "V64": true,1168 "V32": true,1169 "Operands": [1170 {1171 "Types": [1172 "r16",1173 "r32",1174 "r64"1175 ]1176 },1177 {1178 "Types": [1179 "r/m16",1180 "r/m32",1181 "r/m64"1182 ]1183 }1184 ]1185 },1186 {1187 "Mnemonic": "CMOVO",1188 "V64": true,1189 "V32": true,1190 "Operands": [1191 {1192 "Types": [1193 "r16",1194 "r32",1195 "r64"1196 ]1197 },1198 {1199 "Types": [1200 "r/m16",1201 "r/m32",1202 "r/m64"1203 ]1204 }1205 ]1206 },1207 {1208 "Mnemonic": "CMOVP",1209 "V64": true,1210 "V32": true,1211 "Operands": [1212 {1213 "Types": [1214 "r16",1215 "r32",1216 "r64"1217 ]1218 },1219 {1220 "Types": [1221 "r/m16",1222 "r/m32",1223 "r/m64"1224 ]1225 }1226 ]1227 },1228 {1229 "Mnemonic": "CMOVPE",1230 "V64": true,1231 "V32": true,1232 "Operands": [1233 {1234 "Types": [1235 "r16",1236 "r32",1237 "r64"1238 ]1239 },1240 {1241 "Types": [1242 "r/m16",1243 "r/m32",1244 "r/m64"1245 ]1246 }1247 ]1248 },1249 {1250 "Mnemonic": "CMP",1251 "V64": true,1252 "V32": true,1253 "Operands": [1254 {1255 "Types": [1256 "AL",1257 "AX",1258 "EAX",1259 "RAX",1260 "r/m8",1261 "r/m8",1262 "r/m16",1263 "r/m32",1264 "r/m64",1265 "r/m16",1266 "r/m32",1267 "r/m64",1268 "r/m8",1269 "r/m8",1270 "r/m16",1271 "r/m32",1272 "r/m64",1273 "r8",1274 "r8",1275 "r16",1276 "r32",1277 "r64"1278 ]1279 },1280 {1281 "Types": [1282 "imm8",1283 "imm16",1284 "imm32",1285 "imm32",1286 "imm8",1287 "imm8",1288 "imm16",1289 "imm32",1290 "imm32",1291 "imm8",1292 "imm8",1293 "imm8",1294 "r8",1295 "r8",1296 "r16",1297 "r32",1298 "r64",1299 "r/m8",1300 "r/m8",1301 "r/m16",1302 "r/m32",1303 "r/m64"1304 ]1305 }1306 ]1307 },1308 {1309 "Mnemonic": "CMPS",1310 "V64": true,1311 "V32": true,1312 "Operands": [1313 {1314 "Types": [1315 "m8",1316 "m16",1317 "m32",1318 "m64"1319 ]1320 },1321 {1322 "Types": [1323 "m8",1324 "m16",1325 "m32",1326 "m64"1327 ]1328 }1329 ]1330 },1331 {1332 "Mnemonic": "CRC32",1333 "V64": true,1334 "V32": true,1335 "Operands": [1336 {1337 "Types": [1338 "r32",1339 "r32",1340 "r32",1341 "r32",1342 "r64",1343 "r64"1344 ]1345 },1346 {1347 "Types": [1348 "r/m8",1349 "r/m8",1350 "r/m16",1351 "r/m32",1352 "r/m8",1353 "r/m64"1354 ]1355 }1356 ]1357 },1358 {1359 "Mnemonic": "DEC",1360 "V64": true,1361 "V32": true,1362 "Operands": [1363 {1364 "Types": [1365 "r/m8",1366 "r/m8",1367 "r/m16",1368 "r/m32",1369 "r/m64",1370 "r16",1371 "r32"1372 ]1373 }1374 ]1375 },1376 {1377 "Mnemonic": "DIV",1378 "V64": true,1379 "V32": true,1380 "Operands": [1381 {1382 "Types": [1383 "r/m8",1384 "r/m8",1385 "r/m16",1386 "r/m32",1387 "r/m64"1388 ]1389 }1390 ]1391 },1392 {1393 "Mnemonic": "ENTER",1394 "V64": true,1395 "V32": true,1396 "Operands": [1397 {1398 "Types": [1399 "imm16"1400 ]1401 },1402 {1403 "Types": [1404 "imm8"1405 ]1406 }1407 ]1408 },1409 {1410 "Mnemonic": "FSTSW",1411 "V64": true,1412 "V32": true,1413 "Operands": [1414 {1415 "Types": [1416 "AX"1417 ]1418 }1419 ]1420 },1421 {1422 "Mnemonic": "FNSTSW",1423 "V64": true,1424 "V32": true,1425 "Operands": [1426 {1427 "Types": [1428 "AX"1429 ]1430 }1431 ]1432 },1433 {1434 "Mnemonic": "IDIV",1435 "V64": true,1436 "V32": true,1437 "Operands": [1438 {1439 "Types": [1440 "r/m8",1441 "r/m8",1442 "r/m16",1443 "r/m32",1444 "r/m64"1445 ]1446 }1447 ]1448 },1449 {1450 "Mnemonic": "IMUL",1451 "V64": true,1452 "V32": true,1453 "Operands": [1454 {1455 "Types": [1456 "r/m8",1457 "r/m16",1458 "r/m32",1459 "r/m64"1460 ]1461 }1462 ]1463 },1464 {1465 "Mnemonic": "INC",1466 "V64": true,1467 "V32": true,1468 "Operands": [1469 {1470 "Types": [1471 "r/m8",1472 "r/m8",1473 "r/m16",1474 "r/m32",1475 "r/m64",1476 "r16",1477 "r32"1478 ]1479 }1480 ]1481 },1482 {1483 "Mnemonic": "INS",1484 "V64": true,1485 "V32": true,1486 "Operands": [1487 {1488 "Types": [1489 "m8",1490 "m16",1491 "m32"1492 ]1493 },1494 {1495 "Types": [1496 "DX",1497 "DX",1498 "DX"1499 ]1500 }1501 ]1502 },1503 {1504 "Mnemonic": "INVLPG",1505 "V64": true,1506 "V32": true,1507 "Operands": [1508 {1509 "Types": [1510 "m"1511 ]1512 }1513 ]1514 },1515 {1516 "Mnemonic": "JMP",1517 "V64": true,1518 "V32": true,1519 "Operands": [1520 {1521 "Types": [1522 "r/m16",1523 "r/m32",1524 "r/m64"1525 ]1526 }1527 ]1528 },1529 {1530 "Mnemonic": "LDMXCSR",1531 "V64": true,1532 "V32": true,1533 "Operands": [1534 {1535 "Types": [1536 "m32"1537 ]1538 }1539 ]1540 },1541 {1542 "Mnemonic": "VLDMXCSR",1543 "V64": true,1544 "V32": true,1545 "Operands": [1546 {1547 "Types": [1548 "m32"1549 ]1550 }1551 ]1552 },1553 {1554 "Mnemonic": "LEA",1555 "V64": true,1556 "V32": true,1557 "Operands": [1558 {1559 "Types": [1560 "r16",1561 "r32",1562 "r64"1563 ]1564 },1565 {1566 "Types": [1567 "m",1568 "m",1569 "m"1570 ]1571 }1572 ]1573 },1574 {1575 "Mnemonic": "LMSW",1576 "V64": true,1577 "V32": true,1578 "Operands": [1579 {1580 "Types": [1581 "r/m16"1582 ]1583 }1584 ]1585 },1586 {1587 "Mnemonic": "LODS",1588 "V64": true,1589 "V32": true,1590 "Operands": [1591 {1592 "Types": [1593 "m8",1594 "m16",1595 "m32",1596 "m64"1597 ]1598 }1599 ]1600 },1601 {1602 "Mnemonic": "LZCNT",1603 "V64": true,1604 "V32": true,1605 "Operands": [1606 {1607 "Types": [1608 "r16",1609 "r32",1610 "r64"1611 ]1612 },1613 {1614 "Types": [1615 "r/m16",1616 "r/m32",1617 "r/m64"1618 ]1619 }1620 ]1621 },1622 {1623 "Mnemonic": "MOV",1624 "V64": true,1625 "V32": true,1626 "Operands": [1627 {1628 "Types": [1629 "r/m8",1630 "r/m8",1631 "r/m16",1632 "r/m32",1633 "r/m64",1634 "r8",1635 "r8",1636 "r16",1637 "r32",1638 "r64",1639 "r8",1640 "r8",1641 "r16",1642 "r32",1643 "r64",1644 "r/m8",1645 "r/m8",1646 "r/m16",1647 "r/m32",1648 "r/m64"1649 ]1650 },1651 {1652 "Types": [1653 "r8",1654 "r8",1655 "r16",1656 "r32",1657 "r64",1658 "r/m8",1659 "r/m8",1660 "r/m16",1661 "r/m32",1662 "r/m64",1663 "imm8",1664 "imm8",1665 "imm16",1666 "imm32",1667 "imm64",1668 "imm8",1669 "imm8",1670 "imm16",1671 "imm32",1672 "imm32"1673 ]1674 }1675 ]1676 },1677 {1678 "Mnemonic": "MOVBE",1679 "V64": true,1680 "V32": true,1681 "Operands": [1682 {1683 "Types": [1684 "r16",1685 "r32",1686 "r64",1687 "m16",1688 "m32",1689 "m64"1690 ]1691 },1692 {1693 "Types": [1694 "m16",1695 "m32",1696 "m64",1697 "r16",1698 "r32",1699 "r64"1700 ]1701 }1702 ]1703 },1704 {1705 "Mnemonic": "MOVNTI",1706 "V64": true,1707 "V32": true,1708 "Operands": [1709 {1710 "Types": [1711 "m32",1712 "m64"1713 ]1714 },1715 {1716 "Types": [1717 "r32",1718 "r64"1719 ]1720 }1721 ]1722 },1723 {1724 "Mnemonic": "MOVS",1725 "V64": true,1726 "V32": true,1727 "Operands": [1728 {1729 "Types": [1730 "m8",1731 "m16",1732 "m32",1733 "m64"1734 ]1735 },1736 {1737 "Types": [1738 "m8",1739 "m16",1740 "m32",1741 "m64"1742 ]1743 }1744 ]1745 },1746 {1747 "Mnemonic": "MOVSX",1748 "V64": true,1749 "V32": true,1750 "Operands": [1751 {1752 "Types": [1753 "r16",1754 "r32",1755 "r64",1756 "r32",1757 "r64"1758 ]1759 },1760 {1761 "Types": [1762 "r/m8",1763 "r/m8",1764 "r/m8",1765 "r/m16",1766 "r/m16"1767 ]1768 }1769 ]1770 },1771 {1772 "Mnemonic": "MOVZX",1773 "V64": true,1774 "V32": true,1775 "Operands": [1776 {1777 "Types": [1778 "r16",1779 "r32",1780 "r64",1781 "r32",1782 "r64"1783 ]1784 },1785 {1786 "Types": [1787 "r/m8",1788 "r/m8",1789 "r/m8",1790 "r/m16",1791 "r/m16"1792 ]1793 }1794 ]1795 },1796 {1797 "Mnemonic": "MUL",1798 "V64": true,1799 "V32": true,1800 "Operands": [1801 {1802 "Types": [1803 "r/m8",1804 "r/m8",1805 "r/m16",1806 "r/m32",1807 "r/m64"1808 ]1809 }1810 ]1811 },1812 {1813 "Mnemonic": "NEG",1814 "V64": true,1815 "V32": true,1816 "Operands": [1817 {1818 "Types": [1819 "r/m8",1820 "r/m8",1821 "r/m16",1822 "r/m32",1823 "r/m64"1824 ]1825 }1826 ]1827 },1828 {1829 "Mnemonic": "NOP",1830 "V64": true,1831 "V32": true,1832 "Operands": [1833 {1834 "Types": [1835 "r/m16",1836 "r/m32"1837 ]1838 }1839 ]1840 },1841 {1842 "Mnemonic": "NOT",1843 "V64": true,1844 "V32": true,1845 "Operands": [1846 {1847 "Types": [1848 "r/m8",1849 "r/m8",1850 "r/m16",1851 "r/m32",1852 "r/m64"1853 ]1854 }1855 ]1856 },1857 {1858 "Mnemonic": "OR",1859 "V64": true,1860 "V32": true,1861 "Operands": [1862 {1863 "Types": [1864 "AL",1865 "AX",1866 "EAX",1867 "RAX",1868 "r/m8",1869 "r/m8",1870 "r/m16",1871 "r/m32",1872 "r/m64",1873 "r/m16",1874 "r/m32",1875 "r/m64",1876 "r/m8",1877 "r/m8",1878 "r/m16",1879 "r/m32",1880 "r/m64",1881 "r8",1882 "r8",1883 "r16",1884 "r32",1885 "r64"1886 ]1887 },1888 {1889 "Types": [1890 "imm8",1891 "imm16",1892 "imm32",1893 "imm32",1894 "imm8",1895 "imm8",1896 "imm16",1897 "imm32",1898 "imm32",1899 "imm8",1900 "imm8",1901 "imm8",1902 "r8",1903 "r8",1904 "r16",1905 "r32",1906 "r64",1907 "r/m8",1908 "r/m8",1909 "r/m16",1910 "r/m32",1911 "r/m64"1912 ]1913 }1914 ]1915 },1916 {1917 "Mnemonic": "OUT",1918 "V64": true,1919 "V32": true,1920 "Operands": [1921 {1922 "Types": [1923 "imm8",1924 "imm8",1925 "imm8",1926 "DX",1927 "DX",1928 "DX"1929 ]1930 },1931 {1932 "Types": [1933 "AL",1934 "AX",1935 "EAX",1936 "AL",1937 "AX",1938 "EAX"1939 ]1940 }1941 ]1942 },1943 {1944 "Mnemonic": "OUTS",1945 "V64": true,1946 "V32": true,1947 "Operands": [1948 {1949 "Types": [1950 "DX",1951 "DX",1952 "DX"1953 ]1954 },1955 {1956 "Types": [1957 "m8",1958 "m16",1959 "m32"1960 ]1961 }1962 ]1963 },1964 {1965 "Mnemonic": "POP",1966 "V64": true,1967 "V32": true,1968 "Operands": [1969 {1970 "Types": [1971 "r/m16",1972 "r/m32",1973 "r/m64",1974 "r16",1975 "r32",1976 "r64"1977 ]1978 }1979 ]1980 },1981 {1982 "Mnemonic": "POPCNT",1983 "V64": true,1984 "V32": true,1985 "Operands": [1986 {1987 "Types": [1988 "r16",1989 "r32",1990 "r64"1991 ]1992 },1993 {1994 "Types": [1995 "r/m16",1996 "r/m32",1997 "r/m64"1998 ]1999 }2000 ]2001 },2002 {2003 "Mnemonic": "PREFETCHT0",2004 "V64": true,2005 "V32": true,2006 "Operands": [2007 {2008 "Types": [2009 "m8"2010 ]2011 }2012 ]2013 },2014 {2015 "Mnemonic": "PREFETCHT1",2016 "V64": true,2017 "V32": true,2018 "Operands": [2019 {2020 "Types": [2021 "m8"2022 ]2023 }2024 ]2025 },2026 {2027 "Mnemonic": "PREFETCHT2",2028 "V64": true,2029 "V32": true,2030 "Operands": [2031 {2032 "Types": [2033 "m8"2034 ]2035 }2036 ]2037 },2038 {2039 "Mnemonic": "PREFETCHNTA",2040 "V64": true,2041 "V32": true,2042 "Operands": [2043 {2044 "Types": [2045 "m8"2046 ]2047 }2048 ]2049 },2050 {2051 "Mnemonic": "PREFETCHW",2052 "V64": true,2053 "V32": true,2054 "Operands": [2055 {2056 "Types": [2057 "m8"2058 ]2059 }2060 ]2061 },2062 {2063 "Mnemonic": "PREFETCHWT1",2064 "V64": true,2065 "V32": true,2066 "Operands": [2067 {2068 "Types": [2069 "m8"2070 ]2071 }2072 ]2073 },2074 {2075 "Mnemonic": "PUSH",2076 "V64": true,2077 "V32": true,2078 "Operands": [2079 {2080 "Types": [2081 "r/m16",2082 "r/m32",2083 "r/m64",2084 "r16",2085 "r32",2086 "r64",2087 "imm8",2088 "imm16",2089 "imm32"2090 ]2091 }2092 ]2093 },2094 {2095 "Mnemonic": "RCL",2096 "V64": true,2097 "V32": true,2098 "Operands": [2099 {2100 "Types": [2101 "r/m8",2102 "r/m8",2103 "r/m8",2104 "r/m8",2105 "r/m16",2106 "r/m16",2107 "r/m32",2108 "r/m64",2109 "r/m32",2110 "r/m64"2111 ]2112 },2113 {2114 "Types": [2115 "CL",2116 "CL",2117 "imm8",2118 "imm8",2119 "CL",2120 "imm8",2121 "CL",2122 "CL",2123 "imm8",2124 "imm8"2125 ]2126 }2127 ]2128 },2129 {2130 "Mnemonic": "RCR",2131 "V64": true,2132 "V32": true,2133 "Operands": [2134 {2135 "Types": [2136 "r/m8",2137 "r/m8",2138 "r/m8",2139 "r/m8",2140 "r/m16",2141 "r/m16",2142 "r/m32",2143 "r/m64",2144 "r/m32",2145 "r/m64"2146 ]2147 },2148 {2149 "Types": [2150 "CL",2151 "CL",2152 "imm8",2153 "imm8",2154 "CL",2155 "imm8",2156 "CL",2157 "CL",2158 "imm8",2159 "imm8"2160 ]2161 }2162 ]2163 },2164 {2165 "Mnemonic": "ROL",2166 "V64": true,2167 "V32": true,2168 "Operands": [2169 {2170 "Types": [2171 "r/m8",2172 "r/m8",2173 "r/m8",2174 "r/m8",2175 "r/m16",2176 "r/m16",2177 "r/m32",2178 "r/m64",2179 "r/m32",2180 "r/m64"2181 ]2182 },2183 {2184 "Types": [2185 "CL",2186 "CL",2187 "imm8",2188 "imm8",2189 "CL",2190 "imm8",2191 "CL",2192 "CL",2193 "imm8",2194 "imm8"2195 ]2196 }2197 ]2198 },2199 {2200 "Mnemonic": "ROR",2201 "V64": true,2202 "V32": true,2203 "Operands": [2204 {2205 "Types": [2206 "r/m8",2207 "r/m8",2208 "r/m8",2209 "r/m8",2210 "r/m16",2211 "r/m16",2212 "r/m32",2213 "r/m64",2214 "r/m32",2215 "r/m64"2216 ]2217 },2218 {2219 "Types": [2220 "CL",2221 "CL",2222 "imm8",2223 "imm8",2224 "CL",2225 "imm8",2226 "CL",2227 "CL",2228 "imm8",2229 "imm8"2230 ]2231 }2232 ]2233 },2234 {2235 "Mnemonic": "RDRAND",2236 "V64": true,2237 "V32": true,2238 "Operands": [2239 {2240 "Types": [2241 "r16",2242 "r32",2243 "r64"2244 ]2245 }2246 ]2247 },2248 {2249 "Mnemonic": "RDSEED",2250 "V64": true,2251 "V32": true,2252 "Operands": [2253 {2254 "Types": [2255 "r16",2256 "r32",2257 "r64"2258 ]2259 }2260 ]2261 },2262 {2263 "Mnemonic": "RET",2264 "V64": true,2265 "V32": true,2266 "Operands": [2267 {2268 "Types": [2269 "imm16",2270 "imm16"2271 ]2272 }2273 ]2274 },2275 {2276 "Mnemonic": "SAL",2277 "V64": true,2278 "V32": true,2279 "Operands": [2280 {2281 "Types": [2282 "r/m8",2283 "r/m8",2284 "r/m8",2285 "r/m8",2286 "r/m16",2287 "r/m16",2288 "r/m32",2289 "r/m64",2290 "r/m32",2291 "r/m64"2292 ]2293 },2294 {2295 "Types": [2296 "CL",2297 "CL",2298 "imm8",2299 "imm8",2300 "CL",2301 "imm8",2302 "CL",2303 "CL",2304 "imm8",2305 "imm8"2306 ]2307 }2308 ]2309 },2310 {2311 "Mnemonic": "SAR",2312 "V64": true,2313 "V32": true,2314 "Operands": [2315 {2316 "Types": [2317 "r/m8",2318 "r/m8",2319 "r/m8",2320 "r/m8",2321 "r/m16",2322 "r/m16",2323 "r/m32",2324 "r/m64",2325 "r/m32",2326 "r/m64"2327 ]2328 },2329 {2330 "Types": [2331 "CL",2332 "CL",2333 "imm8",2334 "imm8",2335 "CL",2336 "imm8",2337 "CL",2338 "CL",2339 "imm8",2340 "imm8"2341 ]2342 }2343 ]2344 },2345 {2346 "Mnemonic": "SHL",2347 "V64": true,2348 "V32": true,2349 "Operands": [2350 {2351 "Types": [2352 "r/m8",2353 "r/m8",2354 "r/m8",2355 "r/m8",2356 "r/m16",2357 "r/m16",2358 "r/m32",2359 "r/m64",2360 "r/m32",2361 "r/m64"2362 ]2363 },2364 {2365 "Types": [2366 "CL",2367 "CL",2368 "imm8",2369 "imm8",2370 "CL",2371 "imm8",2372 "CL",2373 "CL",2374 "imm8",2375 "imm8"2376 ]2377 }2378 ]2379 },2380 {2381 "Mnemonic": "SHR",2382 "V64": true,2383 "V32": true,2384 "Operands": [2385 {2386 "Types": [2387 "r/m8",2388 "r/m8",2389 "r/m8",2390 "r/m8",2391 "r/m16",2392 "r/m16",2393 "r/m32",2394 "r/m64",2395 "r/m32",2396 "r/m64"2397 ]2398 },2399 {2400 "Types": [2401 "CL",2402 "CL",2403 "imm8",2404 "imm8",2405 "CL",2406 "imm8",2407 "CL",2408 "CL",2409 "imm8",2410 "imm8"2411 ]2412 }2413 ]2414 },2415 {2416 "Mnemonic": "SBB",2417 "V64": true,2418 "V32": true,2419 "Operands": [2420 {2421 "Types": [2422 "AL",2423 "AX",2424 "EAX",2425 "RAX",2426 "r/m8",2427 "r/m8",2428 "r/m16",2429 "r/m32",2430 "r/m64",2431 "r/m16",2432 "r/m32",2433 "r/m64",2434 "r/m8",2435 "r/m8",2436 "r/m16",2437 "r/m32",2438 "r/m64",2439 "r8",2440 "r8",2441 "r16",2442 "r32",2443 "r64"2444 ]2445 },2446 {2447 "Types": [2448 "imm8",2449 "imm16",2450 "imm32",2451 "imm32",2452 "imm8",2453 "imm8",2454 "imm16",2455 "imm32",2456 "imm32",2457 "imm8",2458 "imm8",2459 "imm8",2460 "r8",2461 "r8",2462 "r16",2463 "r32",2464 "r64",2465 "r/m8",2466 "r/m8",2467 "r/m16",2468 "r/m32",2469 "r/m64"2470 ]2471 }2472 ]2473 },2474 {2475 "Mnemonic": "SCAS",2476 "V64": true,2477 "V32": true,2478 "Operands": [2479 {2480 "Types": [2481 "m8",2482 "m16",2483 "m32",2484 "m64"2485 ]2486 }2487 ]2488 },2489 {2490 "Mnemonic": "SETA",2491 "V64": true,2492 "V32": true,2493 "Operands": [2494 {2495 "Types": [2496 "r/m8",2497 "r/m8"2498 ]2499 }2500 ]2501 },2502 {2503 "Mnemonic": "SETAE",2504 "V64": true,2505 "V32": true,2506 "Operands": [2507 {2508 "Types": [2509 "r/m8",2510 "r/m8"2511 ]2512 }2513 ]2514 },2515 {2516 "Mnemonic": "SETB",2517 "V64": true,2518 "V32": true,2519 "Operands": [2520 {2521 "Types": [2522 "r/m8",2523 "r/m8"2524 ]2525 }2526 ]2527 },2528 {2529 "Mnemonic": "SETBE",2530 "V64": true,2531 "V32": true,2532 "Operands": [2533 {2534 "Types": [2535 "r/m8",2536 "r/m8"2537 ]2538 }2539 ]2540 },2541 {2542 "Mnemonic": "SETC",2543 "V64": true,2544 "V32": true,2545 "Operands": [2546 {2547 "Types": [2548 "r/m8",2549 "r/m8"2550 ]2551 }2552 ]2553 },2554 {2555 "Mnemonic": "SETE",2556 "V64": true,2557 "V32": true,2558 "Operands": [2559 {2560 "Types": [2561 "r/m8",2562 "r/m8"2563 ]2564 }2565 ]2566 },2567 {2568 "Mnemonic": "SETG",2569 "V64": true,2570 "V32": true,2571 "Operands": [2572 {2573 "Types": [2574 "r/m8",2575 "r/m8"2576 ]2577 }2578 ]2579 },2580 {2581 "Mnemonic": "SETGE",2582 "V64": true,2583 "V32": true,2584 "Operands": [2585 {2586 "Types": [2587 "r/m8",2588 "r/m8"2589 ]2590 }2591 ]2592 },2593 {2594 "Mnemonic": "SETL",2595 "V64": true,2596 "V32": true,2597 "Operands": [2598 {2599 "Types": [2600 "r/m8",2601 "r/m8"2602 ]2603 }2604 ]2605 },2606 {2607 "Mnemonic": "SETLE",2608 "V64": true,2609 "V32": true,2610 "Operands": [2611 {2612 "Types": [2613 "r/m8",2614 "r/m8"2615 ]2616 }2617 ]2618 },2619 {2620 "Mnemonic": "SETNA",2621 "V64": true,2622 "V32": true,2623 "Operands": [2624 {2625 "Types": [2626 "r/m8",2627 "r/m8"2628 ]2629 }2630 ]2631 },2632 {2633 "Mnemonic": "SETNAE",2634 "V64": true,2635 "V32": true,2636 "Operands": [2637 {2638 "Types": [2639 "r/m8",2640 "r/m8"2641 ]2642 }2643 ]2644 },2645 {2646 "Mnemonic": "SETNB",2647 "V64": true,2648 "V32": true,2649 "Operands": [2650 {2651 "Types": [2652 "r/m8",2653 "r/m8"2654 ]2655 }2656 ]2657 },2658 {2659 "Mnemonic": "SETNBE",2660 "V64": true,2661 "V32": true,2662 "Operands": [2663 {2664 "Types": [2665 "r/m8",2666 "r/m8"2667 ]2668 }2669 ]2670 },2671 {2672 "Mnemonic": "SETNC",2673 "V64": true,2674 "V32": true,2675 "Operands": [2676 {2677 "Types": [2678 "r/m8",2679 "r/m8"2680 ]2681 }2682 ]2683 },2684 {2685 "Mnemonic": "SETNE",2686 "V64": true,2687 "V32": true,2688 "Operands": [2689 {2690 "Types": [2691 "r/m8",2692 "r/m8"2693 ]2694 }2695 ]2696 },2697 {2698 "Mnemonic": "SETNG",2699 "V64": true,2700 "V32": true,2701 "Operands": [2702 {2703 "Types": [2704 "r/m8",2705 "r/m8"2706 ]2707 }2708 ]2709 },2710 {2711 "Mnemonic": "SETNGE",2712 "V64": true,2713 "V32": true,2714 "Operands": [2715 {2716 "Types": [2717 "r/m8",2718 "r/m8"2719 ]2720 }2721 ]2722 },2723 {2724 "Mnemonic": "SETNL",2725 "V64": true,2726 "V32": true,2727 "Operands": [2728 {2729 "Types": [2730 "r/m8",2731 "r/m8"2732 ]2733 }2734 ]2735 },2736 {2737 "Mnemonic": "SETNLE",2738 "V64": true,2739 "V32": true,2740 "Operands": [2741 {2742 "Types": [2743 "r/m8"2744 ]2745 }2746 ]2747 },2748 {2749 "Mnemonic": "SGDT",2750 "V64": true,2751 "V32": true,2752 "Operands": [2753 {2754 "Types": [2755 "m"2756 ]2757 }2758 ]2759 },2760 {2761 "Mnemonic": "SIDT",2762 "V64": true,2763 "V32": true,2764 "Operands": [2765 {2766 "Types": [2767 "m"2768 ]2769 }2770 ]2771 },2772 {2773 "Mnemonic": "SLDT",2774 "V64": true,2775 "V32": true,2776 "Operands": [2777 {2778 "Types": [2779 "r/m16"2780 ]2781 }2782 ]2783 },2784 {2785 "Mnemonic": "SMSW",2786 "V64": true,2787 "V32": true,2788 "Operands": [2789 {2790 "Types": [2791 "r/m16"2792 ]2793 }2794 ]2795 },2796 {2797 "Mnemonic": "STMXCSR",2798 "V64": true,2799 "V32": true,2800 "Operands": [2801 {2802 "Types": [2803 "m32"2804 ]2805 }2806 ]2807 },2808 {2809 "Mnemonic": "VSTMXCSR",2810 "V64": true,2811 "V32": true,2812 "Operands": [2813 {2814 "Types": [2815 "m32"2816 ]2817 }2818 ]2819 },2820 {2821 "Mnemonic": "STOS",2822 "V64": true,2823 "V32": true,2824 "Operands": [2825 {2826 "Types": [2827 "m8",2828 "m16",2829 "m32",2830 "m64"2831 ]2832 }2833 ]2834 },2835 {2836 "Mnemonic": "STR",2837 "V64": true,2838 "V32": true,2839 "Operands": [2840 {2841 "Types": [2842 "r/m16"2843 ]2844 }2845 ]2846 },2847 {2848 "Mnemonic": "SUB",2849 "V64": true,2850 "V32": true,2851 "Operands": [2852 {2853 "Types": [2854 "AL",2855 "AX",2856 "EAX",2857 "RAX",2858 "r/m8",2859 "r/m8",2860 "r/m16",2861 "r/m32",2862 "r/m64",2863 "r/m16",2864 "r/m32",2865 "r/m64",2866 "r/m8",2867 "r/m8",2868 "r/m16",2869 "r/m32",2870 "r/m64",2871 "r8",2872 "r8",2873 "r16",2874 "r32",2875 "r64"2876 ]2877 },2878 {2879 "Types": [2880 "imm8",2881 "imm16",2882 "imm32",2883 "imm32",2884 "imm8",2885 "imm8",2886 "imm16",2887 "imm32",2888 "imm32",2889 "imm8",2890 "imm8",2891 "imm8",2892 "r8",2893 "r8",2894 "r16",2895 "r32",2896 "r64",2897 "r/m8",2898 "r/m8",2899 "r/m16",2900 "r/m32",2901 "r/m64"2902 ]2903 }2904 ]2905 },2906 {2907 "Mnemonic": "TEST",2908 "V64": true,2909 "V32": true,2910 "Operands": [2911 {2912 "Types": [2913 "AL",2914 "AX",2915 "EAX",2916 "RAX",2917 "r/m8",2918 "r/m8",2919 "r/m16",2920 "r/m32",2921 "r/m64",2922 "r/m8",2923 "r/m8",2924 "r/m16",2925 "r/m32",2926 "r/m64"2927 ]2928 },2929 {2930 "Types": [2931 "imm8",2932 "imm16",2933 "imm32",2934 "imm32",2935 "imm8",2936 "imm8",2937 "imm16",2938 "imm32",2939 "imm32",2940 "r8",2941 "r8",2942 "r16",2943 "r32",2944 "r64"2945 ]2946 }2947 ]2948 },2949 {2950 "Mnemonic": "TZCNT",2951 "V64": true,2952 "V32": true,2953 "Operands": [2954 {2955 "Types": [2956 "r16",2957 "r32",2958 "r64"2959 ]2960 },2961 {2962 "Types": [2963 "r/m16",2964 "r/m32",2965 "r/m64"2966 ]2967 }2968 ]2969 },2970 {2971 "Mnemonic": "VERR",2972 "V64": true,2973 "V32": true,2974 "Operands": [2975 {2976 "Types": [2977 "r/m16"2978 ]2979 }2980 ]2981 },2982 {2983 "Mnemonic": "VERW",2984 "V64": true,2985 "V32": true,2986 "Operands": [2987 {2988 "Types": [2989 "r/m16"2990 ]2991 }2992 ]2993 },2994 {2995 "Mnemonic": "XABORT",2996 "V64": true,2997 "V32": true,2998 "Operands": [2999 {3000 "Types": [3001 "imm8"3002 ]3003 }3004 ]3005 },3006 {3007 "Mnemonic": "XADD",3008 "V64": true,3009 "V32": true,3010 "Operands": [3011 {3012 "Types": [3013 "r/m8",3014 "r/m8",3015 "r/m16",3016 "r/m32",3017 "r/m64"3018 ]3019 },3020 {3021 "Types": [3022 "r8",3023 "r8",3024 "r16",3025 "r32",3026 "r64"3027 ]3028 }3029 ]3030 },3031 {3032 "Mnemonic": "XLAT",3033 "V64": true,3034 "V32": true,3035 "Operands": [3036 {3037 "Types": [3038 "m8"3039 ]3040 }3041 ]3042 },3043 {3044 "Mnemonic": "XOR",3045 "V64": true,3046 "V32": true,3047 "Operands": [3048 {3049 "Types": [3050 "AL",3051 "AX",3052 "EAX",3053 "RAX",3054 "r/m8",3055 "r/m8",3056 "r/m16",3057 "r/m32",3058 "r/m64",3059 "r/m16",3060 "r/m32",3061 "r/m64",3062 "r/m8",3063 "r/m8",3064 "r/m16",3065 "r/m32",3066 "r/m64",3067 "r8",3068 "r8",3069 "r16",3070 "r32",3071 "r64"3072 ]3073 },3074 {3075 "Types": [3076 "imm8",3077 "imm16",3078 "imm32",3079 "imm32",3080 "imm8",3081 "imm8",3082 "imm16",3083 "imm32",3084 "imm32",3085 "imm8",3086 "imm8",3087 "imm8",3088 "r8",3089 "r8",3090 "r16",3091 "r32",3092 "r64",3093 "r/m8",3094 "r/m8",3095 "r/m16",3096 "r/m32",...
x86.go
Source:x86.go
1package x862import (3 "fmt"4)5func Assembly(code []X86) (out string) {6 // FIXME: This is stupidly O(N^2)...7 for _,a := range code {8 out += a.X86() + "\n"9 }10 return11}12// An Assembly is something that can be converted into a line of13// assembly language.14type X86 interface {15 X86() string16}17// a W32 is a source (or sink) for a double-word (which I think of as18// a word, but x86 assembly doesn't), which could either be a register19// or a memory location.20type W32 interface {21 W32() string22}23// a W16 is a source (or sink) for a word (which I think of as a24// short, but x86 assembly doesn't), which could either be a register25// or a memory location.26type W16 interface {27 W16() string28}29// a W8 is a source (or sink) for a byte, which could either be a30// register or a memory location.31type W8 interface {32 W8() string33}34type Ptr interface {35 Ptr() string36}37// And now we come to the concrete types.38// A Comment is the most boring part of assembly, but pretty useful39// for trying to understand generated code.40type commentType struct {41 instr X8642 c string43}44func (s commentType) X86() string {45 if c,ok := s.instr.(commentType); ok {46 return "\n# " + c.c + "\n"47 }48 return s.instr.X86() + "\t# " + s.c49}50func Comment(x string) X86 {51 return commentType{commentType{Symbol(""), x}, ""}52}53func Commented(instr X86, x string) X86 {54 return commentType{instr, x}55}56// A Symbol marks a location in the binary source file, which could be57// a function or a global variable or even a global constant.58type Symbol string59func (s Symbol) X86() string {60 return string(s) + ":"61}62func (s Symbol) W8() string {63 return "$" + string(s)64}65func (s Symbol) W16() string {66 return "$" + string(s)67}68func (s Symbol) W32() string {69 return "$" + string(s)70}71func (s Symbol) Ptr() string {72 return string(s)73}74// Memory is an in-memory reference75type Memory struct {76 Disp Ptr77 Base W3278 Index W3279 Scale Ptr80}81func (m Memory) W32() string {82 offstr := ""83 if m.Disp != nil {84 offstr = m.Disp.Ptr()85 }86 bstr := ""87 if m.Base != nil {88 bstr = m.Base.W32()89 }90 istr := ""91 if m.Index != nil {92 istr = ", " + m.Index.W32()93 }94 scalestr := ""95 if m.Scale != nil {96 scalestr = ", " + m.Scale.Ptr()97 } else if m.Base == nil && m.Index == nil {98 scalestr = ", 1"99 }100 return offstr + "(" + bstr + istr + scalestr + ")"101}102func (m Memory) Add(off int) Memory {103 if m.Disp == nil {104 m.Disp = Imm32(off)105 return m106 }107 if d,ok := m.Disp.(Imm32); ok {108 m.Disp = d + Imm32(off)109 return m110 }111 if m.Scale == nil {112 if m.Index == nil {113 m.Index = Imm32(off)114 return m115 } else {116 switch i := m.Index.(type) {117 case Imm32:118 m.Index = i + Imm32(off)119 return m120 }121 }122 }123 panic(fmt.Sprintf("I don't know how to add to %s", m))124}125func (m Memory) Ptr() string {126 return m.W32()127}128// A Register refers to a general-purpose register, of which the x86129// has only eight, two of which are pretty much devoted to the stack.130type Register byte131const (132 EAX Register = iota133 EBX134 ECX135 EDX136 EDI137 ESI138 EBP139 ESP140)141func (r Register) String() string {142 switch r {143 case EAX: return "ax"144 case EBX: return "bx"145 case ECX: return "cx"146 case EDX: return "dx"147 case EDI: return "di"148 case ESI: return "si"149 case EBP: return "bp"150 case ESP: return "sp"151 }152 panic(fmt.Sprint("Bad register value: ", r))153}154func (r Register) W8() string {155 // I haven't come up with a great approach for handling the high156 // byte registers (with "h" at the end below). For now, I just157 // won't use them.158 switch r {159 case EAX: return "%al"160 case EBX: return "%bl"161 case ECX: return "%cl"162 case EDX: return "%dl"163 }164 panic(fmt.Sprint("Bad 8-bit register value: ", r))165}166func (r Register) W16() string {167 return "%" + r.String()168}169func (r Register) W32() string {170 return "%e" + r.String()171}172func (r Register) Ptr() string {173 return "%e" + r.String()174}175// Imm32 represents an immediate 32-bit value176type Imm32 int32177func (i Imm32) W32() string {178 return "$" + fmt.Sprint(i)179}180func (i Imm32) Ptr() string {181 return fmt.Sprint(i)182}183// Imm16 represents an immediate 16-bit value184type Imm16 int16185func (i Imm16) W16() string {186 return "$" + fmt.Sprint(i)187}188// Imm8 represents an immediate 8-bit byte189type Imm8 int8190func (i Imm8) W8() string {191 return "$" + fmt.Sprint(i)192}193// OpL2 holds any two-argument instructions involving 32-bit arguments194// of with the latter is an "output" argument. It shouldn't need to195// be exported, but it could also come in handy at some stage...196type OpL2 struct {197 name string198 src W32199 dest Ptr200}201func (o OpL2) X86() string {202 return "\t" + o.name + " " + o.src.W32() + ", " + o.dest.Ptr()203}204func MovL(src W32, dest Ptr) X86 {205 return OpL2{"movl", src, dest}206}207func AddL(src W32, dest Ptr) X86 {208 return OpL2{"addl", src, dest}209}210func AndL(src W32, dest Ptr) X86 {211 return OpL2{"andl", src, dest}212}213func ShiftLeftL(src W32, dest Ptr) X86 {214 return OpL2{"shll", src, dest}215}216func ShiftRightL(src W32, dest Ptr) X86 {217 return OpL2{"shrl", src, dest}218}219func IMulL(src W32, dest Ptr) X86 {220 return OpL2{"imull", src, dest}221}222// OpLL holds any two-argument instructions involving 32-bit arguments223// in which either could be immediate. It shouldn't need to be224// exported, but it could also come in handy at some stage...225type OpLL struct {226 name string227 src1, src2 W32228}229func (o OpLL) X86() string {230 return "\t" + o.name + " " + o.src1.W32() + ", " + o.src2.W32()231}232func CmpL(src W32, dest W32) X86 {233 return OpLL{"cmpl", src, dest}234}235// OpL1 holds any instruction involving a single 32-bit argument. It236// shouldn't need to be exported, but it could also come in handy at237// some stage...238type OpL1 struct {239 name string240 arg W32241}242func (o OpL1) X86() string {243 return "\t" + o.name + " " + o.arg.W32()244}245func Int(val W32) X86 {246 return OpL1{"int", val}247}248func PopL(dest W32) X86 {249 return OpL1{"popl", dest}250}251func PushL(src W32) X86 {252 return OpL1{"pushl", src}253}254type Op0 struct {255 name, comment string256}257func (o Op0) X86() string {258 return "\t" + o.name + "\t# " + o.comment259}260func Return(com string) X86 {261 return Op0{ "ret", com }262}263// OpL1 holds any instruction involving a single argument that must be264// an address. It shouldn't need to be exported, but it could also265// come in handy at some stage...266type OpP1 struct {267 name string268 arg Ptr269}270func (o OpP1) X86() string {271 return "\t" + o.name + " " + o.arg.Ptr()272}273func Jne(src Ptr) X86 {274 return OpP1{"jne", src}275}276func Call(src Ptr) X86 {277 return OpP1{"call", src}278}279func Jmp(src Ptr) X86 {280 return OpP1{"jmp", src}281}282// A Section is... a section.283type Section string284func (s Section) X86() string {285 return "." + string(s)286}287// Ascii is just raw text...288type Ascii string289func (a Ascii) X86() (out string) {290 // FIXME: This is stupidly O(N^2)...291 out = "\t.ascii\t\""292 for i := range a {293 switch a[i] {294 case '"': out += `\"`295 case '\n': out += `\n`296 default: out += string([]byte{a[i]})297 }298 }299 out += `"`300 return301}302// Int is just raw 32-bit number...303type GlobalInt int32304func (a GlobalInt) X86() string {305 return "\t.int\t" + fmt.Sprint(a)306}307// SymbolicConstant defines a symbolic constant...308type symbolicConstant struct {309 name Symbol310 value string311}312func (a symbolicConstant) X86() string {313 return "\t" + string(a.name) + " = " + a.value314}315func SymbolicConstant(name Symbol, val string) X86 {316 return symbolicConstant{name, val}317}318type RawAssembly string319func (r RawAssembly) X86() string {320 return string(r)321}322func GlobalSymbol(name string) X86 {323 return RawAssembly(".global " + name + "\n" + name + ":")324}...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!