flat assembler
Message board for the users of flat assembler.

Index > DOS > Is "xlat" command invalid operand???

Author
Thread Post new topic Reply to topic
DarkLight



Joined: 21 Feb 2009
Posts: 10
Location: Armenia
DarkLight
Here is code:
Code:
format MZ
entry code_seg:start; set entry point
stack 256
segment data_seg
; add your data here!
message db "Input two hexadecimal digits,$"
tabl db 48 dup (0),0,1,2,3,4,5,6,7,8,9,7 dup (0)
     db 0ah,0bh,0ch,0dh,0eh,0fh,26 dup (0)
     db 0ah,0bh,0ch,0dh,0eh,0fh,152 dup (0)
segment code_seg
start:
; set segment registers:
mov ax,data_seg
mov ds,ax
mov es,ax
; add your code here
lea bx,[tabl]
mov ah,9
mov dx,message
int 21h
xor ax,ax
mov ah,1h
int 21h
xlat
mov dl,al
shl dl,4
int 21h
xlat
add al,dl
mov ax,4c00h
int 21h    

And here is a compilaton "result"

Code:
aram@linux-39o6:~/Documents> fasm PRG_7_3-DOS.asm
flat assembler  version 1.67.33  (16384 kilobytes memory)
PRG_7_3-DOS.asm [24]:
xlat
error: invalid operand.    

When i replace the command "xlat" to "xlatb" then all OK... Why???[/code]
Post 21 Feb 2009, 16:20
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17716
Location: In your JS exploiting you and your system
revolution
Have you seen this?
Flat assembler Programmer's Manual wrote:
xlat replaces a byte in the AL register with a byte indexed by its value in a translation table addressed by BX or EBX. The operand should be a byte memory addressed by BX or EBX with any segment prefix. This instruction has also a short form xlatb which has no operands and uses the BX or EBX address in the segment selected by DS depending on the current code setting
Post 21 Feb 2009, 16:29
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.