Displaying a character

[b][red]This message was edited by stevem222 at 2002-9-24 11:18:37[/red][/b][hr]I know that I am missing something, but I don't know what. Can somebody help me? I want to be able to be prompted in dos for the number (which I am), input the number (can do that too), and have that number returned (not happening; get an upward arrow). See below:

Comments

: [b][red]This message was edited by stevem222 at 2002-9-24 11:18:37[/red][/b][hr]: I know that I am missing something, but I don't know what. Can somebody help me? I want to be able to be prompted in dos for the number (which I am), input the number (can do that too), and have that number returned (not happening; get an upward arrow). See below:

After you input your number value, you never do anything with it.Try moving it into DL and see what happens. Make sure you move it into DL at the right spot in yr code though, otherwise you'll overwrite it.

: : [b][red]This message was edited by stevem222 at 2002-9-24 11:18:37[/red][/b][hr]: : I know that I am missing something, but I don't know what. Can somebody help me? I want to be able to be prompted in dos for the number (which I am), input the number (can do that too), and have that number returned (not happening; get an upward arrow). See below:: : : The int 21h, function 02 routine (print character) uses whatever value (character) is in DL. : : After you input your number value, you never do anything with it.: Try moving it into DL and see what happens. Make sure you move it into DL at the right spot in yr code though, otherwise you'll overwrite it.: : Yes, after a little thought, I found that I was putting a bunch of stuff on a register, without clearing first as well. I took care of this, and am now going to use this for a recursive program to find the factorial of an entered number. We'll see how it goes.: : : : :

From that, I will work with the same program, creating what you see below, but I will need to verify, and write a recursive portion to display the factorial of an entered number. See what I will be working with below:

;;program displaying the factorial of a number 1-8;;Enter a number between 1 and 8;;Validates that the number is between 1 and 8;;subtracts 30 hex from the ASCII Character;;calls factorial proc, N(N-1)...;;calls process to divide by 10;;displays factorial of inputted number

Even if macro are not allowed in your class, you can just copy & pastethe code from "emu8086.inc" into your program. By the way, incase you maybe interested, here is your program converted to emu8086syntax:

; Great code by the way!

[code]

#make_COM#

; COM file is loaded at CS:0100h; (the value of CS is set by Operating System)ORG 100h

;;program displaying the factorial of a number 1-8;;Enter a number between 1 and 8;;Validates that the number is between 1 and 8;;subtracts 30 hex from the ASCII Character;;calls factorial proc, N(N-1)...;;calls process to divide by 10;;displays factorial of inputted number

hey, thanks. I'll check it out. The next thing I would like to do is display a different message if 0 or 9 is entered. The way it is now, it just jumps back to the prompt. I am gonna work on jumping to a different message (a new one), and then going through the process as normal. It will take some work though, since I have 3 weeks experience with this language.