From 76ea95acf5ae68b37482b8a4f66c45856d0e6df2 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 25 Oct 2015 01:55:31 +0200 Subject: [PATCH] Fix test_long_mode (closes #4) --- _posts/2015-08-25-entering-longmode.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_posts/2015-08-25-entering-longmode.md b/_posts/2015-08-25-entering-longmode.md index 0621dea0..72f4de6c 100644 --- a/_posts/2015-08-25-entering-longmode.md +++ b/_posts/2015-08-25-entering-longmode.md @@ -125,10 +125,10 @@ test_long_mode: cpuid ; CPU identification. cmp eax, 0x80000001 ; Compare the A-register with 0x80000001. jb .no_long_mode ; It is less, there is no long mode. - mov eax, 0x80000000 ; Set the A-register to 0x80000000. + mov eax, 0x80000001 ; Set the A-register to 0x80000001. cpuid ; CPU identification. - cmp eax, 0x80000001 ; Compare the A-register with 0x80000001. - jb .no_long_mode ; It is less, there is no long mode. + test edx, 1 << 29 ; Test if the LM-bit, which is bit 29, is set in the D-register. + jz .no_long_mode ; They aren't, there is no long mode. ret .no_long_mode: mov al, "2"