Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor condition opcodes and add CMOVcc and SETcc #29

Merged
merged 14 commits into from Oct 4, 2019

Conversation

@Earlz
Copy link
Collaborator

commented Sep 25, 2019

No description provided.

@Earlz Earlz requested a review from VoR0220 Sep 25, 2019
@Earlz

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 25, 2019

DO NOT MERGE.. More work being done

@@ -168,7 +168,7 @@ pub struct ParsedModRM{
impl ParsedModRM{
/// Decodes the current byte stream (starting at the ModRM byte) into a fully formed ParsedModRM struct
pub fn from_bytes(bytestream: &[u8]) -> Result<ParsedModRM, VMError>{
if bytestream.len() < 16{
if bytestream.len() < 5{

This comment has been minimized.

Copy link
@VoR0220

VoR0220 Oct 4, 2019

Collaborator

why disconnect between this and the len change below?

This comment has been minimized.

Copy link
@Earlz

Earlz Oct 4, 2019

Author Collaborator

The Mod R/M data can be at most 5 bytes large, while the decode_args_with_modrm stuff also includes the opcode byte, so can be at most 6 bytes large in that context

//0x71 JNO rel8
define_opcode(0x71).calls(jmp_not_overflow).with_gas(Low)
//0x70-0x7F Jcc rel8
define_opcode_multi(0x70, 16).calls(jcc).with_gas(Low)

This comment has been minimized.

Copy link
@VoR0220

VoR0220 Oct 4, 2019

Collaborator

nice

//0x8F JG relw
define_opcode(0x8F).is_two_byte_op().calls(jmp_greater).with_gas(Low)
//0x80-0x8F Jcc relw
define_opcode_multi(0x80, 16).is_two_byte_op().calls(jcc).with_gas(Low)

This comment has been minimized.

Copy link
@VoR0220

VoR0220 Oct 4, 2019

Collaborator

nice

@VoR0220
VoR0220 approved these changes Oct 4, 2019
Copy link
Collaborator

left a comment

Just have a couple questions about the first parts. Other than that this looks GTM.

@VoR0220 VoR0220 merged commit d9f6293 into master Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.