打印数字数组的值-汇编
好吧,我有这段代码,
SortScore PROC
call clrscr
mov ecx, LENGTHOF studentsAverage
dec ecx
L1: push ecx
mov esi, OFFSET studentsAverage
L2: mov eax,[esi]
cmp [esi+4],eax
jge L3 ;jump to L3 if greater
xchg eax,[esi+4] ;exchange values
mov [esi],eax ;
L3: add esi,4 ;move to next value
loop L2 ;go back to L2
pop ecx ;bring back the ecx
loop L1 ;go back to L1
L4: ret
我很确定它可以工作,我只需要知道如何修改它来显示值。
Alright so I have this code
SortScore PROC
call clrscr
mov ecx, LENGTHOF studentsAverage
dec ecx
L1: push ecx
mov esi, OFFSET studentsAverage
L2: mov eax,[esi]
cmp [esi+4],eax
jge L3 ;jump to L3 if greater
xchg eax,[esi+4] ;exchange values
mov [esi],eax ;
L3: add esi,4 ;move to next value
loop L2 ;go back to L2
pop ecx ;bring back the ecx
loop L1 ;go back to L1
L4: ret
I'm pretty sure it works, I just need to know how to modify it to display the values.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想你想从数字转换为 ASCII ?我在另一个答案中回复了这一点:
在汇编中将 ascii 字符转换为十进制,以便与 WriteConsoleA 和 readConsoleA 一起使用
I suppose that you want to convert from a number to ASCII ? I've replied that in another answer :
Converting an ascii character into decimal in Assembly for use with WriteConsoleA and readConsoleA