Cut-drawing procedure for 320*200

Source: Internet
Author: User

;; Drawing procedure
Code segment
Assume Cs:code,ds:code
Org 100h
BEGIN:JMP Init
INT9 DD?
DDXX DB 0
Mess db ' Now-Start with $ '
Handle DW?
Buffer db 256*3 dup (0)
Path db ' pic*. ', 0
DTA db DUP (?)
New_int proc Far
STi
Push AX
Push ES
XOR Ax,ax
MOV Es,ax
In al,60h
Test al,80h
JNZ exit1
Test byte ptr es:[0417h],100b
JZ exit1
CMP al,59
JNZ exit1
Push AX
Push BX
Push CX
Push DX
Push BP
Push di
Push SI
Push DS
Push CS
Pop ds
In al,61h
Push AX
or al,80h
Out 61h,al
Pop ax
Out 61h,al
MOV al,20h
Out 20h,al
Call SAVESCR
Exit
Pop ds
Pop si
Pop di
Pop bp
Pop DX
Pop CX
Pop bx
Pop ax
EXIT1:
Pop es
Pop ax
JMP Cs:int9
New_int ENDP
SAVESCR proc Near
Push CS
Pop ds
MOV ax,1017h
MOV bx,0
MOV cx,256
MOV Dx,cs
MOV es,dx
MOV Dx,offset buffer
int 10h
MOV Dx,offset dta+30
MOV ah,3ch
MOV cx,0000
int 21h
MOV Handle,ax
MOV Bx,handle
MOV Dx,offset buffer
MOV cx,768
MOV ah,40h
int 21h
MOV dx,0
MOV cx,5
Rewrite
Push CX
MOV cx,65535
Rr:
MOV dl,cs:ddxx
Call Write
Inc byte PTR cs:ddxx
Pop CX
Loop rewrite
JMP Writeend
Write proc near
MOV ax,4f05h
MOV bx,0
int 10h
MOV dx,0
MOV ax,0a000h
MOV Ds,ax
MOV ah,40h
MOV Bx,cs:handle
int 21h
Ret
Write ENDP
Writeend:
MOV Ah,3eh
int 21h
Push CS
Pop ds
MOV Bx,offset dta+35
MOV Al,[bx-1]
Inc AL
CMP al,58
Jnz nn
MOV Cl,[bx-2]
INC CL
mov [BX-2],CL
mov al, ' 0 '
Nn:
mov [bx-1],al
Quit:ret
SAVESCR ENDP
Init:
Cli
Push CS
Pop ds
MOV dx,offset DTA
MOV Ah,1ah
int 21h
MOV dx,offset path
MOV Ah,4eh
MOV cx,0
int 21h
Start
CMP ax,0002
JZ End
CMP ax,0003
Je end
CMP ax,0018
Je end
FindNext
MOV dx,offset path
MOV ah,4fh
int 21h
JB End
JMP start
End
MOV Si,offset dta+35
mov byte ptr [si], ' $ '
MOV Al,[si-1]
Inc AL
CMP al,58
JNZ n
mov al, ' 0 '
MOV Bl,[si-2]
Inc BL
mov [SI-2],BL
N:
mov [si-1],al
MOV ah,9
MOV Dx,offset mess
int 21h
MOV Dx,offset dta+30
int 21h
MOV Si,offset dta+35
mov byte ptr [si],0
MOV ax,3509h
int 21h
MOV Di,offset int9
mov [DI],BX
mov [di+2],es
Push CS
Pop ds
MOV Dx,offset new_int
MOV ax,2509h
int 21h
STi
MOV dx,offset init
int 27h
Code ends
End begin

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.