add128: push ax
push cx
push si
push di
sub ax, ax ;将CF设置为0
s: mov ax, [si]
adc ax, [di]
mov [si], ax
inc si
inc si
inc di
inc di
loop s
pop di
pop si
pop cx
pop ax
ret
assume cs:codesg
datasg segment
db "Beginner's All-purpose Symbolic Instruction Code.",0
datasg ends
stack segment
db 16 dup(0)
stack ends
codesg segment
begin:
mov ax,stack
mov ss,ax
mov sp,16
mov ax,datasg
mov ds,ax
mov si,0
call letterc
mov ax,4c00h
int 21h
letterc:
pushf
push cx
push si
s:
mov ch,0
mov cl,ds:[si]
jcxz exit
cmp byte ptr ds:[si],61h
jb next_char
cmp byte ptr ds:[si],7Ah
ja next_char
and byte ptr ds:[si],11011111B
next_char:
inc si
jmp short s
exit:
pop si
pop cx
popf
ret
codesg ends
end begin