Thread: Assembly help
View Single Post
 
Reply
Posted 2004-06-27, 12:24 PM in reply to Demosthenes's post starting "Why don't you just post the problem?"
Okay, need help again.

Code:
;include main 32-bit header
include irvine32.inc

.data
;program data
input byte 20 dup (?)

.code
         ;program code
main proc
	mov edx, offset input		;sets edx to the beginning of input

getnums:
	call readhex
	cmp eax, 99h			;this checks for an exit flag
	je continue			;exits if flag is given
	mov [edx], al
	add edx, 1
	cmp edx, offset input + 28	;checks for the 28th number (total in example)
        jc getnums			;loop if not finished
	
continue:
	mov ecx, edx			;makes a copy of edx to know when to stop
	mov edx, offset input		;sets edx back to the beginning of input
	
printnum:
	mov eax, [edx]
	call writehex
		

	;exit the program
        exit
main endp
end main
My call to writehex works, but I need to print out the values entered. As it is, if I enter A, it loops, then I enter 99 to get out of the loop, I have a problem.

The register, eax, is 0000000A. So, when I call writehex, it writes 0000000A. I just need it to print A. How do I do that?
D3V said:
This message is hidden because D3V is on your ignore list.
What is it they say about silence being golden?

Last edited by Medieval Bob; 2004-06-27 at 12:55 PM.
Old
Profile PM WWW Search
Medieval Bob enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHzMedieval Bob enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHz
 
 
Medieval Bob