al_homework repository.
You may NOT use/access:
Failure to abide by these guidelines will result in a zero for the assignment and the incident will be reported to the university provost as a violation of the university academic integrity policy. A second incident of academic dishonesty (whether from this course or another computer science course) will result in an F in the course.
cmp_str that accepts two arguments. Both
arguments should be 64-bit addresses of null-terminated strings. The macro
should work whether the addresses are stored in registers or in labels.
The macro should perform a byte-wise comparison of the individual bytes of the two strings and should finish with the status flags set so that the conditional jump commands will work properly if issued directly after the macro call.
The macro should preserve registers with the possible exception of one register that you may destroy.
Your program should allow the user to enter two strings and then should use the macro to determine whether the the strings are equal or if the first is less than the second or if the first is greater than the second. The input and output should be performed in the main program (not in the macro).
cmp_str A,B jl fun jmp superfun
This table shows expected results for various values of A and B. REMEMBER: A and B could be labels or registers containing the address of a string. NOTE: This is NOT a complete list of test value, but rather some examples to illustrate what is expected.
| A | B | Comparison | Result |
| ABE | LINCOLN | ABE |
jump to fun |
| ABE | AB | ABE |
jump to superfun |
| ZZTOP | abe | ZZTOP |
jump to fun |
| (empty string) | A | `' |
jump to fun |
| SUPERFUN | SUPERFUNNY | SUPERFUN |
jump to fun |
| ABE | ABE | ABE |
jump to superfun |
| Correctness/Completeness | 16 | pts |
| Documentation | 2 | pts |
| x86 Conventions | 2 | pts |
| Total | 20 | pts |
See Homework #6 for instructions on proper documentation and on x86 assembly language conventions.