Assignment on Assembly language exam

Assembly language exam
Hello, in the attached file you can find the homework and PowerPoints slides,if you interested and know these topics please accept the assignment.the exam will be on 11/20 Friday 2-4pm ESTExam 3 Study GuideAssembly Language:The best way to review for this part is to1. Review the PowerPoints2. Review the examples we worked in class3. Review the HW assignments on assembly language

 

Don't use plagiarized sources. Get Your Custom Essay on
Assignment on Assembly language exam
Just from $10/Page
Order Essay

Assembly language

Please refer to slides and primer board lessons

  1. A system is designed to monitor the temperature of a furnace. Temperature readings are recorded in 16 bits and stored in memory locations starting at XX60H. The high-order byte is stored first and the low-order byte is stored in the next consecutive memory location. However, the high-order Byte of all the temperature readings is constant. Write a program to transfer the low-order readings to consecutive memory locations starting at XX80H and discard the high-order bytes. Temperature Readings (H) 0581, 0595, 0578, 057A, 0598.

 

LXI H, XX61H

LXI D, XX80H

MVI B, 00H

LOOP: MOV A, H

STAX D

INX H

INX H

INX D

INR B

MVI A, 05H

XRA B

JNZ LOOP

HLT

 

 

  1. The temperatures of two furnaces are being monitored by a microcomputer. A set of five readings of the first furnace, recorded by five thermal sensors, is stored at the memory location starting at XX50H. A corresponding set of five readings from the second furnace is stored at the memory location starting at XX60H. Each reading from the first set is expected to be higher than the corresponding reading from the second set. For example, the temperature reading at the location 54H (T54) is expected to be higher than the temperature reading at the location 64H (T64). Write a program to check whether each reading from the first set is higher than the corresponding reading from the second set. If all readings from the first set are higher than the corresponding readings from the second set, turn on the bit D0 of the output PORT1. If any one of the readings from the first set is lower than the corresponding reading of the second set, stop the process and output FF as an emergency signal to the output PORT1.

 

 

LXI H, XX50H

LXI D, XX60H

MVI B, 00H

LOOP1: MOV A, H

SUB D

JNC LOOP2

MVI A, FFH

OUT PORT1

JMP STOP

LOOP2: INR B

SUI B, 05H

JNZ LOOP1

MVI A, 01H

OUT PORT1

STOP: HLT

 

 

 

  1. Specify the contents of the accumulator and the status of the Cy flag when the following instructions are executed
    1. MVI A,B7H

ORA A

RLC

  1. MVI A,B7H

ORA A

RAL

 

a: After the first instruction the value of a will be B7H or 1011 0111. The second instruction will OR A to itself, so it will not change the value. RLC will first set the Cy flag to 0, then move the bits of A to the left. The bit shifted off of bit7 is put into the bit0 and the Cy flag. And so the value in A will be 6FH and the flag will be 1.

 

 

 

 

 

After RLC

Carry flag                                accumulator

0          <-         1011 0111

 

 

Carry flag                                accumulator

  • 0110 1111 or 6FH

 

 

b: After the first instruction the value of a will be B7H or 1011 0111. The second instruction will OR A to itself, so it will not change the value. RLC will first set the Cy flag to 0, then move the bits of A to the left. RAL will first set the Cy flag to 0, then move the bits of A to the left. The bit shifted off of bit7 is put into the Cy flag and the bit shifted off of Cy flag is put into bit0. And so the value in A will be 6EH and the flag will be 1.

 

Carry flag                                accumulator

0                      1011 0111

After RAL

Carry flag                                accumulator

0          <-         1011 0111

 

 

Carry flag                                accumulator

  • 0110 1110 or 6EH

 

 

 

  1. Calculate the decimal value of the number in the accumulator before and after the Rotate instructions are executed, and explain the mathematical functions performed by the instructions
    1. MVI A,18H

RLC

  1. MVI A,78H

RRC

RRC

 

 

a: 18H or 0001 1000 is assigned as the value of A. The second instruction will move the bits of the accumulator or A to the left. This is equivalent to multiplying the value by 2. Thus, the decimal value is 48.

 

 

b: 78H is assigned as the value of A. The next instructions will move the bits of A to the right. This is equivalent to halving the value of A. Since this is done twice, the instructions will be the same as finding the quarter of the value of A. Thus, the decimal value is 30.

 

0001 -> its value is 1

0010 -> its value will be 2

  1. Explain the mathematical function that is performed by the following instructions

MVI A,07H

RLC

MOV B,A

RLC

RLC

ADD B

 

 

The first RLC will double the value of A. Then it will be stored in B. RLC is then executed two times. So this is equal to doubling the double of the double of the value of A. This current value is then added with B or the double of A. Or in equation:

 

(2x(2x(2xA))) + (2xA)

 

Simplifying the equation, we get 10A. So the given instructions multiply A to 10.

 

 

  1. A set of eight readings is stored in memory starting at location XX50H. Write a program to check whether a byte of 40H exists in the set. If it does, stop checking and display its memory location; otherwise output FFH. DATA(H) 48, 32, F2, 38, 37, 40, 82, 8A

 

Read value from XX5XH, subtract 40H. if Z flag is 1, Display XX5XH. Otherwise OUT, FFH PORT 1

LXI H, XX50H

MVI B, 08H

MVI C, 50H

LOOP1: MOV A, H

XRA 40H

JNZ LOOP2

