新手遇到的很弱的问题~~~就是解决不了

[复制链接]
查看11 | 回复3 | 2021-1-27 06:46:23 | 显示全部楼层 |阅读模式
就是输入一串字符~~然后想用数组的方法一个一个输出
但就是输不出来~~~有时只输出第一个字符
代码如下~~~大侠们看看
;Program:
;Author:
;Date:
.386
.MODELFLAT
ExitProcessPROTONEAR32stdcall,dwExitCode:DWORD
INCLUDEio.h;headerfileforinput/output
crEQU0dh;carriagereturncharacter
LfEQU0ah;linefeed
.STACK4096;reserve4096-bytestack
.DATA;reservestoragefordata
promBYTE"ENTERSOMETHING",cr,Lf,0
hhBYTEcr,Lf,0
stringINBYTE80DUP(?),0
reusltBYTE20DUP(?)

.CODE;startofmainprogramcode
_start:
outputprom
inputstringIN,80
forout:
movbl,BYTEPTR[ebx]
cmpbl,0
jenext
movreuslt,bl
outputreuslt
incebx
next:
INVOKEExitProcess,0;exitwithreturncode0
PUBLIC_start;makeentrypointpublic
END;endofsourcecode
分 -->
回复

使用道具 举报

千问 | 2021-1-27 06:46:23 | 显示全部楼层
不知道input和output宏是什么,贴出io.h中的input和output相关的代码看看.
没看到ebx赋初值,ebx初始值应该是stringIN的的初始地址,incebx后,应jmpforout,循环输出.
回复

使用道具 举报

千问 | 2021-1-27 06:46:23 | 显示全部楼层
input和output宏如下:
outputMACROstring,xtra;;displaystring
IFB
.ERR
EXITM
ENDIF
IFNB
.ERR
EXITM
ENDIF
pusheax;;saveEAX
leaeax,string;;stringaddress
pusheax;;stringparameteronstack
calloutproc;;calloutproc(string)
popeax;;restoreEAX
ENDM
inputMACROdest,length,xtra;;readstringfromkeyboard
IFB
.ERR
EXITM
ENDIF
IFNB
.ERR
EXITM
ENDIF
pushebx;;saveEBX
leaebx,dest;;destinationaddress
pushebx;;destparameteronstack
movebx,length;;lengthofbuffer
pushebx;;lengthparameteronstack
callinproc;;callinproc(dest,length)
popebx;;restoreEBX
ENDM
我把incebx后加上jmpforout问题还是存在!
回复

使用道具 举报

千问 | 2021-1-27 06:46:23 | 显示全部楼层
forout:后面加上leaebx,stringIN试试.
另外你虽然贴出了input,output的宏,但是里面又调用了outproc,inproc等,不知道是怎么实现的.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行