mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 09:52:44 +00:00 
			
		
		
		
	UserspaceEmulator: Fix too-wide accumulator used in 8/16 bit CMPXCHG
This commit is contained in:
		
							parent
							
								
									8ec8ec8b1c
								
							
						
					
					
						commit
						d321dc0a74
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -1074,7 +1074,7 @@ void SoftCPU::CMPSW(const X86::Instruction& insn) | ||||||
| void SoftCPU::CMPXCHG_RM16_reg16(const X86::Instruction& insn) | void SoftCPU::CMPXCHG_RM16_reg16(const X86::Instruction& insn) | ||||||
| { | { | ||||||
|     auto current = insn.modrm().read16(*this, insn); |     auto current = insn.modrm().read16(*this, insn); | ||||||
|     if (current == eax()) { |     if (current == ax()) { | ||||||
|         set_zf(true); |         set_zf(true); | ||||||
|         insn.modrm().write16(*this, insn, gpr16(insn.reg16())); |         insn.modrm().write16(*this, insn, gpr16(insn.reg16())); | ||||||
|     } else { |     } else { | ||||||
|  | @ -1098,7 +1098,7 @@ void SoftCPU::CMPXCHG_RM32_reg32(const X86::Instruction& insn) | ||||||
| void SoftCPU::CMPXCHG_RM8_reg8(const X86::Instruction& insn) | void SoftCPU::CMPXCHG_RM8_reg8(const X86::Instruction& insn) | ||||||
| { | { | ||||||
|     auto current = insn.modrm().read8(*this, insn); |     auto current = insn.modrm().read8(*this, insn); | ||||||
|     if (current == eax()) { |     if (current == al()) { | ||||||
|         set_zf(true); |         set_zf(true); | ||||||
|         insn.modrm().write8(*this, insn, gpr8(insn.reg8())); |         insn.modrm().write8(*this, insn, gpr8(insn.reg8())); | ||||||
|     } else { |     } else { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling