S
S
Sergey Minakov2016-11-19 16:31:56
assembler
Sergey Minakov, 2016-11-19 16:31:56

Can you help me find the error?

Please help me find the error in the code. He must be able to type and erase text, but he can only type.

section .text
  use16
  org 0x7C00
start:
  mov ax, cs
        mov ds, ax
        mov si,a
        cld
        mov ah, 0x0e
        mov bh,0
        jmp cos
cos:
  lodsb
  test al, al
  jz text
  int 10h
        jmp cos
text:
  mov ah,0
        int 16h
        cmp ah,0Eh
        jz backspace
        mov ah,0x0e
        mov bh,0
        jmp text
backspace:
        mov ah,0x0e
        mov bh,0
        mov al,8
        int 10h
        mov ah,0x0e
        mov bh,0
        mov al,0
        int 10h
        mov ah,0x0e
        mov bh,0
        mov al,8
        int 10h
        jmp text
section .data
a db 'Starting OS',0

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-11-19
@alsopub

It was a long time ago...
If the cursor moves as it should, but the character is not erased - try instead of mov al, 0 write mov al, 20h (space) between writing two 8 (backspace).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question