实验9 根据材料编程

P1

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,'0'      
      int 21h

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

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

P2

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 si,0
  mov cx,5
s:mov ax,0
  mov al,[si]
  mov bl,10
  div bl
  
  mov bx,ax

  mov dl,'0'
  add dl,bl
  mov ah,2
  int 21h

  mov dl,'0'
  add dl,bh
  mov ah,2
  int 21h
 
  mov ah,2
  mov dl,32
  int 21h
  
  
  inc si
  loop s
 
  mov ax,4c00h
  int 21h
code ends
end start

P3

assume ds:data, cs:code
data segment
       db 'welcome to masm!'  
       db 2H,24H,71H          
data ends

code segment
start:  mov ax,data
        mov ds,ax            
        
        mov ax,0b800H
        mov es,ax            
        
        mov cx,3
        mov si,1824
        mov di,16
     s0:mov dx,cx
        mov bx,0
        mov cx,16
      s:mov al,[bx]
        mov ah,[di]
        mov es:[si],ax
        add si,2
        inc bx
        loop s

        add si,128
        inc di
        mov cx,dx
        loop s0

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

SUMMARY

屏幕输出这一块,在之前的实验中已经做好了总结,参见 [lip id=699],此处不多作重复总结。

REFERENCE

  1. https://sst.st/p/699

CC BY-NC-SA 4.0 本作品使用基于以下许可授权:Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注