MCPcopy Create free account
hub / github.com/WheretIB/nullc / x86SUB

Function x86SUB

NULLC/Translator_X86.cpp:674–693  ·  view source on GitHub ↗

sub dst, num

Source from the content-addressed store, hash-verified

672
673// sub dst, num
674int x86SUB(unsigned char *stream, x86Reg dst, int num)
675{
676 if((char)(num) == num)
677 {
678 stream[0] = 0x83;
679 stream[1] = encodeRegister(dst, 5);
680 stream[2] = (char)(num);
681 return 3;
682 }
683 if(dst == rEAX)
684 {
685 stream[0] = 0x2d;
686 *(int*)(stream+1) = num;
687 return 5;
688 }
689 stream[0] = 0x81;
690 stream[1] = encodeRegister(dst, 5);
691 *(int*)(stream+2) = num;
692 return 6;
693}
694// sub dst, src
695int x86SUB(unsigned char *stream, x86Reg dst, x86Reg src)
696{

Callers 1

TranslateToNativeMethod · 0.85

Calls 3

encodeRegisterFunction · 0.85
assertFunction · 0.85
encodeAddressFunction · 0.85

Tested by

no test coverage detected