Skip to content
Advertisement

Getting digit instead of Ascii in nasm assembly intel x86

I’m trying to learn the basics of assembly but can’t get across on how to display results stored in memory.

JavaScript

What I’m trying to do is get the dot product of the two list of numbers and display it on the screen. However, I keep getting random letters which I believe are hex representations of the real decimal value. How can I convert it to decimal? The current value display is 7, which should is the equivalent ASCII char for 55, which in this case is the dot product of both list of numbers.

Advertisement

Answer

  • esi and edi must be increased such that it points to next element of array.(in this particular example, only one of them is sufficient).
  • declare mun1 andnum2 as dd, instead of db (see here). Also, you have to have method for printing number.(see this and this).

Below is a complete code which uses printf.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement