标签: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!
(进栈入栈操作使程序更为简洁)
奇偶地址分别存放字符属性及字符
标签:asm ima art 技术分享 com tar pre 背景颜色 颜色
原文地址:https://www.cnblogs.com/20171308061xh/p/10098582.html