Question:
How to input and display character using Assembly Language Programming?
2009-07-31 21:45:13 UTC
Using MS-DOS,

1. Display:
Enter character:
2. You will input a character.
3. If you will input within capital A to Z, the message will display like these:

You've entered a big letter and its uppercase is changed case to char (lowercase of what you input).

4. If you will input within lowercase a to z, the message will display like these:

You've entered a small letter and its uppercase is changed case to char (uppercase of what you input).




Please answer my question asap. Thank you in advance!
Five answers:
Al P
2009-08-01 00:59:24 UTC
Omitting the conditional loops, use the following

code to input and display a character:



.model small

.stack 100h

.code



Start:

mov ah,1h ;notify dos input program

int 21 h ;get a character from the keyboard



;character now stored in al=> lower register

mov dl,al ;copy it to register dl

move ah, 2h ;notify dos output program

int 21h ;call interrupt: display the character



mov ax, 4C00h ;notify dos

int 21h ; end this program and back to dos

end start



Create a file: My.asm

Call it from the dos box:

>My.asm
makdu
2009-07-31 22:29:32 UTC
Check for the asci value of the input data. If you have done some coding part for this, share it so that the rest can be filled out easily.

Is it specific to some microcontroller, if so then mention that also
Afzal
2015-04-30 04:22:25 UTC
.model small

.stack 100h

.code

main proc



mov ah,9 ;input a function

int 21h

mov bl,al ;saved input in dl, because at the time of printitng it changes the content of al



mov ah,2 ;character output

mov dl,0 ; for space

int 21h



mov dl,0ah

int 21h



mov dl,bl ;finally ready to print

int 21h





mov ax,4c00h

int 21h



main endp

end main
?
2016-05-25 07:26:51 UTC
It's been a while since I wrote 68000 ASM code for the Atari. I can remember this part: move.l msg,-(sp) move.w #9,-(sp) trap #1 add.q #6, sp move.w #0,-(sp) trap #1 msg dc.b "Hello, world!"
ramzi
2016-11-11 03:52:29 UTC
if i want to input a numer biger than 1byte . how to input it ?


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...