October 2004
Intermediate to advanced
336 pages
6h 27m
English
This function returns the change from a dollar for a specified number of cents.
The number of cents is the only argument and it is pushed on the stack. The valid range for this argument is between 0 and 100 (inclusive). The procedure is not responsible for checking that the argument is in the proper range.
The coin values are 25 cents, 10 cents, 5 cents, and 1 cent. The procedure returns as many of the largest coins as possible, then the next largest, and so on.
The procedure returns a dword in eax. The high byte is the number of quarters, then the number of dimes and nickels, and the low byte is the number of pennies. ...
Read now
Unlock full access