2022. 2. 8. 17:19

x86 Mod REG r/m 관련 내용.

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

안녕하세요. 최근 x86 cpu에물레이터를 만들고 있습니다.

이게 dosbox를 만들려고 분석하다 보니, 차라리 간단한 x86 16bit CPU 에물레이터를 만드는게 나을꺼 같네요.

dosbox 자체가 여러개의 비트수를 호환하게 만들다 보니, 이것저것 분석하기도 힘들고,

C++, sdl, zip 관련 library를 빌드하는것도 쉽지 않네요.

그래서 opcode를 보다 보니, opcode에서 나오는 mod reg rm 비트에 관해서 찾아봤습니다.

아래 사이트가 가장 직관적으로 설명이 되네요.

https://datacadamia.com/lang/assembly/intel/modrm

 

Instruction - ModR/M Byte

The ModR/M byte is a part of an Intel Instruction Interpretation used when a memory is required (used). It permit to specify: the location of the (address mode or register) and the location of the (a register) if required by the instruction.

datacadamia.com

비트 연산도 필요 없고 배열에 해당 값을 집어 넣은후 직접 registry를 리턴 시키면 될꺼 같네요.

감사 합니다.