Kavkaz86 0 Newbie Poster

Write an 8086 assembly language program that will read a single byte arbitrary hex value
declared in the data section of the code, convert this value into decimal, display it on the
screen and then exit back to DOS. For example, if the value defined in your data section is:

Val DB 0FFh

Then your code should produce as output:
255

N.B. You can use the DOS write string interrupt service to facilitate display of the converted
value. For example, the following code fragment will display the “$” terminated string
pointed to by the label ‘Str’ at the current cursor position:

mov DX, offset Str ; Set DX to point to address of first ASCII char in string
mov AH, 09h ; Select DOS ASCII string writing service
int 21h ; Call DOS - Write the string

For example if ‘Str’ is defined as:
Str DB “Hello World”, “$”

The above code fragment will output:
Hello World

Could someone shed some light over this matter? Thank you so much

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.