123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|700|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> C/C++/C#/Other -> Converting a Digit in Assembly

Thu, 28 Jan 2010, 17:16
dna
Ethan.

You asked yesterday about printing a digit out in assembly language.

The way you almost had it was right but required extra coding.
Here is the routine that converts a single digit and prints it.



This compensates for those integers that produce a Diamond or club that you use to get.
It also uses the INT 33h instead of your INT 21 service call 9. Yours works but probably does something to the registers. I cannot find my reference manual to check.
This also does not require any memory locations. You can just use MOV AX,4 before the ADD AX,30H and it will print the 4. Comment out the ADD AX,030 and you should get a diamond.
Finally, your exit to DOS was right but there is a simpler one INT 20H. Your version INT 21H service call 4C works but INT 20H stops cold, no problems.
If you want to use this as a subroutine remove the INT 20H and add a RET.

Sorry I could not get back to you sooner. I still cannot find my manual.

-=-=-
DNA
Fri, 29 Jan 2010, 09:46
Erebel55
Awesome, thanks for the help man, your a life saver. I owe ya one


-=-=-
Lava Monkey
https://play.google.com/store/apps/details?id=com.lvm.lavamonkey