I am haveing some trouble with a code what i want to do is input a charater from the keyboard and print it on the next line with a "?" as the input so the user knows a input is required
: I am haveing some trouble with a code : what i want to do is input a charater from the keyboard and print it on the next line with a "?" as the input so the user knows a input is required : : Look at my homepage and find a lot of examples, how to deal with keyboard and output on screen in the downloadable assembler OS: http://www.rcfriz.de
: I am haveing some trouble with a code : what i want to do is input a charater from the keyboard and print it on the next line with a "?" as the input so the user knows a input is required
;example for inputting user name: org 100h jmp begin inputmsg db 'Enter your name ?',0 ;asciiz string
begin: mov dx, inputmsg ;this will print on the screen mov ah, 9 ;"Enter your name? _" int 21h ;type your keyboard handler here
: int 21h : ;type your keyboard handler here : I'm sorry!- at least 15 years passed, since I worked with int 21h, and I do not have any information about it (maybe You'll find it using google-search). But if You want to know, how to read directly the input from keyboard, reading at the ports of the keyboard-controller, You could find a well commented example in the source of my OS "FDOS1", which You can download from my homepage: www.rcfriz.de My OS works in protected mode, but interfacing the keybord-controller is the same in real mode (You need to use real-mode-code of course!). You will need Your own interrupt-handler for int #1 in the interrupt-controller (You need to take care for the base- number of this controller!) and then You need to write Your own keyselection including a read-access at the keybord-controller. If You want to use Your code under MSDOS You will need some more code after reading the keybord-controller. You need to tell the interrupt-controller the end of interrupt too ("eoi"). In my OS I set "automatically eoi" different to MSDOS... :
Comments
: what i want to do is input a charater from the keyboard and print it on the next line with a "?" as the input so the user knows a input is required
:
: Look at my homepage and find a lot of examples, how to deal with keyboard and output on screen in the downloadable assembler OS:
http://www.rcfriz.de
: what i want to do is input a charater from the keyboard and print it on the next line with a "?" as the input so the user knows a input is required
;example for inputting user name:
org 100h
jmp begin
inputmsg db 'Enter your name ?',0 ;asciiz string
begin:
mov dx, inputmsg ;this will print on the screen
mov ah, 9 ;"Enter your name? _"
int 21h
;type your keyboard handler here
: int 21h
: ;type your keyboard handler here
:
I'm sorry!- at least 15 years passed, since I worked with int 21h, and I do not have any information about it (maybe You'll find it using google-search).
But if You want to know, how to read directly the input from keyboard, reading at the ports of the keyboard-controller, You could find a well commented example in the source of my OS "FDOS1", which You can download from my homepage:
www.rcfriz.de
My OS works in protected mode, but interfacing the keybord-controller is the same in real mode (You need to use real-mode-code of course!). You will need Your own interrupt-handler for int #1 in the interrupt-controller (You need to take care for the base- number of this controller!) and then You need to write Your own keyselection including a read-access at the keybord-controller.
If You want to use Your code under MSDOS You will need some more code after reading the keybord-controller. You need to tell the interrupt-controller the end of interrupt too ("eoi"). In my OS I set "automatically eoi" different to MSDOS...
: