com
NEW!
Textbook Solutions Expert Q&A Practice Search
home / study / engineering / electrical engineering / electrical engineering questions and answers / show me to write 55 binary to the screen then…
Question: Show me to write 55 binary to the screen then write 32 in hex… Post a question
Answers from our experts for your tou
homework questions
Enter question
Continue to post
20 questions remaining
My Textbook Solutions
Engineering Eng
Mechanics Me
Electrical Engineering C
tutors who can help rig
now
Andre A.
University of OXFORD
Garima G.
University of Delhi
Shivakumar K.
Srinidhi Institute of …
Show me to write
55 binary to the screen then write 32 in hex to the screen and 20 in octal to the screen which on of these as you move things
into the eax have at the end write 50 out as done above store what 55 is in binary using a radix and store it into eax then take
32 store it as a hex number right into the screen finally take 20 store it in as an octal number into eax and write it to the screen
Find me a tutor
Show transcribed image text
Expert Answer
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
LEA SI,STR1
MOV AX,NO
MOV BH,00
MOV BL,2
L1:DIV BL
https://www.chegg.com/homework-help/questions-and-answers/show-write-55-binary-screen-write-32-hex-screen-20-octal-screen-move-things-e… 1/8
9/2/2019 Show Me To Write 55 Binary To The Screen Then Writ... | Chegg.com
L1:DIV BL
ADD AH,'0'
NEW!
MOV BYTE PTR[SI],AH Textbook Solutions Expert Q&A Practice Search
MOV AH,00
INC SI
INC BH
CMP AL,00
JNE L1
MOV CL,BH
LEA SI,STR1
LEA DI,STR2
MOV CH,00
ADD SI,CX
DEC SI
DIS LINE
DIS MSG2
DIS STR2
MOV AH,4CH
INT 21H
CODE ENDS
END START
;------
;OUTPUT
;------
Code for Program to Convert Decimal number to Hexadecimal number in Assembly Language
int 21h
endm
data segment
buf4 db 6
db 0
db 6 dup(0)
multiplier db 0ah
data ends
code segment
start :
mov ds, ax
mov es, ax
prnstr buf1
int 21h
subtract :
https://www.chegg.com/homework-help/questions-and-answers/show-write-55-binary-screen-write-32-hex-screen-20-octal-screen-move-things-e… 2/8
9/2/2019 Show Me To Write 55 Binary To The Screen Then Writ... | Chegg.com
prnstr buf2
jmp stop
cont1 :
jb cont2
prnstr buf2
jmp stop
cont2 :
inc si
loop subtract
calc :
mul multiplier
add ax, bx
inc si
loop calc
mov bx, ax
convert :
conv :
cmp bx, ax
jb cont3
sub bx, ax
inc cx
jmp conv
cont3 :
jb cont4
jmp cont5
cont4 :
cont5 :
inc si
div cx
https://www.chegg.com/homework-help/questions-and-answers/show-write-55-binary-screen-write-32-hex-screen-20-octal-screen-move-things-e… 3/8
9/2/2019 Show Me To Write 55 Binary To The Screen Then Writ... | Chegg.com
prnstr buf3
prnstr buf4+2
stop :
int 21h
code ends
end start
Code for Program to Convert Decimal number to Octal number in Assembly Language
int 21h
endm
data segment
buf4 db 6
db 0
db 6 dup(0)
multiplier db 0ah
data ends
code segment
start :
mov ds, ax
mov es, ax
prnstr buf1
int 21h
subtract :
jnb cont1
prnstr buf2
jmp stop
cont1 :
jb cont2
prnstr buf2
jmp stop
https://www.chegg.com/homework-help/questions-and-answers/show-write-55-binary-screen-write-32-hex-screen-20-octal-screen-move-things-e… 4/8
9/2/2019 Show Me To Write 55 Binary To The Screen Then Writ... | Chegg.com
cont2 :
NEW!
Textbook Solutions Expert Q&A Practice Search
sub al, 30h
inc si
loop subtract
calc :
mul multiplier
add ax, bx
inc si
loop calc
mov bx, ax
convert :
conv :
cmp bx, ax
jb cont3
sub bx, ax
inc cx
jmp conv
cont3 :
inc si
div cx
jnz convert
prnstr buf3
prnstr buf4+2
stop :
int 21h
code ends
end start
.model small
.386
.stack 100h
.data
https://www.chegg.com/homework-help/questions-and-answers/show-write-55-binary-screen-write-32-hex-screen-20-octal-screen-move-things-e… 5/8
9/2/2019 Show Me To Write 55 Binary To The Screen Then Writ... | Chegg.com
.code
NEW!
Textbook Solutions Expert Q&A Practice Search
decimal proc near
xor eax,eax
xor ebx,ebx
mov cx,2 ;this is to accept the base and the decimal value
newchar:
cmp cx,0
jle startConvert
dec cx
sub al,30h
cmp al,9h
stloop:
mov ah,2
mov dl,0ah
mov dl,0dh
int 21h
startConvert: pop bx
;push bx
push cx
push dx
;mov bx,10 ;base 10 conversion THIS IS THE LINE TO CHANGE FOR DIFFERENT BASES!!!!
nonzero:
https://www.chegg.com/homework-help/questions-and-answers/show-write-55-binary-screen-write-32-hex-screen-20-octal-screen-move-things-e… 6/8
9/2/2019 Show Me To Write 55 Binary To The Screen Then Writ... | Chegg.com
div bx
NEW!
Textbook Solutions Expert Q&A Practice Search
push dx ;this is the remainder of the divider
write:
add dl,'0' ;ascii value of 30h THIS ALSO NEEDS TO CHANGES FOR DIFFERENT BASES!!!
mov ah,2
int 21h
loop write ;loops number of times in cx, which is the number of digits
pop dx
pop cx
pop bx
pop ax
ret
decimal endp
end decimal
Comment
ABOUT CHEGG
CHEGG NETWORK
CUSTOMER SERVICE
https://www.chegg.com/homework-help/questions-and-answers/show-write-55-binary-screen-write-32-hex-screen-20-octal-screen-move-things-e… 7/8
9/2/2019 Show Me To Write 55 Binary To The Screen Then Writ... | Chegg.com
NEW!
Textbook Solutions Expert Q&A Practice Search
https://www.chegg.com/homework-help/questions-and-answers/show-write-55-binary-screen-write-32-hex-screen-20-octal-screen-move-things-e… 8/8