From 541a2dffdcb02063f71d21af22aebbd293c9e49f Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Fri, 27 Nov 2020 22:51:50 +0100 Subject: Added CMP --- asm/intel64/encode.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'asm/intel64/encode.cpp') diff --git a/asm/intel64/encode.cpp b/asm/intel64/encode.cpp index 0d7eacb..388639d 100644 --- a/asm/intel64/encode.cpp +++ b/asm/intel64/encode.cpp @@ -225,6 +225,7 @@ void Asm::toMachineCode(const FlowGraph::Graph& graph, Segment& segment) segment.push_back(makeStoreValue(operands[0], graph)); } else if (op.type() == FlowGraph::UnaryOperationType::LogicalNot) { segment.push_back(makeLoadValue(operands[1], graph)); + // TODO: cmp eax, 0 \n sete al \n movsx eax, al segment.append(parseAsm("bsr eax")); // ZF=1 iff eax=0 segment.append(parseAsm("lahf")); // ZF in AH bit 6 segment.append(parseAsm("shr eax, 14")); // ZF in eax bit 0 -- cgit v1.2.3