On Mon, 1 Nov 2004, EECS 382 student wrote: > Professor Wolff > > I had a few questions about the take home test. > The questions I have are with the function of DPTR > and how it corresponds to DPL and DPH. > If you place values within these 2 registers, how does that affect the > DPTR since DPL are separate 8bit registers of the entire 16 bit DPTR. The DPTR =Bits 15-0 =(Bits 15-8=DPH)(bits 7-0=DPL) So, modifying DPL only changes the lower 8 bits of DPTR and leaves the upper 8 bits untouched. So, modifying DPH only changes the upper 8 bits of DPTR and leaves the lower 8 bits untouched. > The other question relates to the C code. Did you just want us to put > values in for the two registers, or is there additional code. Again, I > do not understand how DPTR relates to DPL and DPH. Even though problem 1 is broken down into primitive eight bit operations, try to look at it at a higher level. What is it doing at the 16 bit level? In class, I showed how to add 16bit numbers by using low level 8-bit operations. Problem 2 asks the reverse, what is the high level operation going on? > Finally, I am not sure how we would account for the > carry bit when we are adding in the JVM. That's the big question to think about different computer architectures. JVM is a 32 bit machine, do you need a carry to do a 16-bit or 32-bit operation? > In the 8051, the ADDC function would just add 1 to the particular value > if C was set. Is this what we are supposed to simulate in the JVM too? You are thinking is to fine detailed. Think abstractly, what is the goal of the calculation of DPTR? --frank. > > Thanks >