Create one program that lets the user enter multiple digits  in base 10 and the program will display it in all basses  From base (2) to Base (36)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

 Create one program that lets the user enter multiple digits 
in base 10 and the program will display it in all basses 
From base (2) to Base (36).

; Author: DAVID PELED
;Multiple digits display
. model small
; The CPU alocates small memory for the program
.386
; For 32 bits assembly
.stack 100h
; 100(16) locations = 256(10)
.data
; For variables
by_x dd 2 ; 32 bits variable with an initial value of 10
stk_count db 0 ; 8 bits counter
.code
; write the code for the program
main proc
mov ax,@data ; set up data segment
mov ds, ax
LP1:
mov eax, 253 ; 253(10) 11111101
call dsp
inc by_x
mov dl, 2он
mov ah, 6
int 21h
стр bу_x, 41
js lp1
Transcribed Image Text:; Author: DAVID PELED ;Multiple digits display . model small ; The CPU alocates small memory for the program .386 ; For 32 bits assembly .stack 100h ; 100(16) locations = 256(10) .data ; For variables by_x dd 2 ; 32 bits variable with an initial value of 10 stk_count db 0 ; 8 bits counter .code ; write the code for the program main proc mov ax,@data ; set up data segment mov ds, ax LP1: mov eax, 253 ; 253(10) 11111101 call dsp inc by_x mov dl, 2он mov ah, 6 int 21h стр bу_x, 41 js lp1
mov ax, 4c00h ; END THE PROGRAM
int 21h
dsp proc
rpt:
; PUSH TO THE STACK
mov edx, 0
div by_x ; EAX/By_x
push dx
inc stk_count
; remainder push into the stack
СМР ЕАХ, Ө
jnz rpt
rpt2:
рop dx
cmp dl, 10
js short skip2
add dl, 7
; pop from the stack DX = DH + DL
skip2:
; make it ascii for display
add dl, 30h
mov ah, 6
int 21h
dec stk_count
jnz rpt2
ret
dsp endp
main endp
end main
Transcribed Image Text:mov ax, 4c00h ; END THE PROGRAM int 21h dsp proc rpt: ; PUSH TO THE STACK mov edx, 0 div by_x ; EAX/By_x push dx inc stk_count ; remainder push into the stack СМР ЕАХ, Ө jnz rpt rpt2: рop dx cmp dl, 10 js short skip2 add dl, 7 ; pop from the stack DX = DH + DL skip2: ; make it ascii for display add dl, 30h mov ah, 6 int 21h dec stk_count jnz rpt2 ret dsp endp main endp end main
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Control Structure
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.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education