Convert unsigned decimal 60293 to a hexadecimal value. 1656 いr6u293

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 8RQ
icon
Related questions
Question
Assembly Programming question: Convert unsigned decimal 60293 to a hexadecimal value
4. Convert unsigned decimal 60293 to a hexadecimal value.
3 -R
いrou293
example, let's add the hexadecimal values 6A2 and 49A. In the lowest digit position, 2 + A = decimal 12, so there is no carry and we use C to indicate the hexadecimal sum digit. In the next
16 6
ding Hexadecimal
tion. A + 9 = decimal 10
JOn 16-3 and carry a 1 into the third digit position. Finally, we add 1 +6+ 4 = decimal 11
Transcribed Image Text:4. Convert unsigned decimal 60293 to a hexadecimal value. 3 -R いrou293 example, let's add the hexadecimal values 6A2 and 49A. In the lowest digit position, 2 + A = decimal 12, so there is no carry and we use C to indicate the hexadecimal sum digit. In the next 16 6 ding Hexadecimal tion. A + 9 = decimal 10 JOn 16-3 and carry a 1 into the third digit position. Finally, we add 1 +6+ 4 = decimal 11
Expert Solution
Step 1

Assembly code to convert decimal 60293 to hexadecimal:

 


 .MODEL SMALL
 .STACK 100H
 .DATA
  d1 dw 60293
 .CODE
  MAIN PROC FAR
   MOV AX,
 @DATA
  MOV DS,
 AX

in variable d1
 mov ax,
 d1

print the value
 CALL PRINT

 MOV AH,
 4CH INT 21H

 MAIN ENDP
  PRINT PROC

 mov cx,
 0 mov dx, 0 label1:
 ax is zero
  cmp ax,
  0 je print1

 div bx
 push dx
 inc cx

 xor dx,
 dx
  jmp label1
   print1:

 cmp cx,
 0 je exit

 pop dx

value is greater than 9
 add dx,
 7

 continue:

 add dx,
 48

character
 mov ah,
 02h int 21h

 dec cx
  jmp print1
   exit : ret
     PRINT ENDP
      END MAIN

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT