Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You are required to write an assembler program using loops and procedures to get

ID: 3850670 • Letter: Y

Question

You are required to write an assembler program using loops and procedures to get a temperature value from the user and convert it to either Centigrade or Fahrenheit, depending on the user's selection, (i.e. your program should prompt a user for a value and then for a conversion factor C/F). Your program should have the conversion routines written as a procedure that can be called when you have a value to convert. in addition, you need an output function to print the answers to the screen. You can use either Massage Box or Console output. Fahrenheit to Centigrade (Fahrenheit - 32) X 5/9

Explanation / Answer

DATA SEGMENT T DB ? RES DB 10 DUP ('$') MSG1 DB "ENTER TEMPERATURE IN CELSIUS (ONLY IN 2 DIGITS) : $" MSG2 DB 10,13,"CONVERTED IS FAHRENHEIT (TEMPERATURE) : $" DATA ENDS CODE SEGMENT ASSUME DS:DATA,CS:CODE START: MOV AX,DATA MOV DS,AX LEA DX,MSG1 MOV AH,9 INT 21H MOV AH,1 INT 21H SUB AL,30H MOV AH,0 MOV BL,10 MUL BL MOV BL,AL MOV AH,1 INT 21H SUB AL,30H MOV AH,0 ADD AL,BL MOV T,AL MOV DL,9 MUL DL MOV BL,5 DIV BL MOV AH,0 ADD AL,32 LEA SI,RES CALL HEX2DEC LEA DX,MSG2 MOV AH,9 INT 21H LEA DX,RES MOV AH,9 INT 21H MOV AH,4CH INT 21H CODE ENDS HEX2DEC PROC NEAR MOV CX,0 MOV BX,10 LOOP1: MOV DX,0 DIV BX ADD DL,30H PUSH DX INC CX CMP AX,9 JG LOOP1 ADD AL,30H MOV [SI],AL LOOP2: POP AX INC SI MOV [SI],AL LOOP LOOP2 RET HEX2DEC ENDP END START

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote