龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > 汇编开发 >

王爽<汇编语言> 第九章 实验九

时间:2011-05-21 16:24来源:未知 作者:admin 点击:
分享到:
assume cs:codesg,ds:datasg,ss:stacksg datasg segment dw 0A0h ;width ;0h dw 19h ;height ;2h dw 0 ;beginPoint ;4h db 'welcome to masm!' ;text ;6h db 2h ;绿色 ;16h db 24h ;绿底红色 ;17h db 71h ;白底蓝色 ;18h datasg ends stacksg segme

assume cs:codesg,ds:datasg,ss:stacksg

datasg segment

dw 0A0h ;width ;0h

dw 19h ;height ;2h

dw 0 ;beginPoint ;4h

db 'welcome to masm!' ;text ;6h

db 2h ;绿色 ;16h

db 24h ;绿底红色 ;17h

db 71h ;白底蓝色 ;18h

datasg ends

stacksg segment

db 16 dup (0)

stacksg ends

buffsg segment

db 32 dup(0)

buffsg ends

codesg segment

setStyle:push ax

push cx

push dx

mov al,ds:6h[si]

mov es:[di],al

inc si

inc di

pop dx;

mov es:[di],dl

inc di

pop cx

pop ax

loop setStyle

jmp ax

start:mov ax,datasg

mov ds,ax

mov ax,stacksg

mov ss,ax

mov sp,10h

mov ax,buffsg

mov es,ax

mov si,0

mov di,0

mov cx,8

mov dx,0

mov dl,ds:[16h]

mov ax,offset to

jmp setStyle

to:mov cx,3

mov dx,0

mov dl,ds:[17h]

mov ax,offset masm

jmp setStyle

masm:mov cx,5

mov dx,0

mov dl,ds:[18h]

mov ax,offset next

jmp setStyle

next:mov ax,ds:[2h]

mov dx,0

mov bx,2

div bx

mov cx,ax

mov ax,0

s:add ax,ds:[0h]

loop s

push ax

mov ax,ds:[0h]

sub ax,10h

mov dx,0

mov bx,2h

div bx

pop bx

add ax,bx

push ds

mov bx,0b800h

mov ds,bx

mov bx,ax

mov cx,32

mov si,0

s1:mov al,es:[si]

mov ds:[bx][si],al

inc si

loop s1

mov ax,4c00h

int 21h

codesg ends

end start


精彩图集

赞助商链接