From 7c036fd0f7d51d2dc87ccbfee66c673f95b42d0f Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Sun, 10 Nov 2013 18:14:40 +0000 Subject: [PATCH] [NTVDM] Remove unnecessary indentation and clarify the code a bit. svn path=/branches/ntvdm/; revision=60919 --- subsystems/ntvdm/int32.c | 47 +++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/subsystems/ntvdm/int32.c b/subsystems/ntvdm/int32.c index 4212709806f..96a0b77a5e9 100644 --- a/subsystems/ntvdm/int32.c +++ b/subsystems/ntvdm/int32.c @@ -130,40 +130,38 @@ VOID WINAPI InitializeInt32(WORD BiosSegment) { LPDWORD IntVecTable = (LPDWORD)BaseAddress; LPBYTE BiosCode = (LPBYTE)SEG_OFF_TO_PTR(BiosSegment, 0); - USHORT i; WORD CommonStub, BopSeqOffset, Offset; - CommonStub = Offset = 0x00; + CommonStub = Offset = 0; /* Write the common stub code */ - { + // BOP_SEQ: - BiosCode[Offset++] = 0xF8; // clc + BiosCode[Offset++] = 0xF8; // clc - BiosCode[Offset++] = LOBYTE(EMULATOR_BOP); // BOP sequence - BiosCode[Offset++] = HIBYTE(EMULATOR_BOP); - BiosCode[Offset++] = EMULATOR_CTRL_BOP; // Control BOP - BiosCode[Offset++] = CTRL_BOP_INT32; // 32-bit Interrupt dispatcher + BiosCode[Offset++] = LOBYTE(EMULATOR_BOP); // BOP sequence + BiosCode[Offset++] = HIBYTE(EMULATOR_BOP); + BiosCode[Offset++] = EMULATOR_CTRL_BOP; // Control BOP + BiosCode[Offset++] = CTRL_BOP_INT32; // 32-bit Interrupt dispatcher - BiosCode[Offset++] = 0x73; // jnc EXIT (offset +4) - BiosCode[Offset++] = 0x04; + BiosCode[Offset++] = 0x73; // jnc EXIT (offset +4) + BiosCode[Offset++] = 0x04; - BiosCode[Offset++] = 0xFB; // sti + BiosCode[Offset++] = 0xFB; // sti - // HACK: The following instruction should be HLT! - BiosCode[Offset++] = 0x90; // nop + // HACK: The following instruction should be HLT! + BiosCode[Offset++] = 0x90; // nop - BiosCode[Offset++] = 0xEB; // jmp BOP_SEQ (offset -11) - BiosCode[Offset++] = 0xF5; + BiosCode[Offset++] = 0xEB; // jmp BOP_SEQ (offset -11) + BiosCode[Offset++] = 0xF5; // EXIT: - BiosCode[Offset++] = 0x83; // add sp, 4 - BiosCode[Offset++] = 0xC4; - BiosCode[Offset++] = 0x04; + BiosCode[Offset++] = 0x83; // add sp, 4 + BiosCode[Offset++] = 0xC4; + BiosCode[Offset++] = 0x04; - BiosCode[Offset++] = 0xCF; // iret - } + BiosCode[Offset++] = 0xCF; // iret /* Generate ISR stubs and fill the IVT */ for (i = 0x00; i <= 0xFF; i++) @@ -178,12 +176,11 @@ VOID WINAPI InitializeInt32(WORD BiosSegment) BiosCode[Offset++] = 0x6A; // push 0 BiosCode[Offset++] = 0x00; - BopSeqOffset = CommonStub - Offset - 3; + BopSeqOffset = CommonStub - (Offset + 3); - BiosCode[Offset+0] = 0xE9; // jmp near BOP_SEQ - BiosCode[Offset+1] = LOBYTE(BopSeqOffset); - BiosCode[Offset+2] = HIBYTE(BopSeqOffset); - Offset+=3; + BiosCode[Offset++] = 0xE9; // jmp near BOP_SEQ + BiosCode[Offset++] = LOBYTE(BopSeqOffset); + BiosCode[Offset++] = HIBYTE(BopSeqOffset); } }