I am trying to write a program using direct addressing and pointers on the number and create a 32 bit variable from 10136654 All operations will be done in 16 bit registers like ax, bx, etc.
But how is this possible if it must go in 16 bit from 32 bit?

a) NAND the upper 16-bits with the lower 16-bits and store the 16-bit result in a variable named MyNAND.

b) NOR the upper 16-bits with the lower 16-bits and store the 16-bit result in a variable named MyNOR

c) XOR the upper 16-bits with the lower 16-bits and store the 16-bit result in a variable named MyXOR.

d) XNOR the upper 16-bits with the lower 16-bits and store the 16-bit result in a variable named MyXNOR

Recommended Answers

All 6 Replies

this is about the weirdest homework question ive ever come across..

XOR is the only two-way function so could only be the possible answer.

but thats a ridiculous way to handle addressing. it requires that one half basically be constant.

really? i hate my professor, he is a 75 year old insane douche bag sado-masochist. But he insists that we must do all 4 of these, and that it is possible...

i'm sorry, i totally misunderstood the question. forget everything i wrote. this is not that unusual after all.

do you have any more information about this problem?

Use your whole BCC ID number (10136654) to create a single 32-bit variable (ie 8 digits), assume the resulting number is already hexadecimal (ie do not convert the digits). Name the variable MyID. Write a program (name it P3a.cpp) that will perform the following operations, using direct addressing and pointers on that number. All operations will be done in 16 bit registers like ax, bx, etc.

a) NAND the upper 16-bits with the lower 16-bits and store the 16-bit result in a variable named MyNAND.

b) NOR the upper 16-bits with the lower 16-bits and store the 16-bit result in a variable named MyNOR

c) XOR the upper 16-bits with the lower 16-bits and store the 16-bit result in a variable named MyXOR.

d) XNOR the upper 16-bits with the lower 16-bits and store the 16-bit result in a variable named MyXNOR

Verify your results in the debugger and provide a single screen shot of the entire debugger window showing all of the answers in a single watch window. What are the answers? Type the answers (from a calculator or by hand), in your program code, as part of the program description.

gah. you're right. he is a sadist.

i'm going to apologetically back out of this now. I'm too far removed from assembly these days to be of any help. its been 5 years since i took it in school.

hopefully someone else can help you here. personally, I'd be hitting his office hours or his TA.

haha thanks for the effort, i would go to his office hours, if he had them. he runs an online class, most likely because he has no social skills.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.