Question: Using assembly language , implement printf. But not the whole thing. You are only responsible for: %s prints a string %c prints a characters %%
Using assembly language, implement printf. But not the whole thing. You are only responsible for: %s prints a string %c prints a characters %% prints a literally percent sign (%) And theres a catch: Youre ONLY allowed to use system calls to print data. No print_char, no print_string, etc.
Example Code:
segment .data str1 db Hello world,10,0 str2 db str3 is %s, isnt that cool?,10,0 str3 db woot woot,0 str4 db %c is a char, but so is %%, %s again!,10,0 segment .text global asm_main asm_main: push str1 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
Get step-by-step solutions from verified subject matter experts
