;;旋转的文字[汇编]
code Segment
.386P
org 100h
assume cs:code,ds:code,es:code
start:
push cs
pop ds
push ds
pop es
call csh
mov ax,13h
int 10h
mov ax,1300h
mov bx,000eh ;BH=页码 BL=属性(若AL=00H或01H)
mov cx,cnt ;0014h ;CX=显示字符串长度
mov dx,100h ;010ah ;DH,DL=起始行,列
mov bp,offset hello ;ES:BP=显示字符串的地址
int 10h
mov ax,0a000h
mov es,ax
push es
push ds
pop es
pop ds
mov si,320*6
mov di,2000h
mov cx,320*12
rep movsb
push ds
push es
pop ds
pop es
call clear
mov bx,1000h
again:
mov si,2000h
mov di,[bx]
mov cx,320*12
next: lodsb
test al,al
jz kk1
mov al,color
kk1: stosb
loop next
call delay
inc bx
inc bx
cmp bx,1000h+360*2
jb ok
mov bx,1000h
inc color
ok:
mov ah,1
int 16h
jz again
mov ah,0
int 16h
cmp ah,1
jnz again
mov ax,3
int 10h
mov ah,4ch
int 21h
csh:
cld
MOV DI,1000H
MOV CX,360
@csh:
INC ROT
FLDPI
FIDIV RRR
FIMUL ROT
FSINCOS
FIMUL RX
FISTP XX
FIMUL RY
FISTP YY
ADD XX, 100 ;120
ADD YY, 90 ;100
MOV AX, YY
imul ax,320
add ax,XX
stosw
LOOP @csh
ret
;===========
color DB 2
RRR DW 180
YY DW 100
XX DW 160
RX DW 80 ;120
RY DW 60 ;90
ROT DW ?
;------------
Delay:
push dx
push ax
t_a: mov dx,3dah
in al, dx
test al, 8
Jnz t_a
t_b: in al, dx
test al, 8
Jz t_b
pop ax
pop dx
ret
clear:
xor di,di
mov ax,di
mov cx,320*200
rep stosb
ret
hello db ' Hello World! '
cnt equ $- hello
code ends
end start
code Segment
.386P
org 100h
assume cs:code,ds:code,es:code
start:
push cs
pop ds
push ds
pop es
call csh
mov ax,13h
int 10h
mov ax,1300h
mov bx,000eh ;BH=页码 BL=属性(若AL=00H或01H)
mov cx,cnt ;0014h ;CX=显示字符串长度
mov dx,100h ;010ah ;DH,DL=起始行,列
mov bp,offset hello ;ES:BP=显示字符串的地址
int 10h
mov ax,0a000h
mov es,ax
push es
push ds
pop es
pop ds
mov si,320*6
mov di,2000h
mov cx,320*12
rep movsb
push ds
push es
pop ds
pop es
call clear
mov bx,1000h
again:
mov si,2000h
mov di,[bx]
mov cx,320*12
next: lodsb
test al,al
jz kk1
mov al,color
kk1: stosb
loop next
call delay
inc bx
inc bx
cmp bx,1000h+360*2
jb ok
mov bx,1000h
inc color
ok:
mov ah,1
int 16h
jz again
mov ah,0
int 16h
cmp ah,1
jnz again
mov ax,3
int 10h
mov ah,4ch
int 21h
csh:
cld
MOV DI,1000H
MOV CX,360
@csh:
INC ROT
FLDPI
FIDIV RRR
FIMUL ROT
FSINCOS
FIMUL RX
FISTP XX
FIMUL RY
FISTP YY
ADD XX, 100 ;120
ADD YY, 90 ;100
MOV AX, YY
imul ax,320
add ax,XX
stosw
LOOP @csh
ret
;===========
color DB 2
RRR DW 180
YY DW 100
XX DW 160
RX DW 80 ;120
RY DW 60 ;90
ROT DW ?
;------------
Delay:
push dx
push ax
t_a: mov dx,3dah
in al, dx
test al, 8
Jnz t_a
t_b: in al, dx
test al, 8
Jz t_b
pop ax
pop dx
ret
clear:
xor di,di
mov ax,di
mov cx,320*200
rep stosb
ret
hello db ' Hello World! '
cnt equ $- hello
code ends
end start