Im getting some troubles doing a notepad in assembler the first problem its that i cant use int21h i must use int10h and i dont know how to capture those keys:

arrows keys
home key
end key
backspace key
pgup & pgdn key

if somebody can.....please give me a hand with this!!!
Posted on 2007-03-06 06:31:43 by J_Osv
Check out THIS THREAD.

Look up BIOS INT 16h.
Posted on 2007-03-06 17:23:10 by SpooK
Spook's post should be more than enough for you in order to learn what you have to do to handle those keys but one addition to this is that you can poll the Keyboard Microcontroller manually and read the scan code yourself. After the scan code is read, you can translate it to the key that it represents and then take action.

Here is an example for polling the Keyboard Microcontroller at port 0x64:

.WaitForOutput:
    IN      AL , 0x64
    TEST    AL , 0x01
    JZ      .WaitForOutput
  IN      AL , 0x60


The AL register will be filled with the scan code of the character printed to the screen. The .WaitForOutput loop waits for a key to be pressed. You can read Chapter 20 of the book Art of Assembly by Randall Hyde to see the table of scan codes and etc.

Another easy way to handle this problem is to use INT 0x16. These are two procedures that I have written in my OASML 2.0 library.

; ------------------------------
ReadChar PROC
  COMMENT *
    Description : Wait for a character to be entered onto the console window and return
                  the ASCII code in the AL register and the Scan code in the AH register.
                  The function would then echo the character to the window. See note(s).

    Calling Convention : Register.

    Parameter(s) :
      -None-

    Stack Usage: 2 Bytes.

    Note : 1) The Scan code will be returned in the AH register and the ASCII code of the
              character in the AL register.
           2) The ReadChar function echoes the entered character to the window.
           3) Also see the ReadCharNE (Read Character No Echo) function.

    Example : Wait for the user to enter a key on the keyboard and return the values according
              to the above notes.

    .CODE
      Call    ReadChar ; Call the function
      ; AH = Key's Scan Code
      ; AL = Key's ASCII Code
  *
  @@__ReadCharLoop:                       ; The main loop to get the keystrokes
    MOV     AH , 01h                      ; Check Keystroke function
    DW      16CDh                         ; Issue the interrupt
    JZ      @@__ReadCharLoop              ; Keep checking until a key is pressed
  PUSH    AX                              ; AH = Scan Code , AL = ASCII Code
  MOV     AH , 00h                        ; Get Keystroke function
  DW      16CDh                           ; Issue the interrupt
  MOV     AH , 0Eh                        ; Print character function
  DW      10CDh                           ; Issue the interrupt
  POP     AX                              ; AH = Scan Code, AL = ASCII Code
  RET                                     ; Return to the calling procedure
ReadChar ENDP
; ------------------------------
ReadCharNE PROC
  COMMENT *
    Description : Wait for a character to be entered onto the console window and return
                  the ASCII code in the AL register and the Scan code in the AH register.
                  The function does not echo the character to the screen. See note(s).

    Calling Convention : Register.

    Parameter(s) :
      -None-

    Stack Usage: 2 Bytes.

    Note : 1) The Scan code will be returned in the AH register and the ASCII code of the
              character in the AL register.
           2) The ReadCharNE function does not echo the entered character to the window.
           3) Also see the ReadChar (Read Character) function.

    Example : Wait for the user to enter a key on the keyboard and return the values according
              to the above notes.

    .CODE
      Call    ReadCharNE ; Call the function
      ; AH = Key's Scan Code
      ; AL = Key's ASCII Code
  *
  @@__ReadCharNELoop:                     ; Keep checking for keystrokes
    MOV     AH , 01h                      ; Check keystrokes function
    DW      16CDh                         ; Issue the interrupt
    JZ      @@__ReadCharNELoop            ; Keep doing this until a key is pressed
  PUSH    AX                              ; AH = Scan Code, AL = ASCII Code
  MOV     AH , 00h                        ; Get keystroke function
  DW      16CDh                           ; Issue the interrupt
  POP     AX                              ; AH = Scan Code, AL = ASCII Code
  RET                                     ; Return to the calling procedure
ReadCharNE ENDP
; ------------------------------


Good luck.
Posted on 2007-03-11 03:43:05 by XCHG