Question: Implement printf using assembly language. Only allowed to use system calls to print data. No print_char, no print_string etc. CCCjre Let's be honest, we take

Implement printf using assembly language. Only allowed to use system calls to print data. No print_char, no print_string etc.Implement printf using assembly language. Only allowed to use system calls toCCCjreprint data. No print_char, no print_string etc.CCCjre Let's be honest, we take

Let's be honest, we take printfO for granted. We use this function every day. It looks so simple on the surface. Hand it some text and variables and it prints them out. Easy! But how much work does it really take to "printf"? What did the authors go through when writing this one beautiful function? Your job, implement printf. But not the whole thing. You are only responsible for: prints a string %c prints a characters % % prints a literally percent sign (%) And there's a catch: You're ONLY allowed to use system calls to print data. No print char, no print_string, etc. Example Code: segment .data strl str2 str3 str4 db Hello world",10,0 db "str3 is '%s', isn't that c 1?", 10,0 db woot woot",o db "%c is a char, but so is %8, %s again!", 10,0 segment .text global asm main asm main push strl call printf add esp, 4 push str3 push str2 call printf add esp, 8 push str3 push 'A push str4 call printf add esp. 8 Let's be honest, we take printfO for granted. We use this function every day. It looks so simple on the surface. Hand it some text and variables and it prints them out. Easy! But how much work does it really take to "printf"? What did the authors go through when writing this one beautiful function? Your job, implement printf. But not the whole thing. You are only responsible for: prints a string %c prints a characters % % prints a literally percent sign (%) And there's a catch: You're ONLY allowed to use system calls to print data. No print char, no print_string, etc. Example Code: segment .data strl str2 str3 str4 db Hello world",10,0 db "str3 is '%s', isn't that c 1?", 10,0 db woot woot",o db "%c is a char, but so is %8, %s again!", 10,0 segment .text global asm main asm main push strl call printf add esp, 4 push str3 push str2 call printf add esp, 8 push str3 push 'A push str4 call printf add esp. 8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!