情人节,尝试将小心心打在屏幕上

这几天在学汇编,今天写实验十二的作业的时候,无意中打算把昨天的小想法实现一下。反正也没办法让我想的那个人看到,索性就记录在这里了。 超简单。

assume cs:code
code segment
start: mov ax,0b800h
       mov ds,ax
	   mov di,160*12+35*2
	   mov cx,9
	 s:mov byte ptr ds:[di],03h
	   mov byte ptr ds:[di+1],04h
	   add di,2
	   loop s
	   
	   mov di,160*11+36*2
	   mov cx,3
	s1:mov byte ptr ds:[di],03h
	   mov byte ptr ds:[di+1],04h
	   add di,2
	   loop s1
	   
	   mov di,160*11+40*2
	   mov cx,3
	s2:mov byte ptr ds:[di],03h
	   mov byte ptr ds:[di+1],04h
	   add di,2
	   loop s2
	   
	   mov di,160*13+36*2
	   mov cx,7
	s3:mov byte ptr ds:[di],03h
	   mov byte ptr ds:[di+1],04h
	   add di,2
	   loop s3 
	   
	   mov di,160*14+37*2
	   mov cx,5
	s4:mov byte ptr ds:[di],03h
	   mov byte ptr ds:[di+1],04h
	   add di,2
	   loop s4 
	   
	   mov di,160*15+38*2
	   mov cx,3
	s5:mov byte ptr ds:[di],03h
	   mov byte ptr ds:[di+1],04h
	   add di,2
	   loop s5 
	   
	   mov di,160*16+39*2
	   mov cx,1
	s6:mov byte ptr ds:[di],03h
	   mov byte ptr ds:[di+1],04h
	   add di,2
	   loop s6
	   
	   
	   mov ax,4c00h
	   int 21h
code ends
end start

效果是这个样子的。 很可爱,有没有。

经验分享 程序员 微信小程序 职场和发展