±źĢā:
»ć±ą²Ėµ„ģʽ
[“ņÓ”±¾Ņ³]
×÷Õß:
cnangel
ʱ¼ä:
2003-10-16 20:00
±źĢā:
»ć±ą²Ėµ„ģʽ
wind struc
wpos dw 0
wcolor db ?
wbox dw ?
itempos dw 02
itemcol0 db ?
itemcol1 db ?
itemsum db ?
itemnum db 0
item0 dw ?
wind ends
code segment stack 'stack'
assume cs:code,ds:code,ss:code
begin:
posh db 20
posl db 40
color db 71h
posll db 40d
poscx dw ?
posdx dw ?
number db 00
backaddr dw ?
oldint1c dd ?
msgbox1:
db 'ŚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄæ',0dh,0ah
db '?New file: ?,0dh,0ah
db 'ĄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄŁ',0dh,0ah,0
msgbox0:
db 'ŚÄÄAssembler and FortranÄÄÄÄÄÄÄÄÄ[ ZDOS ]ÄÄÄÄÄÄÄVer 2.0ÄÄÄÄÄÄÄÄÄÄÄ[ : : ]Äæ',0dh,0ah
db 'ĘĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶFile name and pathĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĖĶĶĶĶĶĶĶ͵',0dh,0ah
db '? Edit ? move ?,0dh,0ah
db '? Masm ?arrows ?,0dh,0ah
db '? For1 ? to ?,0dh,0ah
db '? Pas2 (FORTRAN) ?choose ?,0dh,0ah
db '? Link ĢĶĶĶĶĶĶĶ͵',0dh,0ah
db '? Debug ? press ?,0dh,0ah
db '? Execute ? enter ?,0dh,0ah
db '? Name project file ? to ?,0dh,0ah
db '? DosShell ?execute?,0dh,0ah
db '? Quit... ? item ?,0dh,0ah
db 'ĄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄŠÄÄÄÄÄÄÄÄŁ',0dh,0ah,0h
msg0 db ' Edit ',0dh,0ah,0,63 dup(0dh)
msg1 db ' Masm ',0dh,0ah,0,63 dup(0dh)
msg2 db ' For1 ',0dh,0ah,0,63 dup(0dh)
msg3 db ' Pas2 (FORTRAN) ',0dh,0ah,0
msg4 db ' Link ',0dh,0ah,0,63 dup(0dh)
msg5 db ' Debug ',0dh,0ah,0,63 dup(0dh)
msg6 db ' Execute ',0dh,0ah,0,63 dup(0dh)
msg7 db ' Name project file ',0dh,0ah,0
msg8 db ' DosShell ',0dh,0ah,0
msg9 db ' Quit... ',0dh,0ah,0
msg10:
time0 db ?,?
db ':'
time1 db ?,?
db ':'
time2 db ?,?,0
msg11 db 0dh,0ah,' ( ZhaoJiBin 97,CL,ZC,9# ) '
db 0dh,0ah,' This is NO shareware,You needn''t outlay anything.'
db 0dh,0ah,' Very thanks,if you have problems,please write a postcard to me. '
db 0dh,0ah,' My name : ZhaoJiBin'
db 0dh,0ah,' My mailbox : ShiChuan Institute Of Technology 9708#'
db 0dh,0ah,' My phone call : (028)7721727',0dh,0ah,0h,'$'
msg12 db 0dh,0ah,07h,' Press Exit to retrun ZDOS 4/3/2000$'
wind0 wind <00,70h,offset msgbox0,0202h,70h,17h,10,0,msg0>
dw msg1,msg2,msg3,msg4,msg5,msg6,msg7,msg8,msg9
edit db 80h,'EDIT.COM ',56 dup(0dh)
masm db 80h,'MASM.EXE ',56 dup(0dh)
for1 db 80h,'FOR1.EXE ',56 dup(0dh)
pas2 db 80h,'PAS2.EXE ',56 dup(0dh)
link db 80h,'LINK.EXE ',56 dup(0dh)
debug db 80h,'DEBUG ',56 dup(0dh)
self db 80h,' ',56 dup(0dh)
dos db 80h,'COMMAND.COM ',0dh
program dw execedit,execmasm, execfor1,execpas2
dw execlink,execdebug,execself,execname
dw execdos, execquit
buffer db 50d,0,51d dup(?)
pathbuffer db 80 dup(?)
start: mov bx,(offset quit-offset begin+110h)/10h
mov ah,4ah
int 21h
mov si,80h
cmp byte ptr[si],0
jz start0
cmp byte ptr[si],50d
ja start0
push cs
pop es
call fillin
start0: mov ah,0fh
int 10h
cmp al,03h
jz start1
mov ax,03h
int 10h
start1: call savecon
push cs
pop ds
push cs
pop es
mov cl,ds:wind0.itemsum
mov ch,ds:wind0.itemnum
lea di,buffer+2
rk2: cmp ch,0ffh
jnz rk3
mov ch,cl
dec ch
rk3: cmp ch,cl
jb rk4
mov ch,0
rk4: lea si,ds:wind0.itemnum
mov ds:[si],ch
lea si,wind0
call makewind
call disppath
call settimer
lea si,buffer
mov byte ptr[si+1],0
call input
call killtimer
cmp ah,50h
jnz rk0
inc ch
rk0: cmp ah,48h
jnz rk1
dec ch
rk1: cmp ah,1ch
jnz rk2
call oopscon
inc si
cmp byte ptr[si],0
jnz execcommand
mov bl,ch
xor bh,bh
shl bx,1
call ds:[bx+program]
jmp start0
execcommand: mov ax,0e0dh
int 10h
mov al,0ah
int 10h
int 10h
int 2eh
jmp start0
execedit: lea si,edit
int 2eh
jmp start0
execmasm: lea si,masm
int 2eh
jmp start0
execfor1: lea si,for1
int 2eh
jmp start0
execpas2: lea si,pas2
int 2eh
jmp start0
execlink: lea si,link
int 2eh
jmp start0
execdebug: lea si,debug
int 2eh
jmp start0
execself: lea si,self
int 2eh
jmp start0
execdos: lea dx,msg12
mov ah,09h
int 21h
lea si,dos
int 2eh
jmp start0
execquit: mov ax,03
int 10h
lea dx,msg11
mov ah,09h
int 21h
mov dx,00h
mov ds:posh,dh
mov ds:posl,dl
mov ds:posll,dl
mov ds:color,03h
lea si,msg11
call dispstr
mov ax,4c00h
int 21h
execname: call savecon
lea si,msgbox1
mov dx,0807h
mov ds:posh,dh
mov ds:posl,dl
mov ds:posll,dl
mov ds:color,71h
call dispstr
xor bx,bx
mov ah,03h
int 10h
mov ds:poscx,cx
mov ds:posdx,dx
mov dx,0913h
mov ah,02h
int 10h
lea si,buffer
lea di,buffer+2
call input
cmp ah,1ch
jnz execname
cmp byte ptr[si+1],0
jz execname
xor bx,bx
mov cx,ds:poscx
mov dx,ds:posdx
mov ah,02h
int 10h
lea si,buffer
call fillin
call oopscon
ret
fillin: inc si
inc si
mov bx,si
int 3
lea di,edit+10d
name0: call fillname
cmp al,0dh
jz name1
mov al,'.'
cld
stosb
jmp name0
name1: call fillend
mov si,bx
lea di,msg0+10d
name2: call fillname
cmp al,0dh
jz name3
mov al,'.'
cld
stosb
jmp name2
name3: call fillend
mov si,bx
lea di,masm+10d
call fillname
mov al,'.'
cld
stosb
mov ax,'SA'
stosw
mov al,'M'
stosb
call fillend
mov si,bx
lea di,msg1+10d
call fillname
mov al,'.'
cld
stosb
mov ax,'SA'
stosw
mov al,'M'
stosb
call fillend
mov si,bx
lea di,for1+10d
call fillname
mov al,'.'
cld
stosb
mov ax,'OF'
stosw
mov al,'R'
stosb
call fillend
mov si,bx
lea di,msg2+10d
call fillname
mov al,'.'
cld
stosb
mov ax,'OF'
stosw
mov al,'R'
stosb
call fillend
mov si,bx
lea di,link+10d
call fillname
mov al,'.'
cld
stosb
mov ax,'BO'
stosw
mov al,'J'
stosb
call fillend
mov si,bx
lea di,msg4+10d
call fillname
mov al,'.'
cld
stosb
mov ax,'BO'
stosw
mov al,'J'
stosb
call fillend
mov si,bx
lea di,debug+10d
call fillname
mov al,'.'
cld
stosb
mov ax,'XE'
stosw
mov al,'E'
stosb
call fillend
mov si,bx
lea di,msg5+10d
call fillname
mov al,'.'
cld
stosb
mov ax,'XE'
stosw
mov al,'E'
stosb
call fillend
mov si,bx
lea di,self+10d
call fillname
mov al,'.'
cld
stosb
mov ax,'XE'
stosw
mov al,'E'
stosb
call fillend
mov si,bx
lea di,msg6+10d
call fillname
mov al,'.'
cld
stosb
mov ax,'XE'
stosw
mov al,'E'
stosb
call fillend
ret
fillend: cld
mov ax,0dh*256+20h
stosw
mov ax,0ah
stosw
ret
fillname: cld
lodsb
cmp al,0dh
jz fill0
cmp al,'.'
jz fill0
cmp al,'a'
jb fill1
cmp al,'z'
ja fill1
sub al,'a'-'A'
fill1: cld
stosb
jmp fillname
fill0: push di
push ax
mov al,20h
fill4: cmp es:byte ptr[di],0dh
jz fill3
cld
stosb
jmp fill4
fill3: pop ax
pop di
ret
input: push bx
push cx
push dx
input1: xor ax,ax
int 16h
cmp ah,50h
jz input0
cmp ah,48h
jz input0
cmp al,0
jz input1
cmp al,08h
jz input2
cld
stosb
cmp ah,1ch
jz input0
mov cl,ds:byte ptr[si]
cmp cl,ds:byte ptr[si+1]
jz input3
mov ah,0eh
int 10h
inc ds:byte ptr[si+1]
jmp input1
input0: pop dx
pop cx
pop bx
ret
input2: cmp ds:byte ptr [si+1],0
jz input1
dec ds:byte ptr [si+1]
dec di
mov ah,0eh
int 10h
mov al,20h
int 10h
mov al,08h
int 10h
jmp input1
input3: dec di
mov ax,0e07h
int 10h
jmp input1
disppath: call saveregs
xor bx,bx
mov ah,03h
int 10h
mov ah,02h
mov dx,1800h
int 10h
mov ah,02h
mov dl,0dh
int 21h
mov ah,19h
int 21h
mov dl,al
add dl,'A'
mov ah,02h
int 21h
mov dl,':'
int 21h
mov dl,'\'
int 21h
lea si,pathbuffer
mov dl,0
mov ah,47h
int 21h
dpath0: cld
lodsb
or al,al
jz dpath1
mov dl,al
mov ah,02h
int 21h
jmp dpath0
dpath1: mov dl,'>'
mov ah,02h
int 21h
call oopsregs
ret
makewind: call saveregs
mov dx,ds:wind0.wpos
mov ds:posh,dh
mov ds:posl,dl
mov ds:posll,dl
mov dl,ds:wind0.wcolor
mov ds:color,dl
push si
mov si,ds:wind0.wbox
call dispstr
pop si
mov dx,ds:wind0.itempos
mov ds:posh,dh
mov ds:posl,dl
mov ds:posll,dl
mov cl,ds:wind0.itemsum
mov ch,cl
sub ch,ds:wind0.itemnum
mov dl,ds:wind0.itemcol0
mov dh,ds:wind0.itemcol1
lea si,ds:wind0.item0
make1: push si
mov ds:color,dl
cmp ch,cl
jnz make0
mov ds:color,dh
make0: mov si,[si]
call dispstr
pop si
inc si
inc si
dec cl
jnz make1
call oopsregs
ret
;************************************************
dispstr: call saveregs
mov ax,0b800h
mov es,ax
dispstr0: cld
lodsb
or al,al
jz dispstr3
cmp al,0dh
jnz dispstr1
mov al,cs:posll
mov cs:posl,al
jmp dispstr0
dispstr1: cmp al,0ah
jnz dispstr2
inc cs:posh
jmp dispstr0
dispstr2: call calcul
mov ah,cs:color
cld
stosw
inc cs:posl
jmp dispstr0
dispstr3: call oopsregs
ret
calcul: push ax
mov al,cs:posh
mov ah,80d
mul ah
add al,cs:posl
adc ah,0
shl ax,1
mov di,ax
pop ax
ret
settimer: call saveregs
int 3
mov ax,351ch
int 21h
mov ds:word ptr oldint1c,bx
mov ds:word ptr oldint1c+2,es
lea dx,newint1c
mov ax,251ch
int 21h
call oopsregs
ret
killtimer: call saveregs
int 3
lds dx,oldint1c
mov ax,251ch
int 21h
call oopsregs
ret
newint1c: call saveregs
mov ax,0200h
int 1ah
mov al,ch
lea si,time0
call bcd
mov al,cl
lea si,time1
call bcd
mov al,dh
lea si,time2
call bcd
mov ax,0b800h
mov es,ax
mov di,67*2d
lea si,msg10
disptime: mov al,cs:[si]
inc si
or al,al
jz disptime0
mov ah,071h
cld
stosW
jmp disptime
disptime0: call oopsregs
jmp cs:oldint1c
bcd: mov ah,al
shr ah,1
shr ah,1
shr ah,1
shr ah,1
and al,0fh
add ax,'00'
xchg ah,al
mov cs:[si],ax
ret
saveregs: pop cs:backaddr
db 60h
push ds
push es
push cs:backaddr
ret
oopsregs: pop cs:backaddr
pop es
pop ds
db 61h
push cs:backaddr
ret
savecon: call saveregs
mov ax,0b800h
mov es,ax
mov ds,ax
xor si,si
mov di,80*25*2
mov cx,80*20*2
cld
rep movsb
call oopsregs
ret
oopscon: call saveregs
mov ax,0b800h
mov es,ax
mov ds,ax
xor si,si
mov di,80*25*2
mov cx,80*20*2
xchg si,di
cld
rep movsb
call oopsregs
ret
org $+136h
quit:
code ends
end start
ø“ÖĘ“śĀė
»¶Ó¹āĮŁ ŠĒŠĒ²©æĶ (http://commerce.huhoo.net/)
Powered by Discuz! 7.0.0