: Unless performance is critical (I assume not since this is posted
: below Windows API), then I would stay away from inline assembler.
: Something like this should work:
:
I think the question was getting this program to work in assembly (seeing the title and the image posted).
But your code is actually a string-enrollment of ADC, which might be more to the point here than converting strings to numbers and back to strings again.
If you'd loop this code for each entry in the string, accounting for carry over from the previous addition, then this could easily be translated to assembly code and your program would for the largest part be done.
:
: int sum;
:
: sum = str1[i] + str2[i];
: sum -= 2 * '0'; /* convert from string to int */
:
: if(sum > 9 )
: {
: result_str[i-1] = sum / 10 + '0';
: result_str[i] = sum % 10 + '0';
: }
: else
: {
: result_str[i] = sum;
: }
: :
:
:
Best Regards,
Richard
The way I see it... Well, it's all pretty blurry