Assembler Answers

Questions answered by Experts: 209

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

(a) Assemble the following instructions and show the changes in given Accumulator register and flags after each instruction execution.

MOV AL, 8Bh ; CF = ?, SF = ?, PF = ?, ZF = ?

ADD AL, 22h ; CF = ?, SF = ?, PF = ?, ZF = ?

AND Al, 1000101b ; CF = ?, SF = ?, PF = ?, ZF = ?

OR Al, 9Ah ; CF = ?, SF = ?, PF = ?, ZF = ?

XOR AL, 10101011b ; CF = ?, SF = ?, PF = ?, ZF = ?

TEST AL, 2 ; CF = ?, SF = ?, PF = ?, ZF = ?

CMP AL, 58 ; CF = ?, SF = ?, PF = ?, ZF = ?

ADC AL, 11110000b ; CF = ?, SF = ?, PF = ?, ZF = ?

SHR AL,2 ; CF = ?, SF = ?, PF = ?, ZF = ?
--------------------------------------------------------------------------------------------
b)
Write a subroutine that can calculate the sum of an array and also save the result into DX.
( Array’s length is 20)
------------------------------------------------------------------------------------------
Consider the following AVR Assembly Language Code which is passed through an assembler.

.include "m64def.inc"
jmp RESET
jmp HANDLER_1

.dseg
var1: .BYTE 1
var2: .BYTE 3


.cseg
const: .DB 0xAA, 0xCC
.org 0x20
reset:
ldi ZL, low(var1)
ldi ZH, high(var1)
ldi r17, 0xBB
st Z, r17
ldi ZL, low(const<<1)
ldi ZH, high(const<<1)
lpm
.dseg
var3: .BYTE 4
.cseg
mainloop:
ldi r20, 0xF0
...

Determine the segments and values of each of the following symbols. (Enter the segment as either "cseg" or "dseg" - without the quotes. Enter the values as decimal integers.).
Symbol Segment Value
var1
var3
reset
const
mainloop
(This is a table - fill it in)
Hi , I wrote this assembly code in TASM but when "CL=11" output is "0;" .
What is wrong in this code??? (And sorry for my bad english (((((-: )

MOV AL,CL
MOV AH,0
I DB 10
DIV I
MOV BL,AL
MOV BH,AH
ADD BL,48
ADD BH,48
MOV AH,02
MOV DL,BH
INT 21H
MOV DL,BL
INT 21H
Let us assume that a program takes 400 seconds of elapsed time to execute. Out of these 400 seconds, 320 seconds is the CPU time and the rest is I/O time. What percentage of elapsed time is spent on I/O operations?
Let us have a 20MIPS processor, you have to calculate the percentage of time it spends in busy wait loop of a 75-character line printer, when it takes 2 msec to print a character and a total of 665 instructions require to be executed to print a 75 character line.

Suppose that two instructions are executed in the polling loop.
hi i am a beginners in mips and we're given a homework to convert binary string into decimal
Objective: Introduce student to MIPS programming and the use of MIPS operations.

Weight: This assessment will be worth 3% of the whole course.

Due Date: April 16th 2011.

Main Task: Design and Implement a MIPS program that will convert a binary string into decimal.

Criteria

1. Prompt user to input a binary string of no more that 8 bits.- 10 pts
2. Verify if user input was all binary.(Prompt again if entry was wrong) - 30pts
3. Should contain at least 1 function. -10 pts
4. Should be commented to explain purpose of instructions. -10 pts
5. Calculate and display the correct answer for the user. - 40 pts


this is my code and i am so confused i really need help pls tell me what to do step by step because this is very hard for me as a beginner

.text
.align 2

# Let X be a binary number, n digits in length, compose of bits X n-1
#Let D be a decimal number
#Let i be a counter


main: li $v0, 4 #code for print string
la $a0, prompt #load address of prompt into $a0
syscall #print the prompt message

la $t3, True
lw $t5, 0($t3)
la $t3,False
lw $t6, 0($t3)
li $v0, 8 #code for read strings
la $a0, binary #addr of buffer (binary)
li $a1, 9 #size of buffer (1 byte)
syscall #

lw $t4, 0($a0)
lw $t6, 4($a0)
lw $t7, 8($a0)
lw $t8, 12($a0)
lw $t9, 16($a0)





Loop: beg $t4, $t5, convert





convert:





.data

prompt: .asciiz "Please Input a Binary String \n"
Hi. Can you do MIPS programming assignment?

Thanks
JC
Suppose that a certain program takes 500 seconds of elapsed time to execute. Out of these 500 seconds, 280 seconds is the CPU time and the rest is I/O time. What will be the I/O time?
What percentage of time will a 20 MIPS processor spend in the busy wait loop of 65-character line printer when it takes 3 m-sec to print a character and a total of 457 instructions need to be executed to print 65 character lines? Assume that 4 instructions are executed in the polling loop?
LATEST TUTORIALS
APPROVED BY CLIENTS