xlat指令...

 1 ;就是一个串str1, lea ebx, str1 然后我们ebx+1总是加上的是一个字节, 无论(串是word, byte, dword)
 2 .386
 3 .model flat
 4 .stack 4096
 5 include io.h
 6 ExitProcess proto near32 stdcall, deExitCode:dword
 7 cr equ 0dh
 8 lf equ 0ah
 9 .data
10 str1 byte 20 dup(?)
11 stringss byte "请输入一个数字并求其平方:",  cr, lf 
12 table dword 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100
13 .code
14 _start:
15 output stringss
16 input str1, 20
17 atod str1
18 lea ebx, table
19 add eax, eax;如果是dword的串,那么我们读取的第n个数据的值,那么首地址加上的值(到达该值中间的字节数)就是n*sizeof(dword)=n*4
20 add eax, eax;
21 xlat
22 ;add eax, eax;模仿一下xlat的功能
23 ;mov ax, word ptr [ebx+eax]
24 dtoa str1, eax
25 output str1
26 invoke ExitProcess, 0
27 public _start
28 end

 

posted @ 2014-06-24 23:04  hjzqyx  阅读(2939)  评论(0编辑  收藏  举报