《汇编语言》问题10.1,我改写成了彩色字输出。
org 0100h
start@: ;指令区起始标签
mov ax,1
mov cx,3
s0:
add ax,ax
loop s0
add ax,48
mov bx,answer@
mov [bx],ax
call show@
jmp $
mov ax,4c00h
int 21h
show@:
mov ax,cs
mov ds,ax
mov bx,dataStart@
mov si,140h+30h
mov cx,32
s: mov dl,[bx]
mov dh,11001010b
mov ax,0b800h
mov ds,ax
mov [ds:si],dx
mov ax,cs
mov ds,ax
add bx,1
add si,2
loop s
ret
end@: ;指令区结束标签
dataStart@:
db 'The answer is : '
answer@:
db 100 dup (' ') ;数据临时存放区
dataEnd@:
阅读(777) | 评论(0) | 转发(0) |