Using ARM assembly Language: Problem Statement: For this project, assume that so
ID: 3763294 • Letter: U
Question
Using ARM assembly Language:
Problem Statement: For this project, assume that some other procedure has read 8 temperature values from an A/D converter to a half-word array named Temp BCD in memory. The temperature values arc in BCD form. For example, a temperature of 125 degrees Fahrenheit would be stored as 0000 0001 0010 0101. Temperature values range from 0 -125 degrees Fahrenheit. Your task is to write a mainline that: Initializes registers as needed. Calls and passes parameters as needed to a procedure that converts the 8 BCD values to their binary equivalents and puts the results in order in an array called Temp BIN After return from the procedure, the mainline calculates the rounded average of the 8 binary temperature values and writes the average value to memory location named Temp Av.Explanation / Answer
DATA SEGMENT BCD DW 1234H TEMP DB ? RES DB 17 DUP ('$') DATA ENDS CODE SEGMENT ASSUME DS:DATA,CS:CODE START: MOV AX,DATA MOV DS,AX MOV AX,BCD MOV BL,AL MOV AX,BCD MOV AL,AH MOV AH,0 MOV BL,AL AND AL,0F0H AND BL,0FH MOV CL,04H ROL AL,CL MOV CL,10 MUL CL ADD AL,BL MOV CL,100 MUL CL MOV BL,TEMP MOV BH,0 ADD AX,BX LEA SI,RES CALL HEX2BIN LEA DX,RES MOV AH,9 INT 21H MOV AH,4CH INT 21H CODE ENDS HEX2BIN PROC NEAR MOV CX,0 MOV BX,2 LOOP1: MOV DX,0 DIV BX ADD DL,30H PUSH DX INC CX CMP AX,1 JG LOOP1 ADD AL,30H MOV [SI],AL END START
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.