;就是一个串str1, lea ebx, str1 然后我们ebx+1总是加上的是一个字节, 无论(串是word, byte, dword) .386 .model flat .stack 4096 include io.h ExitProcess proto near32 stdcall, deE

简介:

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

目录
相关文章
|
4月前
|
Go
Go string bytes、strings、strconv和unicode包相关方法
Go string bytes、strings、strconv和unicode包相关方法
26 0
|
9月前
|
C++
C++ --- error C2664: “LoadLibraryW”: 不能将参数 1 从“const char *”转换为“LPCWSTR”
C++ --- error C2664: “LoadLibraryW”: 不能将参数 1 从“const char *”转换为“LPCWSTR”
184 0
|
关系型数据库 PostgreSQL
PostgreSQL 计算字符串字符数函数(CHAR_LENGTH(str))和字符串长度函数(LENGTH(str))
PostgreSQL 计算字符串字符数函数(CHAR_LENGTH(str))和字符串长度函数(LENGTH(str))
1177 0
|
1月前
|
C++
无法将参数1从“const char [6]”转换为“char *”的解决方法
无法将参数1从“const char [6]”转换为“char *”的解决方法
|
4月前
从接口获取获取到数组arr=[‘1‘,‘a‘,‘2‘,‘b‘,‘3‘,‘c‘]转换成{number:‘123’,char:‘abc’}
从接口获取获取到数组arr=[‘1‘,‘a‘,‘2‘,‘b‘,‘3‘,‘c‘]转换成{number:‘123’,char:‘abc’}
|
6月前
|
存储
将hex printf输出存储到变量
将hex printf输出存储到变量
|
7月前
|
物联网
CF1506C Double-ended Strings(差不多就是找最长串问题)
CF1506C Double-ended Strings(差不多就是找最长串问题)
23 0
|
11月前
|
Python
Python 数值类型方法|内建函数的对比汇总 (int bool float complex bytes str)
Python 数值类型方法|内建函数的对比汇总 (int bool float complex bytes str)
87 0
error C2664: “StrCmpW”: 不能将参数 2 从“const char [12]”转换为“PCWSTR”
error C2664: “StrCmpW”: 不能将参数 2 从“const char [12]”转换为“PCWSTR”
95 0
|
Go C语言 C++
Go语言中的数组和切片 len cap append copy
Go语言中的数组和切片 len cap append copy
Go语言中的数组和切片 len cap append copy