汇编程序26:实验9 根据材料编程
1 assume cs:code,ds:data,ss:stack 2 3 data segment 4 db 'welcome to masm!' 5 db 02h,24h,71h 6 data ends 7 8 stack segment 9 dw 8 dup(0) 10 stack ends 11 12 code segment 13 start: 14 mov ax,data 15 mov ds,ax //数据段 16 mov ax,0B800h 17 mov es,ax //写入段 18 mov bx,0 //写入3次的行偏移地址 19 mov bp,10h //写入的颜色属性 20 mov cx,3 //写入3次 21 s: 22 push cx 23 mov si,0 //遍历待写数据偏移 24 mov di,0 //遍历写入数据偏移 25 mov cx,16 //写入共16个字节 26 s0: 27 mov al,ds:[si] 28 mov es:[bx+di],al 29 mov ah,ds:[bp] 30 mov es:[bx+di+1],ah 31 inc si 32 add di,2 33 loop s0 34 inc bp 35 add bx,20h 36 pop cx 37 loop s 38 mov ax,4c00h 39 int 21h 40 code ends 41 42 end start