sunsetting

photo

Hi guys,
I need Your help in the Assembler becouse I don't know anything about this program and I need get answers for this questions:

Question 1
Because the RAM is 1024 words the size of the operand in the instructions must be 10 bit. Is it possible to encode all instructions into 16 bit? Justify your answer by defining a binary opcode system for this instruction set.

Question 2
An assembler language must include instructions for shifting – both left and right. Define such operations in the same way as above. In case it is possible, extend your answer to question 1 to include these shift operations.

Question 3
Define a logical operation for exclusive or (xor). Write a fragment of assembler instructions that swap the content of REG and a word in memory. Can you do it such that the fragment is not using a temporary word?

Question 4
In this “machine” code and data are allocated in the same memory. It means that you could write some code that changes itself. How? Is this a good idea?

Question 5
Write programs in the above defined assembler language that

a) Read two numbers and output the sum of them
b) Read two numbers and output the greatest of them
c) Read two numbers and output them sorted.
d) Read a sequence of numbers (end with a zero) and output the sum of them
e) Read a sequence of numbers (end with a zero) and output the greatest of them
f) Read a number and out 1 if the number is a prime.
g) Read two numbers and output the greatest common divisor.

You may use labels and comments as illustrated in the following assembler program that is an answer to a) above.

Read x
Load x ; REG = x
Read x ; x = 2nd input
Add x ;
Store x
Write x
Exit
x:0

Thank You so much in advise
Regards


Mate, is this part of recrutation process that you are looking for someone to hire. Or it's rather your university credit and you want somebody to done it for you...

BTW. Twoja nazwa uzytkownika brzmi raczej jakbys byl Polakiem, po co angielski?
dzieki za odpowiedz. jestem polakiem ale jestem na erasmusie za granica i umiescilem to na kliku rowniez obco jezycznych forach, wiec wiesz dla mnie latwiej
To jest ARM? Bo napewno to jest RISC.
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • kazimierz.htw.pl