【发布时间】:2020-12-02 18:12:43
【问题描述】:
我正在尝试将值添加到数组中,而不是进行平均。 但我注意到,当我求和时,数组中的值没有通过 256。
SECTION .data ;data section
array: db 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
SIZE EQU 20
;sum all positions of vector, length of 20
SECTION .text ;code section
global _start
_start:
xor bl,bl
xor ecx,ecx
jmp for_cond
for_body:
mov al,[array+ECX]
add bl,al
inc ecx
for_cond:
cmp ecx,SIZE
jl for_body
mov eax,1 ; exit command to kernel
int 0x80 ; interrupt 80 hex, call kernel
【问题讨论】: