Unformatted text preview: it work correctly for large ranges.
b) Implement the I sSubset function that takes two sets returns whether the first is a
subset of the second; that is, all elements of s ub appear in m ain . The parameters are
unsigned ints used as a bit vector over the range [0, 31]. Your implementation should
only bitwise operators and ==/!=.
bool IsSubset(unsigned int sub, unsigned int main) Problem 4: IA32 assembly (
The following IA32 instructions are the disassembly from the Binky function:
$0x10, %esp # function prolog mov
mov 0x8(%ebp), %eax
%eax, -0x4(%ebp) # first line of C code
# compiles to these 4 instrs addl $0x8,0xc(%ebp) # second line of C code mov
movb -0x4(%ebp), %eax
(%edx, %eax, 4), %eax
$0x41, (%eax) # third line of C code leave
ret # function epilog Fill in the body of the Binky function with three lines of C code that compile to the above
void Binky(int x, char **y)
View Full Document
This note was uploaded on 02/06/2014 for the course CS 106X taught by Professor Cain,g during the Winter '08 term at Stanford.
- Winter '08