【问题标题】:Printing out value of array of numbers-Assembly打印出数字数组的值-Assembly
【发布时间】:2011-05-05 23:04:57
【问题描述】:

好的,我有这个代码

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

我很确定它可以工作,我只需要知道如何修改它以显示值。

【问题讨论】:

  • 这是一个冒泡排序。你想打印出你已经排序的数组吗?
  • 我们不是来为您解决任务的。尝试解决它,如果您在尝试使其正常工作时遇到困难,请在此处寻求帮助。

标签: assembly masm x86-16


【解决方案1】:

我想您想将数字转换为 ASCII 吗?我已经在另一个答案中回答了:

Converting an ascii character into decimal in Assembly for use with WriteConsoleA and readConsoleA

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-09
    • 1970-01-01
    • 1970-01-01
    • 2021-12-23
    相关资源
    最近更新 更多