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

 

转载于:https://www.cnblogs.com/hujunzheng/p/3807126.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值