ورود

View Full Version : سوال: کمک در مورد تحلیل این برنامه (فوری)



bermoda_khatar69
پنج شنبه 16 خرداد 1392, 23:32 عصر
سلام

این برنامه یک عدد ثابت رو در مبنای 10 به منبای 16 تبدیل می کنه ولی مشکل من با دستور xlat به کار رفته در این برنامه هست کسی هست کمک کنه بگه این دستور اینجا چه کاری می کنه اصلا کسی هست بگه دستور xlat وظیفش چیه

ممنون می شم کمکم کنید دو روز دیگه امتحان دارم توی وظیفه این دستور موندم

.model small
.stack 64h
.data
buffer db "0123456789abcdef"
num dw 2579d
str db 16 dup(0)

.code
main proc
mov ax,@data
mov ds,ax

mov ax,num
mov si,0
mov bx,16

next1:

mov dx,0
div bx
xchg dx,ax
push bx
lea bx,buffer
xlat
mov str[si],al
xchg dx,ax
pop bx
inc si
cmp ax,0
jne next1
mov cx,si
next2:

dec si
mov dl,str[si]
mov ah,02h
int 21h
loop next2
mov ah,4ch
int 21h
main endp
end main

topcoder
شنبه 18 خرداد 1392, 18:12 عصر
Xlat یا Xlatb
یک مقدار رو از یک سیستم کدینگ به یک سیستم دیگه میبره ( با توجه به چیزی که باید تبدیل بشه که یک جدول در حافظه هست )
قبل این دستور باید Bx به جدول حافظه باید اشاره کنه
Al هم مقداری که با توجه به جدول میبایست تبدیل بشه است
بعد از دستور هم Al کدینگ جدید شماست
Translates a value from one coding system to another by looking up the value to
be translated in a table stored in memory. Before the instruction is executed, BX
should point to a table in memory and AL should contain the unsigned position
of the value to be translated from the table. After the instruction, AL contains
the table value at the specified position. No operand is required, but one can be
given to specify a segment override. DS is assumed unless a segment override is
given. XLATB is a synonym for XLAT. Either version allows an operand, but
neither requires one.

zerounderline
یک شنبه 19 خرداد 1392, 09:33 صبح
با سلام نمیدونم دقیقا کجاش نفهمیدی ولی این برنامه یک عدد رو از مبنای 10 به مبنای 16 تبدیل میکن