So, I'm trying to summarize 1 + 11 + 111, given the number n, which determines how many series values ββI add together. those. n = 2, I will add 1 + 11 or n = 3, I will add 1 + 11 + 111. I already wrote a function in C, but I'm trying to transfer it to the x86 assembly, and I am having problems, Here is the C function:
int summation(int n) { int sum = 0, j = 1; for (int i = 1; i <= n; i++) { sum = sum + j;
Here is my x86 assembler code:
unsigned int seriesSum(int n) { unsigned int sum=0; __asm { mov ebx, n
I thought I translated it correctly, but it looks like I am getting 0s as my sum.
source share