flat assembler
Message board for the users of flat assembler.

Index > OS Construction > reading user input by bios functions

Author
Thread Post new topic Reply to topic
Saveriokarol



Joined: 21 Sep 2022
Posts: 1
Saveriokarol 21 Sep 2022, 15:09
Hello, Im Saveriokarol but i dont know how to read user input. Im doing for a command line os. Anyone help me with an example.
Post 21 Sep 2022, 15:09
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 926
Location: Russia
macomics 21 Sep 2022, 19:15
What kind of user input exactly?
Keyboard:
Code:
    mov ah, 0 ; 88-key keyboard
    int 22 ; al = ascii code, ah = scancode
; or
    mov ah, 16 ; extended
    int 22 ; al = ascii code, ah = scancode    


COM:
Code:
    mov ah, 0 ; initialize
    mov al, 11100011b ; 9600 boud / no parity / 8-bit sequence + 1-bit stop
    mov dx, COM_NUMBER ; 0 - 3
    int 20 ; al = model status, ah = line status
; and then
    mov ah, 3 ; receive
    mov dx, COM_NUMBER ; 0 - 3
    int 20 ; al = byte, ah = line status    

Mouse:
Code:
    mov ax, 0xC200 ; activate / deactivate
    mov bh, 1 ; activate
    int 21 ; cf = error, al = status
; and then
    mov word [cs:callback_proc + 2], cs
    mov ax, 0xC207 ; setup callback
    les bx, [callback_proc]
    int 21 ; cf = error
; callback ptotype
mouse_callback:
  virtual at bp + 6
    .state dw ?
    .X     dw ?
    .Y     dw ?
    .flags dw ? ; always zero (reserved)
  end virtual
    push bp
    mov bp, sp

    leave
    retf
callback_proc dd mouse_callback and 0xFFFF    
Post 21 Sep 2022, 19:15
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.