
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Program Assignment # Summer 2008 CSC 3210 Due Thursday, July 10th^ at 10:00 am Write a program to perform various logical functions on a range of numbers. At the start of your program define a constant xval to have a certain value. The TA will change this to test your program, so make sure not to code based upon any particular value. Your program should do the following for the range of numbers from xval to (xval + 4). The value of xval can be between 0 and 4096. Note: For the step of determining if the value is divisible by 4, you should only use logical instructions and not arithmetic instructions to accomplish this. Suppose xval is given an initial value of 22. You should display the following: xval = 22 decimal xval = 0x16 hexidecimal swapping bytes 0 and 1 results in 0x Is xval divisible by 4? No Complementing the first two bytes of xval results in 0xffe xval = 23 decimal xval = 0x17 hexidecimal swapping bytes 0 and 1 results in 0x Is xval divisible by 4? No Complementing the first two bytes of xval results in 0xffe xval = 24 decimal xval = 0x18 hexidecimal swapping bytes 0 and 1 results in 0x Is xval divisible by 4? Yes Complementing the first two bytes of xval results in 0xffe xval = 25 decimal xval = 0x19 hexidecimal swapping bytes 0 and 1 results in 0x Is xval divisible by 4? No Complementing the first two bytes of xval results in 0xffe