Insert values from 0 to 15 on the keyboard in Assembly fasm x86

Asked

Viewed 473 times

1

Good. I have to do a program on Assembly that reads a number from the keyboard that is to choose a color in video mode. From 0 to 9 I know that’s so:

mov ah, 40h                  ;Pedir um valor
mov bx, 1
mov cx, 44
mov dx, pergunta
int 21h


mov ah, 3Fh                     ;Introduzir valor
mov bx, 0
mov cx, 1
mov dx, valor
int 21h

sub [valor],48

Now I need help to be 0 to 15

  • Buddy, interrupts are totally dependent on the operating system used, except that you’re on real mode. How do you? Is it in Linux, Windows, DOS (real mode)? The most likely is that you take two keyboard values and add them to the decimal style (0->1)*10 + (0->9)

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.