0

I'm using Windows 10 for that

Here is error:

ExtendedProgram.asm:34: error: operation size not specified

Here is my code in assembly:

[org 0x7e00]

jmp EnterProtectedMode

%include "gdt.asm"
%include "print.asm"

EnterProtectedMode:
    call EnableA20
    cli
    lgdt [gdt_descriptor]
    mov eax, cr0
    or eax, 1
    mov cr0, eax
    jmp codeseg:StartProtectedMode

EnableA20:
    in al, 0x92
    or al, 2
    out 0x92, al
    ret

[bits 32]

StartProtectedMode:

    mov ax, dataseg
    mov ds, ax
    mov ss, ax
    mov es, ax
    mov fs, ax
    mov gs, ax

    mov [0xb8000], 'H'

    jmp $

times 2048-($-$$) db 0

I really need fast help because i want to create my own operating system, and by the way i need to fill this with text or stackoverflow will kill me because its mostly code

1 Answers1

0

Okay, i solved it by myself, i needed to add byte before 'H' duhh.

  • 1
    Recommended style is to put the size specifier on the memory operand, not the immediate. That makes more sense because the memory access width is what matters, as opposed to say `add eax, strict dword 1` to force encoding the immediate as imm32 instead of imm8. It does work, though, to use `add [mem], byte 1` to imply byte operand-size, with just `byte` instead of `strict byte`. – Peter Cordes Dec 21 '21 at 19:06