鸿 网 互 联 www.68idc.cn

王爽汇编语言第二版学习笔记之实验13(1)

来源:互联网 作者:佚名 时间:2015-08-13 07:37
1 程序: 2 assume cs: code 3 data segment 4 db " welcome to masm! " , 0 5 data ends 6 7 code segment 8 start: 9 mov dh, 10 10 mov dl, 10 11 mov cl, 2 12 mov ax,data 13 mov ds,ax 14 mov si, 0 15 int 7ch 16 mov ax,4c00h 17 int 21h 18 code end
 1 程序:
 2 assume cs:code
 3 data segment
 4      db "welcome to masm!",0
 5 data ends
 6 
 7 code segment
 8 start:
 9      mov dh,10
10      mov dl,10
11      mov cl,2
12      mov ax,data
13      mov ds,ax
14      mov si,0
15      int 7ch
16      mov ax,4c00h
17      int 21h
18 code ends
19 end start
20 
21 7C中断例程:
22 assume cs:code
23 code segment
24 start:
25      mov ax,cs
26      mov ds,ax
27      mov si,offset do0
28     
29      mov ax,0
30      mov es,ax
31      mov di,200h
32     
33      mov cx,offset do0end-offset do0
34      cld
35      rep movsb
36     
37      mov ax,0
38      mov ds,ax
39      mov word ptr ds:[7ch*4],200H
40      mov word ptr ds:[7ch*4+2],0H
41     
42      mov ax,4c00h
43      int 21h
44     
45 do0:
46      mov ax,0
47      mov bl,cl
48     
49 s:
50      mov ah,2
51      mov bh,0
52      int 10h
53     
54      mov ah,9
55      mov byte ptr al,ds:[si]
56      cmp byte ptr al,0
57      je ok
58      mov cx,1
59      int 10h
60      inc dl
61      inc si
62      jmp short s
63 ok:
64      iret
65 
66 do0end:
67      nop
68     
69 code ends
70 end start

 

网友评论
<