码迷,mamicode.com
首页 > 其他好文 > 详细

实验9

时间:2018-12-10 20:52:26      阅读:207      评论:0      收藏:0      [点我收藏+]

标签:asm   ima   art   技术分享   com   tar   pre   背景颜色   颜色   

assume cs:code, ds:data
data segment
     db 12
     db 0,0   
data ends
code segment
start:
      mov ax,data
      mov ds,ax       
      mov ah,0
      mov al,ds:[0]   
      mov bl,10
      div bl
      mov  ds:[1],al    
      mov  ds:[2],ah   

      mov ah,2
      mov dl,ds:[1]   
      add dl, 30h      
      int 21h

      mov ah,2
      mov dl,ds:[2]    
      add dl, 30h          
      int 21h

      mov ax,4c00h
      int 21h
code ends
end start

结果 显示12

技术分享图片

 

 

assume cs:code, ds:data
data segment
     db 12,35,96,55,67
data ends
code segment
start:
    mov ax,data  
     mov ds,ax 
     mov bx,0 
      mov cx,5 
      s:mov ah,0
      mov al,[bx]
      mov dl,10     
      div dl     
      mov dh,ah  
      mov dl,al  
      mov ah,2   
      add dl,30h  
      int 21h
      
      mov dl,dh
      mov ah,2
      add dl,30h
      int 21h
      
      mov dl,20h
      mov ah,2
      int 21h
      
      inc bx
      loop s
            
      mov ax,4c00h
      int 21h
code ends
end start

 

结果显示  12 35 96 55 67

技术分享图片

assume cs:code,ds:data
data segment
db welcome to masm!
data ends
code segment
start: mov ax,data
       mov ds,ax
       mov cl,10h
       mov ch,0
       mov ax,0B800h
       mov es,ax
       mov si,0h
       mov di,0h
       
       s: mov al,0
       mov al,ds:[si]
       mov ah,0
       mov ah,00000010B
       mov es:[720h+di],ax
       mov ah,11110001B
       mov es:[720h+di+160D],ax
       mov ah,10100100B
       mov es:[720h+di+320D],ax
       inc si
       add di,02h
       loop s 
       mov ax,4c00h
       int 21h
       
code ends
end start

中央显示    三种字体及背景颜色的  welcome to masm!

 技术分享图片

技术分享图片

(进栈入栈操作使程序更为简洁)

 奇偶地址分别存放字符属性及字符

 

实验9

标签:asm   ima   art   技术分享   com   tar   pre   背景颜色   颜色   

原文地址:https://www.cnblogs.com/20171308061xh/p/10098582.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!