flat assembler
Message board for the users of flat assembler.

Index > Main > help with the Replacement for XLAT

Author
Thread Post new topic Reply to topic
MAD_DËMON



Joined: 03 Mar 2006
Posts: 23
MAD_DËMON 20 May 2006, 17:59
The Last rev of AMD64 Volume1: App programming says:

Quote:

􀂄 XLAT—Translate Table Index
The XLAT instruction replaces the value stored in the AL
register with a table element. The initial value in AL serves as
an unsigned index into the table, and the start (base) of table is
specified by the DS:rBX registers (depending on the effective
address size).
This instruction is not recommended. The following instruction
serves to replace it:
MOV AL,[rBX + AL]


I try both "mov al,[bx+al]" and "mov [rbx+al]" but FASM gives me a syntax error

anyone can say me what is wrong?

_________________
Tah rah rah boom de ay, I blew some guy away, his brains turned into spray, I was paid well that day
Post 20 May 2006, 17:59
View user's profile Send private message Visit poster's website Reply with quote
r22



Joined: 27 Dec 2004
Posts: 805
r22 20 May 2006, 18:24
32bit XLAT
mov al, byte[ebx+eax]
64bit XLAT
mov al, byte[rbx+rax]

The problem with mov al,[rbx+al] is AL's a 8bit register so it doesn't match the memory addressing.

If you are ONLY using the AL part of RAX/EAX then you can use MOVZX instead of MOV. Using the ZX suffix is a sort of optimization for 64bit systems in much the same way is XOR reg,samereg is an optimization for zeroing the register.
Post 20 May 2006, 18:24
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
MAD_DËMON



Joined: 03 Mar 2006
Posts: 23
MAD_DËMON 20 May 2006, 18:39
well then it seems that the AMD documentation was wrong this time.. Sad
Post 20 May 2006, 18:39
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.