summaryrefslogtreecommitdiffhomepage
path: root/asm/intel64/codes.cpp
blob: a1d9e87388a093145e0db6a18213fb76759cb2dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "codes.h"

// REX prefix: 0b0100WRXB
std::vector<uint8_t> REX(std::string s) {
 uint8_t result{0b01000000};
 if (s == "W")
  result |= 0b00001000;
 if (s == "R")
  result |= 0b00000100;
 if (s == "X")
  result |= 0b00000010;
 if (s == "B")
  result |= 0b00000001;

 return { result }; 
}