Page 1 of 1

3. The following is a working assembly language implementation of the “adddigit” function from calcc. Explain the relati

Posted: Sat May 14, 2022 7:55 pm
by answerhappygod
3 The Following Is A Working Assembly Language Implementation Of The Adddigit Function From Calcc Explain The Relati 1
3 The Following Is A Working Assembly Language Implementation Of The Adddigit Function From Calcc Explain The Relati 1 (86.06 KiB) Viewed 43 times
3. The following is a working assembly language implementation of the “adddigit” function from calcc. Explain the relationship between this implementation and the C code. 1 #define adddigit(c) asm( "lodsb \n" "movb $10, %%b/ \n" "mulb %%bl \n" "subb $48, %%al \n" "addb %%cl, %%al\n" "stosb \n" : : "S" (SP), "D" (SP), "c" (c) ) 4. In the stropy program, the instructions lodsb and stosb are used to load and store bytes of data as if they were string references. Show how you could modify the strcpy program to use just the mov operation rather than the lods and stos operations.