在表TABLE处存放着N个无符号字节数求表中前10个字节数的总和并保存在AX寄存器 中。如果总和值超过AX寄存器的容量则置AX寄存器内容不变。请编写一段汇编程序
assume cs:code data segment table db 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 n equ 20 data ends code segment start: mov ax, 0 mov bx, 0 mov cx, 10 mov si, offset table loop_start: mov bl, byte ptr [si] add ax, bx inc si dec cx jnz loop_start cmp ax, 255 jbe exit mov ax, 0 exit: mov ah, 4ch int 21h code ends end start
原文地址: https://www.cveoy.top/t/topic/fdxn 著作权归作者所有。请勿转载和采集!