Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've been struggling with the following prompt for hours:
In MS DOS, Write an assembly language program that will accept a single character from the keyboard, and then output the next character in the ASCII sequence. For example, if the character 'A' is entered, the character 'B' will be typed out.

What I have tried:

I don't really know how to add to the input value. Any advice would be greatly appreciated!
INCLUDE Irvine32.inc
.data
msg1 db "Enter a key ",0
msg2 db "You typed in ",0
.code
main PROC

mov edx, OFFSET msg1
call WriteString
call ReadChar


mov edx, OFFSET msg2
call WriteString
call WriteChar 

exit
main ENDP
END main
Posted
Updated 10-May-21 23:33pm
v2
Comments
Patrice T 18-Feb-18 13:02pm    
What have you done so far?
Member 13684076 18-Feb-18 13:10pm    
I have a program that accepts one input value and outputs that same value.
Patrice T 18-Feb-18 13:18pm    
Show your code.
Member 13684076 18-Feb-18 13:29pm    
INCLUDE Irvine32.inc
.data
msg1 db "Enter a key ",0
msg2 db "You typed in ",0
.code
main PROC

mov edx, OFFSET msg1
call WriteString
call ReadChar


mov edx, OFFSET msg2
call WriteString
call WriteChar

exit
main ENDP
END main
Patrice T 18-Feb-18 13:39pm    
Use Improve question to update your question.
So that everyone can pay attention to this information.

1 solution

In any computer language adding 1 to 'A' will produce 'B'. If you do not understand that basic concept then you need to get hold of an introductory book on computers.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900