Advertisement

汇编语言的简单入门:循环与输出和输入

阅读量:

该程序的功能是生成13个位于0到100之间的随机数值,并将其存入数组中,随后进行顺序反转操作,最终将结果输出。

复制代码
    <p>TITLE Write a program</p><p>INCLUDE Irvine32.inc
    .data</p><p>ARRAY_SIZE = 13
    RAND_MAX = 100
    HALF_ARRAY_SIZE = ARRAY_SIZE/2
    rands DWORD ARRAY_SIZE dup(0)</p><p> 
    .code
    main PROC</p><p>mov esi,offset rands                     ;address to the rands
    mov ecx,lengthof rands                   ;calculate the size of array
    L1:
     mov eax,RAND_MAX                     ;for random the maxinum number
     call RandomRange         ;call this function
     mov [esi],eax                   ;set the element tha

全部评论 (0)

还没有任何评论哟~