MOV A, C

OUT PORT1

JMP STOP

LOOP2: INX H

INR C

DCR B

JNZ LOOP1

MVI A, FFH

OUT PORT1

STOP: HALT

 

  1. The following program adds the number of bytes stored in memory locations starting from XX00H and saves the result in memory. Read the program and answer the questions given below

LXI H,XX00H       ;Set up HL as a data pointer

LXI D,0000H       ;set up D as a byte counter and E as a Carry register

NEXT: ADD M              ;Add byte

JNC SKIP             ;If the result has no carry, do not increment Carry register

INR E

SKIP: DCR D                 ;Update byte counter

JNZ NEXT            ;Go to the next byte

LXI H,XX90H

MOV M,A           ;Save the result

INX H

MOV M,E

HLT

  1. Assuming the byte counter is set up appropriately, specify the number of bytes that are added by the program.

 

The instruction JNZ NEXT will exit the loop when the carry flag is set. The instruction above it is DCR D, so it will exit when the result of DCR D is zero. The value of D started as 00H, and was decremented by 1 to FFH. So the total number of times the loop will repeat is the number it takes for 00H to go back to 00H when decremented by 1. This is equal to 256 times.

 

  1. Specify the memory locations where the result is stored.

 

The result is stored in the Location pointed by H before the instruction MOV M, A, which is XX90H

 

  1. Identify the two errors in this program.

 

MOV M, E should be done on when MOV M, A was called. This is to ensure that the high-order byte of the result, which is in the carry register is stored first before the low-order byte of the result, which is in the accumulator.

 

 

Assembly Language-part1

Please refer to slides and Primer boards lessons

  1. If the switch S7 of the input PORT0 connected to the data line D7 is at logic 1 and the other switches are at logic 0, specify the contents of the accumulator when the instruction IN PORT0 is executed.

MVI A,9FH

IN PORT0

MOV B,A

OUT PORT1

HLT

 

  1. Specify the output at PORT1 and the contents of the register B after executing the instructions in Problem #1.

 

  1. Specify the register contents and the flag status as the following instructions are executed.
  A C S Z CY
  XX XX 0 0 0
MVI A,5EH          
ADI A2H          
MOV C,A          

 

  1. Specify the register contents and the flag status as the following instructions are executed.
  A B S Z CY
  XX XX X X X
SUB A          
MOV B,A          
DCR B          
INR B          
SUI 01H          
  1. Write a program to
    1. clear the accumulator
    2. add 47H (use ADI instruction)
    3. subtract 92H
    4. add 64H
    5. display the results after subtracting 92H and after adding 64H

 

  1. Specify the register contents and the flag status as the following instructions are executed
  A B S Z CY
  XX XX 0 0 0
XRA A          
MVI B,4AH          
SUI 4FH          
ANA B          

 

 

  1. What is the output at PORT1 when the following instructions are executed?

MVI A,8FH

ADI 72H

JC DSPLAY

OUT PORT1

HLT

DSPLAY:  XRA A

OUT PORT1

HLT

 

Get professional assignment help cheaply

Are you busy and do not have time to handle your assignment? Are you scared that your paper will not make the grade? Do you have responsibilities that may hinder you from turning in your assignment on time? Are you tired and can barely handle your assignment? Are your grades inconsistent?

Whichever your reason may is, it is valid! You can get professional academic help from our service at affordable rates. We have a team of professional academic writers who can handle all your assignments.

Our essay writers are graduates with diplomas, bachelor, masters, Ph.D., and doctorate degrees in various subjects. The minimum requirement to be an essay writer with our essay writing service is to have a college diploma. When assigning your order, we match the paper subject with the area of specialization of the writer.

Why choose our academic writing service?

  • Plagiarism free papers
  • Timely delivery
  • Any deadline
  • Skilled, Experienced Native English Writers
  • Subject-relevant academic writer
  • Adherence to paper instructions
  • Ability to tackle bulk assignments
  • Reasonable prices
  • 24/7 Customer Support
  • Get superb grades consistently

 

 

 

 

 

 

Order a unique copy of this paper
(550 words)

Approximate price: $22

Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

We value our customers and so we ensure that what we do is 100% original..
With us you are guaranteed of quality work done by our qualified experts.Your information and everything that you do with us is kept completely confidential.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

The Product ordered is guaranteed to be original. Orders are checked by the most advanced anti-plagiarism software in the market to assure that the Product is 100% original. The Company has a zero tolerance policy for plagiarism.

Read more

Free-revision policy

The Free Revision policy is a courtesy service that the Company provides to help ensure Customer’s total satisfaction with the completed Order. To receive free revision the Company requires that the Customer provide the request within fourteen (14) days from the first completion date and within a period of thirty (30) days for dissertations.

Read more

Privacy policy

The Company is committed to protect the privacy of the Customer and it will never resell or share any of Customer’s personal information, including credit card data, with any third party. All the online transactions are processed through the secure and reliable online payment systems.

Read more

Fair-cooperation guarantee

By placing an order with us, you agree to the service we provide. We will endear to do all that it takes to deliver a comprehensive paper as per your requirements. We also count on your cooperation to ensure that we deliver on this mandate.

Read more

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Open chat
1
You can contact our live agent via WhatsApp! Via +1 817 953 0426

Feel free to ask questions, clarifications, or discounts available when placing an order.

Order your essay today and save 20% with the discount code VICTORY