100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
AIN3701 Activity 5.8 AIN3701 Activity 5.8 R47,54   Add to cart

Exam (elaborations)

AIN3701 Activity 5.8 AIN3701 Activity 5.8

 64 views  0 purchase

AIN3701 Activity 5.8 AIN3701 Activity 5.8

Preview 2 out of 6  pages

  • August 8, 2023
  • 6
  • 2023/2024
  • Exam (elaborations)
  • Questions & answers
All documents for this subject (9)
avatar-seller
NURSING2EXAM
AIN3701 Activity 5.8




AIN3701 Activity 5.8

, AIN3701 Activity 5.8
Components of instruction;

Opcode–what the instruction does.
Operand –what the instruction performs upon.


Chapter(5) 5.8
5.8 we want to increase the number of registers that we can specify in the LC-3 ADD instruction
to 32. Do you see any problem with that? Explain

ANS
increasing the number of registers to 32 will need 5 bits to denote the register number. Now, the
minimum number of bits needed for the ADD instruction will be 4(for the opcode)+ 3 registers *
5 bits=19 bits. This cannot fit in the 16-bits allocated for an LC-3 instruction

We would need 5 bits to specify registers. There would not be enough bits for the ADD
instruction if we specify it in 16 bits.
We would therefore need to rewrite the ISA and use a larger instruction size.

Implementation in C++ language

private static int Main()
{
int funcname(int arg1, int * arg2, int arg3)
{
int res;
__asm__ volatile = new __asm__("int $0x80" : "=a" (res) "+b" (arg1), "+c"
(arg2), "+d" (arg3) : "a" (128) : "memory", "cc"); // announce to the compiler
that the memory and condition codes have been modified

/* The operating system will return a negative value on error;
* wrappers return -1 on error and set the errno global variable */
if (-125 <= res && res < 0)
{
errno = -res;
res = -1;
}
return res;
}
It @is hard to specify directly use;

//There is an error message when return is not embeded instructions:
//asm("movl $0, %%ebx;" + "movl $1, %%eax;");




Chapter(5) 5.15
5.15 State the contents of R1,R2,R3, and T4 after the program starting location x3100 halts


AIN3701 Activity 5.8

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying this summary from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller NURSING2EXAM. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy this summary for R47,54. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

80461 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy summaries for 14 years now

Start selling
R47,54
  • (0)
  Buy now