- UID
- 70789
注册时间2010-11-1
阅读权限40
最后登录1970-1-1
独步武林
 
该用户从未签到
|
发表于 2010-12-21 14:55:06
|
显示全部楼层
assume cs:code ,ds:data,ss:stack
data segment
a db 'Hello,Nisy!',0
b db 'Hello,Your Name!',0
c db 'Hello,China!',0
d db 'Hello,ASM!',0
data ends
stack segment
dw 30h dup(0)
stack ends
code segment
_enter :
mov ah,02h
mov dl,0dh
int 21h
mov dl,0ah
int 21h
ret
_printf: mov ax,0900h
mov dx,si
int 21h
ret
_printf_big: push bp
mov bp,sp
mov si,[bp+4]
push si
s1: cmp byte ptr [si],0
je s
cmp byte ptr [si],21h
je s2
cmp byte ptr [si],2ch
je s2
and byte ptr [si],0dfh
s2: inc si
jmp s1
s: mov byte ptr[si],24h
pop si
call _printf
pop bp
ret
start: mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,30h
mov ax,offset a
push ax
call _printf_big
pop ax
call _enter
mov ax,offset b
push ax
call _printf_big
pop ax
call _enter
mov ax,offset c
push ax
call _printf_big
pop ax
call _enter
mov ax,offset d
push ax
call _printf_big
pop ax
call _enter
mov ax,4c00h
int 21h
code ends
end start |
|