Put the Arguments in the Right Registers

Easy

The buildNumber function assembles a three-digit number from its hundreds, tens, and ones parameters, in that order. Both calls in main pass the digits in the wrong order, so the numbers come out reversed. Fix the argument order so the program prints 123 and 456, then switch the assembly panel to -O0 and watch main stage each value into its argument register right before the call: edi carries the first argument, esi the second, edx the third.

Success Criteria

Your code must pass 1 test case(s) to complete this exercise. 3 hint(s) are available if you need help.

Sign in to track your progress

You can work on exercises as a guest, but sign in to track your progress and save your submissions.

This platform is built by its community

Every lesson, project, and tool on HelloC++ is funded by sponsors. Join them and help shape what we build next.

Become a Patron