

Print the address of the top of the run-time stack for whichever process you are currently in, right before and right after you get into the printtos() function call. Also print the 4-byte contents (in hexadecimal) preceding and after those addresses. Print the addresses indicating the end of the text, data, and BSS segments of the Xinu OS. You can also see some of the *.S files in the /sys directory for reference.

The object files reside in the /compiledirectory within the main Xinu directory. To investigate the assembly code generated by the compiler, you can use the tool objdump -d to disassemble an object file.

You should not use inline assembly, (i.e., do not use asm(?)). The code for this function should be entirely written in x86 assembly. You can assume that the size of long is 4 bytes. For example, the input parameter 0xaabbccdd should generate a return value of 0xa800cdd0. long zfunction(long param)Ĭlear from the 10th to 18th bits (counting left to right), shift the parameter param by 4 bits to the left, and then fill the right most bits with 0.
