Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey guys,
I'm trying to print some number in EAX size by converting it into ascii and past it into the string, this is my code (only the printing part):

;put numbers in str
putYSq:
	MOV BX,20           ;the number start at string[20]->[19]....
	MOV tempXSq,EDX     ;
	XOR EDX,EDX 
	DIV Ten             ;divided by 10 to get the laft digit
	ADD EDX,'0'         ;convert to ascii
	MOV XYstrSq[BX],EDX ;THIS IS WERE I KEEP GETTING THE ERROR***
	DEC BX              ;next is string[19]->[18]....     
	CMP EAX,0           ;if the number is 0 or less then exit from loop
	JBE nextNum 
	JMP putYSq



pls help, THX!
Posted
Comments
Richard MacCutchan 1-Sep-13 3:07am    
What error?
idobry 1-Sep-13 3:39am    
illegal indexing mode
Richard MacCutchan 1-Sep-13 3:50am    
Should you be using EBX rather than BX?
idobry 1-Sep-13 4:51am    
Nope, i tried it
Richard MacCutchan 1-Sep-13 7:22am    
Sorry, I can't suggest anything else, you could try googling for that error message.

I also notice that your label putYSq: is in the wrong place, it should be just before the XOR EDX,EDX.

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