foxprn
推薦 + 挑錯(cuò) + 收藏(0) + 用戶評論(0)
foxprn.rar
;sptp.asm
;此程序?yàn)閒oxbase的一個(gè)圖形函數(shù)
;使用LQ 1600K 作圖形打印
;圖形格式:Super Star.
;將SPT圖形先左右翻轉(zhuǎn),再旋轉(zhuǎn)90度,最后反白顯示,即可打出正常的圖形
.model tiny
.code
??????? org 00h
start:
??????? jmp bg
file??? db 50 dup(0)
wth???? dw 0
lenth?? dw 0
handle? dw 0
mdv???? db 0
hdv???? db 0
npos??? dw 0
buff??? db 3 dup(0)
bg:
_cts proc far
??????? push cs
??????? pop es
??????? mov si,bx
??????? lea di,file
??????? mov cx,50
??????? cld
??????? repz movsb
;從Foxbase環(huán)境的with 參
;數(shù)中得到文件名
??????? xor si,si
??????? push cs
??????? pop ds
??????? mov ah,3dh
??????? mov al,0;只讀
??????? lea dx,file
??????? int 21h;打開文件
??????? mov handle,ax
??????? ;保存文件句柄
??????? mov ah,42h
??????? mov al,0
??????? mov bx,handle
??????? xor cx,cx
??????? mov dx,22h
??????? int 21h
??????? ;設(shè)置當(dāng)前文件位置
??????? mov ah,3fh
??????? mov bx,handle
??????? mov cx,2
??????? lea dx,wth
??????? int 21h
??????? ;讀入圖形的寬度
??????? mov ah,42h
??????? mov al,0
??????? mov bx,handle
??????? xor cx,cx
??????? mov dx,24h
??????? int 21h
??????? ;設(shè)置當(dāng)前文件位置
??????? mov ah,3fh
??????? mov bx,handle
??????? mov cx,2
??????? lea dx,lenth
??????? int 21h
??????? ;讀入圖形的高度
??????? mov ah,42h
??????? mov al,0
??????? mov bx,handle
??????? xor cx,cx
??????? mov dx,40h
??????? int 21h
??????? ;設(shè)置當(dāng)前文件位置
??????? xor dx,dx
??????? mov ax,lenth
??????? mov bx,256
??????? div bx
??????? mov mdv,dl;余數(shù)
??????? mov hdv,al;商
??????? xor dx,dx
??????? mov ax,wth
??????? mov bx,8
??????? div bx
??????? sub ax,3
??????? mov npos,ax;商
??????? mov ah,1
??????? xor dx,dx
??????? int 17h
print_bytes:
??????? xor dx,dx
??????? mov ax,wth
??????? mov bx,24
??????? div bx
??????? mov bp,ax;行數(shù)
rpt:
??????? mov bx,lenth;列數(shù)
??????? mov ah,0
??????? ;調(diào)用DOS的打印功能
??????? mov al,1bh;換碼代碼
??????? xor dx,dx
??????? int 17h
??????? ;發(fā)送這個(gè)碼
??????? xor ah,ah
??????? mov al,2ah
??????? ;圖形方式碼
??????? int 17h
??????? xor ah,ah
??????? mov al,39
??????? ;設(shè)定三倍密度24針
??????? int 17h
??????? xor ah,ah
??????? mov al,mdv;列數(shù)(余數(shù))
??????? int 17h
??????? xor ah,ah
??????? mov al,hdv;(商)
??????? int 17h
pt:
??????? push bx
??????? mov ah,3fh
??????? mov bx,handle
??????? mov cx,3
??????? lea dx,buff
??????? ;讀入三個(gè)字節(jié)的內(nèi)容
??????? int 21h
??????? mov ah,42h
??????? mov al,1
??????? mov bx,handle
??????? xor cx,cx
??????? mov dx,npos
??????? int 21h
??????? ;設(shè)置新位置
??????? mov ah,0
??????? mov al,buff
??????? xor dx,dx
??????? int 17h
??????? xor ah,ah
??????? mov al,buff+1
??????? int 17h
??????? xor ah,ah
??????? mov al,buff+2
??????? int 17h
??????? pop bx
??????? dec bx
??????? jnz pt
??????? xor ah,ah
??????? mov al,1bh
??????? int 17h
??????? xor ah,ah
??????? mov al,4ah
??????? int 17h
??????? xor ah,ah
??????? mov al,24
??????? int 17h;換行
??????? xor ah,ah
??????? mov al,13
??????? int 17h;回車
??????? mov ah,42h
??????? mov al,0
??????? mov bx,handle
??????? xor cx,cx
??????? mov dx,40h
??????? add si,3
??????? add dx,si
??????? int 21h
??????? ;設(shè)置當(dāng)前文件位置
??????? dec bp
??????? jz cont2
??????? jmp far ptr rpt
cont2:
??????? mov ah,3eh
??????? mov bx,handle
??????? int 21h;關(guān)閉文件
??????? ret
_cts endp
ends
end start
非常好我支持^.^
(0) 0%
不好我反對
(0) 0%