Как исправить исключение «ошибка: недопустимая комбинация кода операции и операндов» в этом коде? - PullRequest
0 голосов
/ 14 мая 2018

Как исправить исключение «ошибка: недопустимая комбинация кода операции и операндов» в этом коде?

Вот мой код в bootsimple.asm :

BITS 16
jmp short bootloader_start
nop
bootloader_start:
    mov ax, 07C0h           ; Set up 4K of stack space above buffer
    add ax, 544         ; 8k buffer = 512 paragraphs + 32 paragraphs (loader)
    ;cli                ; Disable interrupts while changing stack
    mov ss, ax
    mov sp, 4096
    ;sti                ; Restore interrupts

    mov ax, 07C0h           ; Set data segment to where we're loaded
    mov ds, ax
    mov si,prompt
    call print_string
    lea si,string
    call read_string
    mov si, string
    call print_string

print_string:           ; Routine: output string in SI to screen
    ;pusha
    mov ah, 0Eh     ; int 10h 'print char' function

.repeat:
    lodsb           ; Get character from string
    cmp al, 0
    je .main_done       ; If char is zero, end of string
    int 10h         ; Otherwise, print it
    jmp .repeat

.main_done:
    mov si,eol
.eol_repeat:
    lodsb           ; Get character from string
    cmp al, 0
    je .done        ; If char is zero, end of string
    int 10h         ; Otherwise, print it
    jmp .eol_repeat
.done:
    ;popa
    ret
read_string:
.repeat:
    mov     ah, 01h
    int     21H                 ; read 1 character
    cmp     al, 0x0A              ; is it return?
    je      .done                ; yes, we are done
    mov     [si], al            ; no, move charater into buffer
    inc     si                  ; increase pointer
    jmp     .repeat             ; loop back
.done:            
    ret
    eol db 10,0
    prompt db "Hello>"
    string times 80 db 0
    times 510-($-$$) db 0   ; Pad remainder of boot sector with 0s
    dw 0xAA55       ; The standard PC boot signature

Во время компиляции есть исключение:

bootsimple.asm: 16: ошибка: недопустимая комбинация кода операции и операндов

Я просто издеваюсь

...