Explain XLAT instruction with help of example, Computer Engineering

Assignment Help:

Q. Explain XLAT instruction with help of example?

Let's presume a table of hexadecimal characters signifying all 16 hexadecimal digits in table:

HEXA      DB      '0123456789ABCDEF'

760_Explain XLAT instruction with help of example.png

The table comprises the ASCII code of every hexadecimal digit:

(All value in hexadecimal)

If we place 0Ah in AL with the thought of converting it to ASCII we have to set BX to offset of HEXA and invoke XLAT.  You need not specify table name with XLAT hence it is implicitly passed by setting BX to HEXA table offset. This instruction would do the subsequent operations:

It will first add AL to BX producing an effective address which points to eleventh entry in the HEXA table.

Content of this entry is now moved to AL register which means 41h is moved to AL. 

Or we can say in other words, XLAT sets AL to 41h since this value is located at HEXA table offset 0Ah. Please consider that 41h is the ASCII code for hex digit A. The subsequent sequence of instructions will accomplish this:

MOV AL, 0Ah    ; index value

MOV BX, OFFSET HEXA; offset of the table HEXA

XLAT     

The above tasks can be executed without XLAT instruction however it will need a long series of instructions like:

MOV AL, 0Ah                                   ; index value

MOV   BX, OFFSET HEXA             ; offset of the table HEXA

PUSH BX                                           ; save the offset

ADD BL, AL                                     ; add index value to table

                                                                        ; HEXA offset

MOV   AL, [BX]                                ; retrieve the entry

POP    BX                                           ; restore BX


Related Discussions:- Explain XLAT instruction with help of example

Perform binary subtraction on following, Q Perform Binary Subtraction on fo...

Q Perform Binary Subtraction on following: 1) 1101-1000 2) 111.11-101.1 3) 1101.1-1010.01 Q Perform Binary Multiplication & Division on following: 1) 16*2.75 2) 1

Explain internal organization of bit cells in a memory chip, Explain with n...

Explain with neat diagram the internal organization of bit cells in a memory chip. Memory cells are usually organized in the form of an array, in which every cell is capable of

C, "Super ASCII", if it contains the character frequency equal to their asc...

"Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the ascii values will starts from

Explain the potential role of information technology, Question 1: Descr...

Question 1: Describe the five maturity levels of KM that an organization faces when adopting the Frid's KM framework. Question 2: (a) Describe three major issues that

Define the concept of inheritance, Define the concept of Inheritance I...

Define the concept of Inheritance Inheritance is property of reusing the code within the object oriented development. While modelling, we look at the all the classes, and try

Implementation of 3 line to 8 line decoder, Implement the following functio...

Implement the following function using a 3 line to 8 line decoder. S (A,B,C) =   ∑ m(1,2,4,7) C (A,B,C) =  ∑ m ( 3,5,6,7)         Ans. Given function S (A,B,C) = m (1,2,4,7)

What happens if a function module runs in an update task, What happens if a...

What happens if a function module runs in an update task? The system performs the module processing asynchronously.  Instead of carrying out the call immediately, the system w

Explain a scheme of capability list to implement protection, Describe the s...

Describe the scheme of capability lists to implement protection? Capability lists (C- lists): These lists are utilized to make sure that uses only access files that are e

C, "Super ASCII", if it contains the character frequency equal to their asc...

"Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the ascii values will starts from

Differentiate between http and ftp, Differentiate between http and ftp. ...

Differentiate between http and ftp. HTTP and FTP were developed to make Internet transmission better. FTP is utilized to exchange files among computer accounts, to transfer

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd