NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: Andy on March 02, 2012, 12:27:35 PM

Title: How it works XLAT
Post by: Andy on March 02, 2012, 12:27:35 PM
I tried to understand how it works XLAT instruction and I wrote this short code for test:
Code: [Select]
mov bx,Table
mov al,4
xlat
mov dl,al
mov ah,2
int 21h

mov ah,4Ch
int 21h

Table db '0123456789'

The compilations works fine but the result is not what I really expect. If I understood well, XLAT should put in al the ascii value of 4, this mean 34h. So I expect to be write to STDOUT the character of 34h but I still get this:
http://solidfiles.com/d/8c8aa1ca3d

Where is my wrong?
Title: Re: How it works XLAT
Post by: Frank Kotler on March 02, 2012, 02:29:51 PM
Assembling this as a .com file?

Code: [Select]
org 100h  ; tell Nasm where dos will load us

See if that helps.

Best,
Frank

Title: Re: How it works XLAT
Post by: Andy on March 02, 2012, 07:01:10 PM
Yeah, that works. Thank you!