首页 > 其他分享 >asm:segment -- assume:ds关联多个段(win_intel)

asm:segment -- assume:ds关联多个段(win_intel)

时间:2023-01-10 02:11:06浏览次数:37  
标签:intel datas1 -- win mov assume ax segment ds

asm:segment -- assume:ds关联多个段(win_intel)

 

 

 

 

一、 assume:ds 关联多个段:程序源码

 

 1 ;  file_name  =  address.asm
 2 
 3 
 4 
 5 
 6 assume ds:datas1, ds:datas2, ss:stacks, cs:codes
 7 
 8 
 9 
10 
11     datas1    segment
12         ow1    db "OW1: ", "program ", "over !", 0ah, 0dh, "$"
13     datas1    ends
14 
15 
16     datas2    segment
17         ow2    db "OW2: ", "program ", "over !", 0ah, 0dh, "$"
18     datas2    ends
19 
20 
21     stacks    segment
22         dw 20 dup(0)
23     stacks    ends
24 
25 
26 
27 
28     codes segment
29 
30 
31         start:
32         
33             mov ax, datas1
34             mov ds, ax
35             
36             mov ax, stacks
37             mov ss, ax
38             
39             mov cl, 00001111b
40             mov dl, 01101100b
41 
42             mov al, cl
43             and al, dl
44             
45             mov al, cl
46             or al, dl
47 
48             
49             mov ax, datas1
50             mov ds, ax
51             mov ax, offset ow1
52             mov dx, ax
53             mov ah, 09h
54             int 21h
55 
56             
57             mov ax, datas2
58             mov ds, ax
59             mov ax, offset ow2
60             mov dx, ax
61             mov ah, 09h
62             int 21h
63 
64             
65             sub ax, ax
66             mov ah, 4ch
67             int 21h
68 
69     codes ends
70 
71 
72 
73 end start

 

 

 

 

二、运行

 

 

  1、编译、链接:

 

 

  2、运行:

 

 

 

标签:intel,datas1,--,win,mov,assume,ax,segment,ds
From: https://www.cnblogs.com/lnlidawei/p/17038989.html

相关文章