mirror of
https://github.com/NishiOwO/VZEditor.git
synced 2025-04-21 08:34:40 +00:00
remove once
This commit is contained in:
parent
be78cbbeb7
commit
99ddac4500
118
SRC/GNUmakefile
118
SRC/GNUmakefile
@ -1,118 +0,0 @@
|
||||
.SUFFIXES: .asm .obj
|
||||
.PHONY: vz default clean
|
||||
|
||||
OBJS = main.obj alias.obj char.obj core.obj disp.obj dos.obj expr.obj\
|
||||
filer.obj gets.obj harderr.obj inst.obj key.obj ledit.obj macro.obj\
|
||||
memo.obj menu.obj misc.obj open.obj printf.obj scrn.obj smooth.obj\
|
||||
string.obj text.obj view.obj wind.obj swap.obj ems.obj xscr.obj msg.obj
|
||||
|
||||
HARD =
|
||||
FLAG = -DPC98
|
||||
|
||||
default:
|
||||
@echo "Available paltforms: 98 J31 IBM IBMJ AX 55 US"
|
||||
@echo "Run $(MAKE) vz PLATFORM=<platform> to build"
|
||||
|
||||
ifeq ($(PLATFORM),98)
|
||||
HARD=
|
||||
FLAG=-DPC98
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),J31)
|
||||
HARD=J31
|
||||
FLAG=-DJ31
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),IBM)
|
||||
HARD=IBM
|
||||
FLAG=-DIBMV
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),IBMJ)
|
||||
HARD=IBMJ
|
||||
FLAG=-DIBMJ
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),AX)
|
||||
HARD=AX
|
||||
FLAG=-DIBMAX
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),55)
|
||||
HARD=55
|
||||
FLAG=-DJBM
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),US)
|
||||
HARD=US
|
||||
FLAG=-DUS
|
||||
endif
|
||||
|
||||
vz: vz$(HARD).com
|
||||
|
||||
.asm.obj:
|
||||
jwasm -Zm -Zg -ml -Zne -Zg -fpc -nologo -Cu -zcw -c $(FLAG) -Fo$@ $< || (rm -f $@ ; exit 1)
|
||||
|
||||
vz$(HARD).com: $(OBJS)
|
||||
wlink format dos com name $@ file `echo $^ | sed "s/ /,/g"`
|
||||
|
||||
main.obj: vz.inc main.asm
|
||||
|
||||
alias.obj: vz.inc alias.asm
|
||||
|
||||
char.obj: vz.inc char.asm
|
||||
|
||||
core.obj: vz.inc core.asm
|
||||
|
||||
disp.obj: vz.inc disp.asm
|
||||
|
||||
dos.obj: vz.inc dos.asm
|
||||
|
||||
expr.obj: vz.inc expr.asm
|
||||
|
||||
filer.obj: vz.inc filer.asm
|
||||
|
||||
gets.obj: vz.inc gets.asm
|
||||
|
||||
harderr.obj: vz.inc harderr.asm
|
||||
|
||||
inst.obj: vz.inc inst.asm
|
||||
|
||||
key.obj: vz.inc key.asm key98.asm keyibm.asm
|
||||
|
||||
ledit.obj: vz.inc ledit.asm
|
||||
|
||||
macro.obj: vz.inc macro.asm
|
||||
|
||||
memo.obj: vz.inc memo.asm
|
||||
|
||||
menu.obj: vz.inc menu.asm
|
||||
|
||||
misc.obj: vz.inc misc.asm
|
||||
|
||||
open.obj: vz.inc open.asm
|
||||
|
||||
printf.obj: sprintf.inc printf.asm
|
||||
|
||||
scrn.obj: vz.inc scrn.asm scrn98.asm scrnibm.asm
|
||||
|
||||
smooth.obj: vz.inc smooth.asm
|
||||
|
||||
string.obj: vz.inc string.asm
|
||||
|
||||
text.obj: vz.inc text.asm
|
||||
|
||||
view.obj: vz.inc view.asm
|
||||
|
||||
wind.obj: vz.inc wind.asm
|
||||
|
||||
xscr.obj: vz.inc xscr.asm
|
||||
|
||||
swap.obj: vz.inc swap.asm
|
||||
|
||||
ems.obj: vz.inc ems.asm
|
||||
|
||||
msg.obj: vz.inc msg.asm
|
||||
|
||||
clean:
|
||||
rm -f vz*.com *.obj *.err
|
629
SRC/alias.asm
629
SRC/alias.asm
@ -1,629 +0,0 @@
|
||||
;****************************
|
||||
; 'alias.asm'
|
||||
;****************************
|
||||
|
||||
include vz.inc
|
||||
|
||||
IFNDEF NOALIAS
|
||||
|
||||
;--- Local macros ---
|
||||
|
||||
issptab macro label
|
||||
cmp al,SPC
|
||||
je label
|
||||
cmp al,TAB
|
||||
je label
|
||||
endm
|
||||
|
||||
isnsptab macro label
|
||||
local next
|
||||
cmp al,SPC
|
||||
je next
|
||||
cmp al,TAB
|
||||
jne label
|
||||
next:
|
||||
endm
|
||||
|
||||
;--- External symbols ---
|
||||
|
||||
wseg
|
||||
extrn doswapf :byte
|
||||
extrn swchr :byte
|
||||
|
||||
extrn aliasbuf :word
|
||||
IFNDEF NOFILER
|
||||
extrn execcmd :word
|
||||
ENDIF
|
||||
extrn farseg :word
|
||||
extrn tmpbuf :word
|
||||
extrn tmpbuf2 :word
|
||||
endws
|
||||
|
||||
extrn addsep :near
|
||||
extrn ems_loadmap :near
|
||||
extrn ems_map :near
|
||||
extrn ems_savemap :near
|
||||
extrn fillspc :near
|
||||
extrn isupper :near
|
||||
extrn memmove :near
|
||||
extrn parsepath :near
|
||||
extrn poolnamep :near
|
||||
extrn popupmenu :near
|
||||
extrn puts :near
|
||||
extrn puts_s :near
|
||||
extrn scanenv :near
|
||||
extrn schsysmenu :near
|
||||
extrn skipspc :near
|
||||
extrn skipstr :near
|
||||
extrn strcpy :near
|
||||
extrn strlen :near
|
||||
extrn toupper :near
|
||||
extrn wrdicmp :near
|
||||
extrn scantbl :near
|
||||
|
||||
dseg ; bseg
|
||||
|
||||
;--- Local work ---
|
||||
|
||||
poolf db FALSE
|
||||
|
||||
endds ; endbs
|
||||
|
||||
eseg
|
||||
assume ds:cgroup
|
||||
|
||||
;--- Is alias atom ? ---
|
||||
;--> SI :source ptr
|
||||
;<--
|
||||
; CY :Yes,atom
|
||||
; DI :replace str ptr
|
||||
; BX :alias str ptr
|
||||
; DX :seek count
|
||||
|
||||
isatom proc
|
||||
push si
|
||||
mov di,aliasbuf
|
||||
clr dx
|
||||
isatm1:
|
||||
mov bx,di
|
||||
tstb [di]
|
||||
jz isatm8
|
||||
call wrdicmp
|
||||
jc isatm3
|
||||
call skipstr
|
||||
inc dx
|
||||
jmp isatm1
|
||||
isatm3:
|
||||
mov si,di
|
||||
call skipspc
|
||||
mov di,si
|
||||
stc
|
||||
isatm8: pop si
|
||||
VZ_RET
|
||||
isatom endp
|
||||
|
||||
;--- Word length ---
|
||||
;--> SI :str ptr
|
||||
;<--
|
||||
; CX :length
|
||||
; SI :next ptr
|
||||
; AL :delimit char
|
||||
|
||||
wordlen proc
|
||||
mov cx,si
|
||||
wlen1: lodsb
|
||||
tst al
|
||||
jz wlen2
|
||||
isnsptab wlen1
|
||||
wlen2: dec si
|
||||
sub cx,si
|
||||
neg cx
|
||||
VZ_RET
|
||||
wordlen endp
|
||||
|
||||
;--- Statement length ---
|
||||
;--> SI :str ptr
|
||||
;<--
|
||||
; CX :length
|
||||
; SI :next ptr
|
||||
; AL :delimit char
|
||||
|
||||
statelen proc
|
||||
mov cx,si
|
||||
slen1: lodsb
|
||||
slen2: tst al
|
||||
jz slen3
|
||||
isnsptab slen1
|
||||
lodsb
|
||||
cmp al,';'
|
||||
jne slen2
|
||||
dec si
|
||||
slen3: dec si
|
||||
sub cx,si
|
||||
neg cx
|
||||
wlen9: VZ_RET
|
||||
statelen endp
|
||||
|
||||
;--- Insert string ---
|
||||
;-->
|
||||
; DS:SI :source ptr
|
||||
; CX :source length
|
||||
; ES:DI :destin ptr
|
||||
; DX :replace length
|
||||
; BX :destin buffer max
|
||||
|
||||
insertstr proc
|
||||
pushm <cx,dx,si,di>
|
||||
push di
|
||||
call skipstr
|
||||
pop si
|
||||
mov ax,cx
|
||||
mov cx,di
|
||||
sub ax,dx
|
||||
js insstr1
|
||||
add di,ax
|
||||
cmp di,bx
|
||||
jbe insstr1
|
||||
mov byte ptr es:[bx-1],0
|
||||
mov cx,bx
|
||||
sub cx,ax
|
||||
dec cx
|
||||
insstr1:
|
||||
add si,dx
|
||||
sub cx,si
|
||||
mov di,si
|
||||
add di,ax
|
||||
push ds
|
||||
movseg ds,es
|
||||
call memmove
|
||||
pop ds
|
||||
popm <di,si,dx,cx>
|
||||
call memmove
|
||||
VZ_RET
|
||||
insertstr endp
|
||||
|
||||
;--- Spread %n variables ---
|
||||
;-->
|
||||
; SI :format str ptr
|
||||
; BX :param str ptr
|
||||
; DI :write str ptr (update)
|
||||
|
||||
partype db "<<:>&."
|
||||
|
||||
spreadvar proc
|
||||
clr cx
|
||||
spvar1: lodsb
|
||||
cmp al,'%'
|
||||
je spvar2
|
||||
spvar11:stosb
|
||||
tst al
|
||||
jnz spvar1
|
||||
tst cx
|
||||
_if z
|
||||
mov byte ptr [di-1],SPC
|
||||
dec si
|
||||
clr dl
|
||||
jmps spvar_all
|
||||
_endif
|
||||
spvar9: VZ_RET
|
||||
|
||||
spvar2:
|
||||
inc cx
|
||||
clr dx ; DL :param No., DH :param type
|
||||
clr ah ; AH :%% flag
|
||||
spvar21:lodsb
|
||||
cmp al,'%'
|
||||
jne spvar22
|
||||
stosb ; %%
|
||||
mov ah,al
|
||||
lodsb
|
||||
spvar22:cmp al,'*'
|
||||
je spvar_all ; %*
|
||||
cmp al,'\'
|
||||
je spvar_dir ; %\ .
|
||||
cmp al,'-'
|
||||
je spvar_sw
|
||||
cmp al,'1'
|
||||
jb spvar3
|
||||
cmp al,'9'
|
||||
jbe spvar5
|
||||
spvar3:
|
||||
pushm <cx,di>
|
||||
mov di,offset cgroup:partype
|
||||
mov cx,7
|
||||
call scantbl
|
||||
mov dh,cl
|
||||
popm <di,cx>
|
||||
je spvar4
|
||||
mov byte ptr [di],'%'
|
||||
inc di
|
||||
tst ah
|
||||
jnz spvar11
|
||||
spvar31:stosb
|
||||
tst al
|
||||
jz spvar9
|
||||
spvar32:lodsb
|
||||
cmp al,'%'
|
||||
jne spvar31
|
||||
jmp spvar11
|
||||
spvar_dir:
|
||||
call addsep
|
||||
jmp spvar1
|
||||
spvar_sw:
|
||||
mov al,swchr
|
||||
jmp spvar11
|
||||
spvar_all:
|
||||
mov dh,-1
|
||||
spvar4:
|
||||
lodsb
|
||||
dec si
|
||||
cmp al,'1'
|
||||
jb spvar51
|
||||
cmp al,'9'
|
||||
ja spvar51
|
||||
inc si
|
||||
spvar5:
|
||||
mov dl,al ; %1 - %9
|
||||
sub dl,'1'
|
||||
spvar51:pushm <ax,bx,cx,si>
|
||||
call seekparm
|
||||
tst si
|
||||
jz spvar8
|
||||
tst dh
|
||||
js spvar52
|
||||
jnz spvar6
|
||||
push si
|
||||
call wordlen
|
||||
pop si
|
||||
jmps spvar7
|
||||
spvar52:push si
|
||||
call statelen
|
||||
pop si
|
||||
jmps spvar7
|
||||
spvar6:
|
||||
call parseparm
|
||||
spvar7:
|
||||
rep movsb
|
||||
spvar8: popm <si,cx,bx,ax>
|
||||
tst ah
|
||||
jnz spvar32
|
||||
jmp spvar1
|
||||
spreadvar endp
|
||||
|
||||
;--- Seek parameter ---
|
||||
;-->
|
||||
; DL :param No.(0:1st)
|
||||
; BX :param str ptr
|
||||
;<--
|
||||
; SI :param ptr
|
||||
|
||||
seekparm proc
|
||||
tst bx
|
||||
jz skpar0
|
||||
mov si,bx
|
||||
_repeat
|
||||
call skipspc
|
||||
tst al
|
||||
_break z
|
||||
cmp al,';'
|
||||
_break e
|
||||
tst dl
|
||||
jz skpar9
|
||||
call wordlen
|
||||
dec dl
|
||||
_until
|
||||
skpar0: clr si
|
||||
skpar9: VZ_RET
|
||||
seekparm endp
|
||||
|
||||
;--- Parse parmeter ---
|
||||
;-->
|
||||
; DH :extract mask
|
||||
; SI :param str ptr
|
||||
;<--
|
||||
; SI :str ptr
|
||||
; CX :str length
|
||||
|
||||
parseparm proc
|
||||
push di
|
||||
mov di,si
|
||||
call parsepath
|
||||
dec si
|
||||
test dl,VZ_PRS_DRV
|
||||
_ifn z
|
||||
or dl,VZ_PRS_DIR
|
||||
_endif
|
||||
and dl,VZ_PRS_DIR+VZ_PRS_NAME+VZ_PRS_EXT
|
||||
shl dh,1
|
||||
mov al,dl
|
||||
and al,dh
|
||||
jz papar0
|
||||
test al,VZ_PRS_DIR
|
||||
jnz papar2
|
||||
mov di,bx
|
||||
test al,VZ_PRS_NAME
|
||||
jnz papar2
|
||||
mov di,cx
|
||||
inc di
|
||||
papar2: xchg si,di
|
||||
mov ax,bx
|
||||
test dl,VZ_PRS_NAME
|
||||
jz papar3
|
||||
test dh,VZ_PRS_NAME+VZ_PRS_EXT
|
||||
jz papar4
|
||||
papar3: mov ax,cx
|
||||
test dl,VZ_PRS_EXT
|
||||
jz papar5
|
||||
test dh,VZ_PRS_EXT
|
||||
jnz papar5
|
||||
papar4: mov di,ax
|
||||
papar5: mov cx,di
|
||||
sub cx,si
|
||||
jmps papar9
|
||||
papar0: clr cx
|
||||
papar9: pop di
|
||||
VZ_RET
|
||||
parseparm endp
|
||||
|
||||
;--- Dump alias ---
|
||||
|
||||
public aliasmenu
|
||||
aliasmenu proc
|
||||
mov dl,MNU_ALIAS
|
||||
call schsysmenu
|
||||
jc almnu9
|
||||
mov bx,si
|
||||
mov [bx].mn_ext,offset cgroup:drawalias
|
||||
mov cx,-1
|
||||
call cntalias
|
||||
not cx
|
||||
mov [bx].mn_c,cl
|
||||
clr dx
|
||||
mov si,bx
|
||||
add si,type _menu
|
||||
call popupmenu
|
||||
almnu9: VZ_RET
|
||||
aliasmenu endp
|
||||
|
||||
drawalias proc
|
||||
tst ah
|
||||
_ifn z
|
||||
stc
|
||||
VZ_RET
|
||||
_endif
|
||||
mov cl,al
|
||||
clr ch
|
||||
call cntalias
|
||||
call puts_s
|
||||
mov dl,[bx].mn_valwd
|
||||
call fillspc
|
||||
call skipspc
|
||||
call puts
|
||||
VZ_RET
|
||||
drawalias endp
|
||||
|
||||
;--- Count alias ---
|
||||
;--> CX :count
|
||||
|
||||
cntalias proc
|
||||
mov si,aliasbuf
|
||||
push di
|
||||
mov di,si
|
||||
jcxz cntal8
|
||||
_repeat
|
||||
tstb [di]
|
||||
_break z
|
||||
call skipstr
|
||||
_loop
|
||||
cntal8: mov si,di
|
||||
pop di
|
||||
VZ_RET
|
||||
cntalias endp
|
||||
|
||||
;--- Parse command line ---
|
||||
;-->
|
||||
; SI :source str ptr
|
||||
; CX :str length
|
||||
;<--
|
||||
; SI :result str ptr
|
||||
; CX :reslut str length
|
||||
; NZ :found '%?'
|
||||
|
||||
public parseline
|
||||
parseline proc
|
||||
mov di,tmpbuf
|
||||
mov poolf,FALSE
|
||||
tst cx
|
||||
jmpl z,pacmd9
|
||||
call ems_savemap
|
||||
mov ax,farseg
|
||||
call ems_map
|
||||
push di
|
||||
cmp si,di ; ##100.12
|
||||
je pacmd10
|
||||
pacmd01:lodsb
|
||||
IFNDEF NOFILER
|
||||
cmp al,'%'
|
||||
je pacmd03
|
||||
ENDIF
|
||||
pacmd02:stosb
|
||||
tst al
|
||||
jnz pacmd01
|
||||
jmps pacmd10
|
||||
IFNDEF NOFILER
|
||||
pacmd03:
|
||||
tstw execcmd ; ##100.12
|
||||
jz pacmd02
|
||||
mov ah,al
|
||||
lodsb
|
||||
cmp al,'?'
|
||||
je pacmd_sel
|
||||
xchg al,ah
|
||||
stosb
|
||||
mov al,ah
|
||||
jmp pacmd02
|
||||
pacmd_sel:
|
||||
inc poolf
|
||||
pushm <si,ds>
|
||||
call poolnamep
|
||||
tst si
|
||||
_ifn z
|
||||
call strcpy
|
||||
; mov al,'.'
|
||||
; stosb
|
||||
; call strcpy
|
||||
_endif
|
||||
popm <ds,si>
|
||||
jmp pacmd01
|
||||
ENDIF
|
||||
pacmd10:
|
||||
pop si
|
||||
pacmd1: call skipspc
|
||||
tst al
|
||||
jz pacmd5
|
||||
call isatom
|
||||
jnc pacmd3
|
||||
push si
|
||||
call wordlen
|
||||
call skipspc
|
||||
mov bx,si
|
||||
mov si,di
|
||||
mov di,tmpbuf2
|
||||
push di
|
||||
call spreadvar
|
||||
dec di
|
||||
mov cx,di
|
||||
pop si
|
||||
sub cx,si
|
||||
pop di
|
||||
pushm <cx,si>
|
||||
mov si,di
|
||||
call statelen
|
||||
mov dx,cx
|
||||
popm <si,cx>
|
||||
mov bx,tmpbuf2+2
|
||||
call insertstr
|
||||
mov si,di
|
||||
pacmd3:
|
||||
call statelen
|
||||
tst al
|
||||
jz pacmd5
|
||||
inc si
|
||||
inc si
|
||||
jmp pacmd1
|
||||
pacmd5:
|
||||
mov si,tmpbuf
|
||||
call ems_loadmap
|
||||
pacmd9: tstb poolf
|
||||
VZ_RET
|
||||
parseline endp
|
||||
|
||||
;--- Next statement ---
|
||||
;--> SI :statement ptr
|
||||
;<-- AX :next statement ptr (NIL :end of line)
|
||||
|
||||
public nextstate
|
||||
nextstate proc
|
||||
clr ax
|
||||
jcxz next9
|
||||
mov al,[si]
|
||||
call isupper
|
||||
_if c
|
||||
mov doswapf,TRUE
|
||||
_endif
|
||||
push si
|
||||
call parsestate
|
||||
mov di,si
|
||||
pop si
|
||||
mov cx,di
|
||||
sub cx,si
|
||||
clr ah
|
||||
tst al
|
||||
jz next9
|
||||
clr al
|
||||
stosb
|
||||
inc di
|
||||
push si
|
||||
mov si,di
|
||||
call skipspc
|
||||
mov ax,si
|
||||
pop si
|
||||
next9: VZ_RET
|
||||
nextstate endp
|
||||
|
||||
;--- Parse statement (%%,%env%) ---
|
||||
;--> SI :statement ptr
|
||||
;<-- SI :statement end
|
||||
|
||||
public parsestate
|
||||
parsestate proc
|
||||
mov bx,tmpbuf2+2
|
||||
pastat1:
|
||||
lodsb
|
||||
pastat2:tst al
|
||||
jz pastat9
|
||||
cmp al,'%'
|
||||
je pastat3
|
||||
isnsptab pastat1
|
||||
lodsb
|
||||
cmp al,';'
|
||||
jne pastat2
|
||||
dec si
|
||||
jmps pastat9
|
||||
pastat3:
|
||||
lodsb
|
||||
dec si
|
||||
cmp al,'%'
|
||||
jne pastat4
|
||||
clr cx
|
||||
mov di,si
|
||||
mov dx,1
|
||||
call insertstr ; %% --> %
|
||||
jmp pastat1
|
||||
pastat4:
|
||||
mov di,si
|
||||
pastat5:
|
||||
lodsb
|
||||
tst al
|
||||
jz pastat9
|
||||
cmp al,'%'
|
||||
je pastat6
|
||||
call toupper
|
||||
jnc pastat5
|
||||
mov [si-1],al
|
||||
jmp pastat5
|
||||
pastat6:
|
||||
mov byte ptr [si-1],0
|
||||
pushm <si,di>
|
||||
mov si,di
|
||||
call scanenv
|
||||
mov cx,0
|
||||
_if c
|
||||
movseg ds,es
|
||||
mov si,di
|
||||
call strlen
|
||||
mov cx,ax
|
||||
_endif
|
||||
popm <dx,di>
|
||||
mov byte ptr ss:[di-1],'%'
|
||||
xchg dx,di
|
||||
dec di
|
||||
sub dx,di
|
||||
movseg es,ss
|
||||
call insertstr
|
||||
movseg ds,ss
|
||||
mov si,di
|
||||
add si,cx
|
||||
jmp pastat1
|
||||
pastat9:dec si
|
||||
VZ_RET
|
||||
parsestate endp
|
||||
|
||||
endes
|
||||
ENDIF
|
||||
end
|
||||
|
||||
;****************************
|
||||
; End of 'alias.asm'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
118
SRC/block.inc
118
SRC/block.inc
@ -1,118 +0,0 @@
|
||||
;----- New Block statement -----
|
||||
|
||||
$base = 0
|
||||
$shft = 1
|
||||
$bfld = 0
|
||||
$here = 0
|
||||
|
||||
_if macro cc
|
||||
$jcc n,cc,%$base
|
||||
$begin
|
||||
endm
|
||||
|
||||
_ifn macro cc
|
||||
$jcc <>,cc,%$base
|
||||
$begin
|
||||
endm
|
||||
|
||||
_else macro
|
||||
$end
|
||||
$jmp %$base
|
||||
$label %$here
|
||||
$begin
|
||||
endm
|
||||
|
||||
_endif macro
|
||||
$end
|
||||
$label %$here
|
||||
endm
|
||||
|
||||
_repeat macro
|
||||
$label %$base,_
|
||||
$begin
|
||||
endm
|
||||
|
||||
_until macro cc
|
||||
$end
|
||||
$jcc n,cc,%$here,_
|
||||
$label %$here
|
||||
endm
|
||||
|
||||
_while macro cc
|
||||
$end
|
||||
$jcc <>,cc,%$here,_
|
||||
$label %$here
|
||||
endm
|
||||
|
||||
_loop macro
|
||||
$end
|
||||
$loop %$here,_
|
||||
$label %$here
|
||||
endm
|
||||
|
||||
_break macro cc
|
||||
$cont
|
||||
$jcc <>,cc,%$here
|
||||
endm
|
||||
|
||||
_cont macro cc
|
||||
$cont
|
||||
$jcc <>,cc,%$here,_
|
||||
endm
|
||||
|
||||
$begin macro
|
||||
$base = $base + 1
|
||||
$bfld = $bfld or $shft
|
||||
$shft = $shft shl 1
|
||||
endm
|
||||
|
||||
$end macro
|
||||
$here = $base
|
||||
$test = $shft
|
||||
rept 16
|
||||
$test = $test shr 1
|
||||
$here = $here - 1
|
||||
if ($test le $bfld)
|
||||
$bfld = $bfld and (not $test)
|
||||
ife ($bfld)
|
||||
$shft = 1
|
||||
endif
|
||||
exitm
|
||||
endif
|
||||
endm
|
||||
endm
|
||||
|
||||
$cont macro
|
||||
$here = $base
|
||||
$test = $shft
|
||||
rept 16
|
||||
$test = $test shr 1
|
||||
$here = $here - 1
|
||||
if ($test le $bfld)
|
||||
exitm
|
||||
endif
|
||||
endm
|
||||
endm
|
||||
|
||||
$jmp macro L1,L2
|
||||
jmp short $L&L1&L2
|
||||
endm
|
||||
|
||||
$jcc macro n,cc,L1,L2
|
||||
ifnb <cc>
|
||||
j&n&cc $L&L1&L2
|
||||
else
|
||||
$jmp L1,L2
|
||||
endif
|
||||
endm
|
||||
|
||||
$loop macro L1,L2
|
||||
loop $L&L1&L2
|
||||
endm
|
||||
|
||||
$label macro L1,L2
|
||||
$L&L1&L2:
|
||||
endm
|
||||
|
||||
;----- End of block.inc -----
|
||||
|
461
SRC/char.asm
461
SRC/char.asm
@ -1,461 +0,0 @@
|
||||
;****************************
|
||||
; 'char.asm'
|
||||
;****************************
|
||||
|
||||
include vz.inc
|
||||
|
||||
bseg
|
||||
|
||||
;--- Is upper? ---
|
||||
;<-- CY :'A'-'Z'
|
||||
|
||||
public isupper
|
||||
isupper proc
|
||||
cmp al,'A'
|
||||
jb notup
|
||||
cmp al,'Z'
|
||||
ja notup
|
||||
stc
|
||||
isupr9: VZ_RET
|
||||
notup: clc
|
||||
VZ_RET
|
||||
isupper endp
|
||||
|
||||
;--- Is lower/alpha? ---
|
||||
;<-- CY :'a'-'z'|'A'-'Z'
|
||||
|
||||
public isalpha,islower
|
||||
isalpha proc
|
||||
call isupper
|
||||
jc isal9
|
||||
islower:
|
||||
cmp al,'a'
|
||||
jb notalp
|
||||
cmp al,'z'
|
||||
ja notalp
|
||||
stc
|
||||
VZ_RET
|
||||
notalp: clc
|
||||
isal9: VZ_RET
|
||||
isalpha endp
|
||||
|
||||
endbs
|
||||
|
||||
eseg
|
||||
|
||||
;--- Is digit ? ---
|
||||
;<-- CY :'0'-'9'
|
||||
|
||||
public isdigit
|
||||
isdigit proc
|
||||
cmp al,'0'
|
||||
jb notdig
|
||||
cmp al,'9'
|
||||
ja notdig
|
||||
stc
|
||||
VZ_RET
|
||||
notdig: clc
|
||||
VZ_RET
|
||||
isdigit endp
|
||||
|
||||
;--- Is kanji ? ---
|
||||
;<-- CY :kanji
|
||||
|
||||
public iskanji
|
||||
iskanji proc
|
||||
ifkanji kjyes
|
||||
clc
|
||||
VZ_RET
|
||||
kjyes: stc
|
||||
VZ_RET
|
||||
iskanji endp
|
||||
|
||||
;--- Char to upper/lower case ---
|
||||
;--> AL :char
|
||||
;<-- CY :converted
|
||||
|
||||
public toupper,tolower
|
||||
toupper proc
|
||||
call islower
|
||||
_if c
|
||||
sub al,'a'-'A'
|
||||
stc
|
||||
_endif
|
||||
VZ_RET
|
||||
toupper endp
|
||||
|
||||
tolower proc
|
||||
call isupper
|
||||
_if c
|
||||
add al,'a'-'A'
|
||||
stc
|
||||
_endif
|
||||
VZ_RET
|
||||
tolower endp
|
||||
|
||||
;--- String to upper/lower case ---
|
||||
; DS:SI :string ptr
|
||||
|
||||
public strupr,strlwr
|
||||
strupr proc
|
||||
_repeat
|
||||
lodsb
|
||||
tst al
|
||||
_break z
|
||||
call iskanji
|
||||
jc strup2
|
||||
call toupper
|
||||
_cont nc
|
||||
mov [si-1],al
|
||||
_cont
|
||||
strup2: lodsb
|
||||
_until
|
||||
VZ_RET
|
||||
strupr endp
|
||||
|
||||
strlwr proc
|
||||
_repeat
|
||||
lodsb
|
||||
tst al
|
||||
_break z
|
||||
call iskanji
|
||||
jc strlw2
|
||||
call tolower
|
||||
_cont nc
|
||||
mov [si-1],al
|
||||
_cont
|
||||
strlw2: lodsb
|
||||
_until
|
||||
VZ_RET
|
||||
strlwr endp
|
||||
|
||||
;--- Copy string ---
|
||||
;-->
|
||||
; DS:SI :source ptr
|
||||
; ES:DI :destin ptr
|
||||
|
||||
public strcpy
|
||||
strcpy proc
|
||||
_repeat
|
||||
lodsb
|
||||
stosb
|
||||
tst al
|
||||
_until z
|
||||
dec di
|
||||
VZ_RET
|
||||
strcpy endp
|
||||
|
||||
;--- Copy string (max) ---
|
||||
;-->
|
||||
; DS:SI :source ptr
|
||||
; ES:DI :destin ptr
|
||||
; CX :maximum byte
|
||||
|
||||
public strncpy
|
||||
strncpy proc
|
||||
jcxz sncpy2
|
||||
_repeat
|
||||
lodsb
|
||||
stosb
|
||||
tst al
|
||||
jz sncpy3
|
||||
_loop
|
||||
sncpy2: clr al
|
||||
stosb
|
||||
sncpy3: dec di
|
||||
VZ_RET
|
||||
strncpy endp
|
||||
|
||||
;--- Copy word ---
|
||||
;-->
|
||||
; DS:SI :source ptr
|
||||
; ES:DI :destin ptr
|
||||
|
||||
public wrdcpy
|
||||
wrdcpy proc
|
||||
_repeat
|
||||
lodsb
|
||||
stosb
|
||||
cmp al,SPC
|
||||
_until be
|
||||
dec si
|
||||
dec di
|
||||
mov byte ptr es:[di],0
|
||||
VZ_RET
|
||||
wrdcpy endp
|
||||
|
||||
;--- Compare two strings ---
|
||||
;--> SI,DI :string ptr
|
||||
;<-- ZR :equal
|
||||
|
||||
public strcmp,strcmp1
|
||||
strcmp proc
|
||||
pushm <si,di>
|
||||
call strcmp1
|
||||
popm <di,si>
|
||||
VZ_RET
|
||||
strcmp endp
|
||||
|
||||
strcmp1 proc
|
||||
push cx
|
||||
push di
|
||||
clr al
|
||||
mov cx,-1
|
||||
repnz scasb
|
||||
not cx
|
||||
pop di
|
||||
rep cmpsb
|
||||
mov al,es:[di-1]
|
||||
pop cx
|
||||
VZ_RET
|
||||
strcmp1 endp
|
||||
|
||||
;----- Ignore case compare -----
|
||||
;--> SI,DI :string ptr
|
||||
;<-- ZR :equal
|
||||
|
||||
public stricmp
|
||||
stricmp proc
|
||||
pushm <si,di>
|
||||
_repeat
|
||||
lodsb
|
||||
call toupper
|
||||
mov ah,al
|
||||
mov al,es:[di]
|
||||
inc di
|
||||
call toupper
|
||||
cmp al,ah
|
||||
_break ne
|
||||
tst al
|
||||
_until z
|
||||
popm <di,si>
|
||||
VZ_RET
|
||||
stricmp endp
|
||||
|
||||
;--- Ignore case word compare ---
|
||||
;--> SI,DI :string ptr
|
||||
;<-- CY :equal
|
||||
|
||||
public wrdicmp
|
||||
wrdicmp proc
|
||||
push si
|
||||
_repeat
|
||||
lodsb
|
||||
call toupper
|
||||
mov ah,al
|
||||
mov al,es:[di]
|
||||
inc di
|
||||
call toupper
|
||||
cmp al,SPC
|
||||
jbe wcmp1
|
||||
cmp al,ah
|
||||
_while e
|
||||
wcmp_x: clc
|
||||
dec di
|
||||
jmps wcmp9
|
||||
wcmp1: cmp ah,SPC
|
||||
ja wcmp_x
|
||||
stc
|
||||
wcmp9: mov ax,si ; AX=next si
|
||||
pop si
|
||||
VZ_RET
|
||||
wrdicmp endp
|
||||
|
||||
;--- String length ---
|
||||
;--> DS:SI :string ptr
|
||||
;<-- AX :length
|
||||
|
||||
public strlen
|
||||
strlen proc
|
||||
pushm <cx,di,es>
|
||||
movseg es,ds
|
||||
mov di,si
|
||||
call skipstr
|
||||
not ax
|
||||
dec ax
|
||||
popm <es,di,cx>
|
||||
VZ_RET
|
||||
strlen endp
|
||||
|
||||
public skipstr
|
||||
skipstr proc
|
||||
push cx
|
||||
clr al
|
||||
mov cx,-1
|
||||
repnz scasb
|
||||
mov ax,cx
|
||||
pop cx
|
||||
VZ_RET
|
||||
skipstr endp
|
||||
|
||||
public strskip
|
||||
strskip proc
|
||||
pushm <di,es>
|
||||
mov di,si
|
||||
movseg es,ds
|
||||
call skipstr
|
||||
mov si,di
|
||||
popm <es,di>
|
||||
VZ_RET
|
||||
strskip endp
|
||||
|
||||
;--- Skip SPC,TAB ---
|
||||
;<--
|
||||
; CY :end of line
|
||||
; NC :next char
|
||||
|
||||
public skipspc,skipspc1
|
||||
skipspc proc
|
||||
lodsb
|
||||
skipspc1:
|
||||
cmp al,TAB
|
||||
je skipspc
|
||||
cmp al,SPC
|
||||
je skipspc
|
||||
skpspc8:dec si
|
||||
VZ_RET
|
||||
skipspc endp
|
||||
|
||||
;--- Skip to next char ---
|
||||
;<--
|
||||
; CY :end of line
|
||||
; NC :next char
|
||||
|
||||
public skipchar
|
||||
skipchar proc
|
||||
_repeat
|
||||
lodsb
|
||||
cmp al,SPC
|
||||
_until be
|
||||
call skipspc1
|
||||
VZ_RET
|
||||
skipchar endp
|
||||
|
||||
;--- Change LF to NULL ---
|
||||
;--> DI :string ptr
|
||||
;<-- AX :string length
|
||||
|
||||
public lftonull
|
||||
lftonull proc
|
||||
push cx
|
||||
mov cx,-1
|
||||
mov al,LF
|
||||
repne scasb
|
||||
dec di
|
||||
mov ax,cx
|
||||
not ax
|
||||
dec ax
|
||||
mov byte ptr [di],0
|
||||
pop cx
|
||||
VZ_RET
|
||||
lftonull endp
|
||||
|
||||
;--- Scan CS:table ---
|
||||
|
||||
public scantbl
|
||||
scantbl proc
|
||||
push es
|
||||
movseg es,cs
|
||||
repne scasb
|
||||
pop es
|
||||
VZ_RET
|
||||
scantbl endp
|
||||
VZ_RET
|
||||
|
||||
;----- strchr(s,c) -----
|
||||
;<-- CY :found(SI:ptr, CX:index)
|
||||
|
||||
public strchr,strichr
|
||||
strchr proc
|
||||
push bx
|
||||
mov bh,FALSE
|
||||
jmps strchr1
|
||||
strichr: push bx
|
||||
mov bh,TRUE
|
||||
xchg ax,dx
|
||||
tst ah
|
||||
_if z
|
||||
call toupper
|
||||
_endif
|
||||
xchg ax,dx
|
||||
strchr1:
|
||||
clr cx
|
||||
_repeat
|
||||
inc cx
|
||||
lodsb
|
||||
tst bh
|
||||
_ifn z
|
||||
call toupper
|
||||
_endif
|
||||
clr ah
|
||||
tst al
|
||||
jz strchr_x
|
||||
_if s
|
||||
call iskanji
|
||||
_if c
|
||||
mov ah,al
|
||||
lodsb
|
||||
_endif
|
||||
_endif
|
||||
cmp ax,dx
|
||||
_until e
|
||||
dec cx
|
||||
dec si
|
||||
tst ah
|
||||
_ifn z
|
||||
dec si
|
||||
_endif
|
||||
stc
|
||||
strchr_x: pop bx
|
||||
VZ_RET
|
||||
strchr endp
|
||||
|
||||
;----- strstr(si,di) -----
|
||||
;<-- CY :found
|
||||
|
||||
public strstr,stristr
|
||||
strstr proc
|
||||
push bx
|
||||
mov bh,FALSE
|
||||
jmps strstr1
|
||||
stristr: push bx
|
||||
mov bh,TRUE
|
||||
strstr1: tst cx
|
||||
_if z
|
||||
dec cx
|
||||
_endif
|
||||
tstb [si]
|
||||
jz strstr9
|
||||
tst di
|
||||
jz strstr9
|
||||
_repeat
|
||||
tst bh
|
||||
_if z
|
||||
call strcmp
|
||||
_else
|
||||
call stricmp
|
||||
_endif
|
||||
tst al
|
||||
stc
|
||||
je strstr9
|
||||
lodsb
|
||||
call iskanji
|
||||
_if c
|
||||
inc si
|
||||
_endif
|
||||
tstb [si]
|
||||
jz strstr8
|
||||
_loop
|
||||
strstr8: clc
|
||||
strstr9: pop bx
|
||||
VZ_RET
|
||||
strstr endp
|
||||
|
||||
endes
|
||||
end
|
||||
|
||||
;****************************
|
||||
; 'char.asm'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
||||
|
240
SRC/chktsr.asm
240
SRC/chktsr.asm
@ -1,240 +0,0 @@
|
||||
;****************************
|
||||
; 'chktsr.asm'
|
||||
;****************************
|
||||
|
||||
STDSEG equ TRUE
|
||||
|
||||
include std.inc
|
||||
|
||||
cseg
|
||||
assume ds:code
|
||||
|
||||
;--- PSP definitions ---
|
||||
|
||||
org 2Ch
|
||||
envseg label word
|
||||
|
||||
org 81h
|
||||
cmdline label byte
|
||||
|
||||
;--- CHKTSR Main ---
|
||||
|
||||
org 100h
|
||||
main proc
|
||||
mov si,offset cmdline
|
||||
call skipspc
|
||||
jc error
|
||||
call scanhexa
|
||||
jc error
|
||||
call skipspc
|
||||
_if c
|
||||
error:
|
||||
mov dx,offset mg_title
|
||||
msdos F_DSPSTR
|
||||
mov al,0
|
||||
jmp exit
|
||||
_endif
|
||||
mov bx,dx
|
||||
shlm bx,2
|
||||
ldseg es,0
|
||||
mov bx,es:[bx+2]
|
||||
mov es,bx
|
||||
|
||||
chk_env:
|
||||
mov ax,es:envseg
|
||||
tst ax
|
||||
jz chk_psp
|
||||
dec ax
|
||||
mov es,ax
|
||||
mov dx,es:[0001h]
|
||||
cmp dx,bx
|
||||
jne chk_psp
|
||||
inc ax
|
||||
mov es,ax
|
||||
clr al
|
||||
clr di
|
||||
mov cx,-1
|
||||
_repeat
|
||||
repnz scasb
|
||||
tstb es:[di]
|
||||
_until z
|
||||
inc di
|
||||
cmp word ptr es:[di],0001h
|
||||
jne chk_psp
|
||||
inc di
|
||||
inc di
|
||||
push bx
|
||||
call stristr
|
||||
pop bx
|
||||
jc found_tsr
|
||||
|
||||
chk_psp:
|
||||
mov es,bx
|
||||
mov di,offset cmdline
|
||||
call stristr
|
||||
mov al,0
|
||||
_if c
|
||||
found_tsr:
|
||||
mov al,1
|
||||
_endif
|
||||
exit: msdos F_TERM
|
||||
main endp
|
||||
|
||||
;--- Scan hexa ---
|
||||
;-->
|
||||
; SI : string ptr
|
||||
;<--
|
||||
; CY : error
|
||||
; DX : hexadecimal value
|
||||
|
||||
scanhexa proc
|
||||
clr dx
|
||||
_repeat
|
||||
lodsb
|
||||
cmp al,SPC
|
||||
_break be
|
||||
call isdigit
|
||||
jc schex1
|
||||
call toupper
|
||||
cmp al,'A'
|
||||
jb schex_x
|
||||
cmp al,'F'
|
||||
ja schex_x
|
||||
sub al,'A'-10-'0'
|
||||
schex1: sub al,'0'
|
||||
cbw
|
||||
mov cl,4
|
||||
shl dx,cl
|
||||
add dx,ax
|
||||
_until
|
||||
tst dx
|
||||
_if z
|
||||
schex_x:stc
|
||||
_endif
|
||||
dec si
|
||||
VZ_RET
|
||||
scanhexa endp
|
||||
|
||||
;--- Scan substring2 in string1 (ignore case) ---
|
||||
;-->
|
||||
; DS:SI :substring2 ptr
|
||||
; ES:DI :target string1 ptr
|
||||
; (string terminater is 00h or 0Dh)
|
||||
;<-- CY :found
|
||||
|
||||
stristr proc
|
||||
mov dx,si
|
||||
stri1: mov bx,di
|
||||
stri2: lodsb
|
||||
cmp al,CR
|
||||
je stri_o
|
||||
call toupper
|
||||
mov ah,al
|
||||
mov al,es:[di]
|
||||
inc di
|
||||
tst al
|
||||
jz stri_x
|
||||
cmp al,CR
|
||||
jz stri_x
|
||||
call toupper
|
||||
cmp al,ah
|
||||
je stri2
|
||||
mov si,dx
|
||||
mov di,bx
|
||||
inc di
|
||||
jmp stri1
|
||||
stri_o: stc
|
||||
stri_x: VZ_RET
|
||||
stristr endp
|
||||
|
||||
;--- Is upper? ---
|
||||
;<-- CY :'A'-'Z'
|
||||
|
||||
isupper proc
|
||||
cmp al,'A'
|
||||
jb notup
|
||||
cmp al,'Z'
|
||||
ja notup
|
||||
stc
|
||||
isupr9: VZ_RET
|
||||
notup: clc
|
||||
VZ_RET
|
||||
isupper endp
|
||||
|
||||
;--- Is lower/alpha? ---
|
||||
;<-- CY :'a'-'z'|'A'-'Z'
|
||||
|
||||
isalpha proc
|
||||
call isupper
|
||||
jc isal9
|
||||
islower:
|
||||
cmp al,'a'
|
||||
jb notalp
|
||||
cmp al,'z'
|
||||
ja notalp
|
||||
stc
|
||||
VZ_RET
|
||||
notalp: clc
|
||||
isal9: VZ_RET
|
||||
isalpha endp
|
||||
|
||||
;--- Is digit ? ---
|
||||
;<-- CY :'0'-'9'
|
||||
|
||||
isdigit proc
|
||||
cmp al,'0'
|
||||
jb notdig
|
||||
cmp al,'9'
|
||||
ja notdig
|
||||
stc
|
||||
VZ_RET
|
||||
notdig: clc
|
||||
VZ_RET
|
||||
isdigit endp
|
||||
|
||||
;--- Char to upper/lower case ---
|
||||
;--> AL :char
|
||||
;<-- CY :converted
|
||||
|
||||
toupper proc
|
||||
call islower
|
||||
_if c
|
||||
sub al,'a'-'A'
|
||||
stc
|
||||
_endif
|
||||
VZ_RET
|
||||
toupper endp
|
||||
|
||||
;--- Skip SPC,TAB ---
|
||||
;<--
|
||||
; CY :end of line
|
||||
; NC :next char
|
||||
|
||||
skipspc proc
|
||||
lodsb
|
||||
skipspc1:
|
||||
cmp al,TAB
|
||||
je skipspc
|
||||
cmp al,SPC
|
||||
je skipspc
|
||||
skpspc8:dec si
|
||||
VZ_RET
|
||||
skipspc endp
|
||||
|
||||
;--- Messages ---
|
||||
|
||||
mg_title db "CHKTSR Version 1.00"
|
||||
db " Copyright (C) 1990 by c.mos",CR,LF
|
||||
db "Usage: chktsr <int#(hexa)> <search string>",CR,LF
|
||||
db " ex: chktsr 21 vz",CR,LF
|
||||
db " (if found, return errorlevel 1)",CR,LF
|
||||
db '$'
|
||||
|
||||
endcs
|
||||
end main
|
||||
|
||||
;****************************
|
||||
; End of 'chktsr.asm'
|
||||
; Copyright (C) 1990 by c.mos
|
||||
;****************************
|
||||
|
1428
SRC/core.asm
1428
SRC/core.asm
File diff suppressed because it is too large
Load Diff
@ -1,74 +0,0 @@
|
||||
;------------------------------------------------
|
||||
; ctype.inc
|
||||
;
|
||||
; Copyright (c) 1992 by c.mos
|
||||
;------------------------------------------------
|
||||
|
||||
;----- Equations -----
|
||||
|
||||
_10 equ 00000010b ; 10 digit
|
||||
_UP equ 00000100b ; upper case
|
||||
_LO equ 00001000b ; lower case
|
||||
_16 equ 00010000b ; hexa decimal
|
||||
_FN equ 10000000b ; file name char
|
||||
|
||||
|
||||
;----- Is upper/lower/alpha/digit/kanji? -----
|
||||
;--> AL :char
|
||||
;<-- CY :yes
|
||||
|
||||
public isupper,isalpha,islower,isdigit,iskanji
|
||||
isupper: cmp al,'A'
|
||||
jb isnot
|
||||
cmp al,'Z'+1
|
||||
VZ_RET
|
||||
|
||||
isalpha: call isupper
|
||||
jc isal9
|
||||
islower: cmp al,'a'
|
||||
jb isnot
|
||||
cmp al,'z'+1
|
||||
isal9: VZ_RET
|
||||
|
||||
isdigit: cmp al,'0'
|
||||
jb isnot
|
||||
cmp al,'9'+1
|
||||
VZ_RET
|
||||
|
||||
iskanji: ifkanji yes
|
||||
isnot: clc
|
||||
VZ_RET
|
||||
|
||||
;----- Is file name? -----
|
||||
;--> AL :char (20h<=AL<80h)
|
||||
;<-- CY :file name
|
||||
|
||||
public isfilename
|
||||
isfilename proc
|
||||
pushm <bx,cx>
|
||||
mov cl,al
|
||||
and cl,7
|
||||
mov ch,80h
|
||||
shr ch,cl
|
||||
mov bl,al
|
||||
clr bh
|
||||
shrm bx,3
|
||||
add bx,offset cgroup: fnbittbl - 4
|
||||
test byte ptr [bx],ch
|
||||
popm <cx,bx>
|
||||
jz isfl9
|
||||
yes: stc
|
||||
isfl9: VZ_RET
|
||||
isfilename endp
|
||||
|
||||
fnbittbl db 01011111b,11000100b,11111111b,11000000b
|
||||
; !"#$%&' ()*+,-./ 01234567 89:;<=>?
|
||||
db 11111111b,11111111b,11111111b,11100011b
|
||||
; @ABCDEFG HIJKLMNO PQRSTUVW XYZ[\]^_
|
||||
db 11111111b,11111111b,11111111b,11110110b
|
||||
; `abcdefg hijklmno pqrstuvw xyz{|}~
|
||||
|
||||
;------------------------------------------------
|
||||
; End of ctype.inc
|
||||
;------------------------------------------------
|
||||
|
968
SRC/disp.asm
968
SRC/disp.asm
@ -1,968 +0,0 @@
|
||||
;****************************
|
||||
; 'disp.asm'
|
||||
;****************************
|
||||
|
||||
include vz.inc
|
||||
|
||||
;--- Equations ---
|
||||
|
||||
;CHARCODE equ FALSE
|
||||
MAC_GETC equ 01000000b
|
||||
|
||||
;--- External symbols ---
|
||||
|
||||
wseg
|
||||
extrn dspkeyf :byte
|
||||
extrn dspsw :byte
|
||||
extrn edtsw :byte
|
||||
extrn syssw :byte
|
||||
extrn linecnt :byte
|
||||
extrn hardware :byte
|
||||
extrn msgon :byte
|
||||
extrn pagm :byte
|
||||
extrn vsplit :byte
|
||||
|
||||
extrn gends :word
|
||||
extrn macmode :word
|
||||
extrn opnpath :word
|
||||
extrn pagec :word
|
||||
extrn prompt :word
|
||||
extrn retval :word
|
||||
extrn rends :word
|
||||
extrn sbuf :word
|
||||
extrn send :word
|
||||
extrn sends :word
|
||||
extrn sysmode :word
|
||||
extrn w_act :word
|
||||
extrn doswd :word
|
||||
extrn pfbufp :word
|
||||
extrn atrpath :word
|
||||
extrn silent :word
|
||||
endws
|
||||
|
||||
extrn sym_page :word
|
||||
extrn abputc :near
|
||||
extrn cls2 :near
|
||||
extrn csroff :near
|
||||
extrn dosheight :near
|
||||
extrn doswindow :near
|
||||
extrn fillset :near
|
||||
extrn fillspc :near
|
||||
extrn getatr :near
|
||||
extrn getc :near
|
||||
extrn getloc :near
|
||||
extrn getwindow :near
|
||||
extrn gputc :near
|
||||
extrn issilent :near
|
||||
extrn isviewmode :near
|
||||
extrn loadwloc :near
|
||||
extrn locate :near
|
||||
extrn message :near
|
||||
extrn mg_ask :near
|
||||
; extrn mg_pass :near
|
||||
extrn mkscrnp :near
|
||||
; extrn offmacro :near
|
||||
extrn printf :near
|
||||
extrn sprintf :near
|
||||
extrn putc :near
|
||||
extrn putcw :near
|
||||
extrn puts :near
|
||||
extrn putspc :near
|
||||
extrn puts_t :near
|
||||
extrn revatr :near
|
||||
extrn savewloc :near
|
||||
extrn setatr :near
|
||||
extrn setatr2 :near
|
||||
extrn set_attr :near
|
||||
extrn setwindow :near
|
||||
extrn skipstr :near
|
||||
extrn vlinec :near
|
||||
extrn vputc :near
|
||||
extrn get_indichar :near
|
||||
extrn isdnumb :near
|
||||
extrn off_silent :near
|
||||
|
||||
dseg
|
||||
|
||||
;--- Local work ---
|
||||
|
||||
clrkey db 0
|
||||
|
||||
endds
|
||||
|
||||
cseg
|
||||
|
||||
;--- Constants ---
|
||||
|
||||
pf_pass db '"%32s"',0
|
||||
pf_linecolm db "%5u:%-3d",0
|
||||
pf_dlinecolm db "%5u|%-3d",0
|
||||
pf_linenum db "%5u:",0
|
||||
pf_linespc db " ",0
|
||||
pf_dispnum db "%5u|",0
|
||||
pf_pagenum db "P%-4u|",0
|
||||
;IF CHARCODE
|
||||
;pf_sysparm db "+%-4d[%4xh]%7ld/text %3uk/free",0
|
||||
;ELSE
|
||||
;pf_sysparm db "%7ld/text %5u/stack %3uk/free",0
|
||||
;ENDIF
|
||||
pf_bytechar db " [ %02xh ]",0
|
||||
pf_wordchar db " [%04xh]",0
|
||||
pf_sysparm db "%8ld %3u%% (%5u) %3uK",0
|
||||
; code text ptr stack free
|
||||
|
||||
endcs
|
||||
|
||||
eseg
|
||||
assume ds:nothing
|
||||
|
||||
;--- New line ---
|
||||
|
||||
public newline
|
||||
newline proc
|
||||
pushf
|
||||
pushm <ax,cx,dx>
|
||||
call doswindow
|
||||
call setwindow
|
||||
mov dh,ch
|
||||
dec dh
|
||||
clr dl
|
||||
call locate
|
||||
mov al,ATR_MSG
|
||||
call setatr
|
||||
mov ch,1
|
||||
call cls2
|
||||
mov msgon,-1
|
||||
popm <dx,cx,ax>
|
||||
popf
|
||||
VZ_RET
|
||||
newline endp
|
||||
|
||||
endes
|
||||
|
||||
cseg
|
||||
|
||||
;--- Display message ---
|
||||
; DL :message No.
|
||||
; BX :parameter "ptr" ; ##156.118
|
||||
|
||||
public dispmsg
|
||||
dispmsg proc
|
||||
pushm <dx,si,di,ds>
|
||||
call newline
|
||||
call messagep
|
||||
lodsb
|
||||
cmp al,1
|
||||
_if e
|
||||
call printf
|
||||
_else
|
||||
cmp al,3
|
||||
_if be
|
||||
; push ds
|
||||
mov ax,opnpath
|
||||
jb fpath
|
||||
tst ax
|
||||
_if z
|
||||
fpath: lea ax,[bp].path
|
||||
; movseg ds,ss
|
||||
_endif
|
||||
push si
|
||||
mov si,offset cgroup:pf_pass
|
||||
push ax
|
||||
mov bx,sp
|
||||
call printf
|
||||
pop ax
|
||||
pop si
|
||||
; pop ds
|
||||
_else
|
||||
dec si
|
||||
_endif
|
||||
call puts
|
||||
_endif
|
||||
neg msgon
|
||||
call getloc ; ##156.139
|
||||
call locate
|
||||
popm <ds,di,si,dx>
|
||||
VZ_RET
|
||||
dispmsg endp
|
||||
|
||||
messagep proc
|
||||
movseg ds,cs
|
||||
movseg es,cs
|
||||
mov di,offset cgroup:message
|
||||
_repeat
|
||||
call skipstr
|
||||
dec dl
|
||||
_until z
|
||||
mov si,di
|
||||
VZ_RET
|
||||
messagep endp
|
||||
|
||||
assume ds:cgroup
|
||||
|
||||
;--- Display current string ---
|
||||
|
||||
public dispstr
|
||||
dispstr proc
|
||||
push ds
|
||||
movseg ds,ss
|
||||
call newline
|
||||
neg msgon
|
||||
mov al,ATR_MSG
|
||||
call setatr
|
||||
mov si,sbuf
|
||||
call puts
|
||||
pop ds
|
||||
VZ_RET
|
||||
dispstr endp
|
||||
|
||||
assume ds:nothing
|
||||
|
||||
;--- Ask Y/N ? ---
|
||||
;--> DL :message No.
|
||||
;<-- NC,ZR,AX=0:no, NC,NZ,AX=1:yes, CY:escape
|
||||
|
||||
public dispask,dispaskn
|
||||
dispask proc
|
||||
call dispmsg
|
||||
dispask1:
|
||||
mov si,offset cgroup:mg_ask
|
||||
call putmg
|
||||
ask1: mov al,CSR_INS
|
||||
call getc
|
||||
jc ask_c
|
||||
cmp al,'Y'
|
||||
je ask_y
|
||||
cmp al,'N'
|
||||
je ask_n
|
||||
mov ah,syssw
|
||||
test ah,SW_YES+SW_REVYN
|
||||
_ifn z
|
||||
test ah,SW_REVYN
|
||||
_if z
|
||||
cmp al,CM_CR
|
||||
je ask_y
|
||||
cmp al,SPC
|
||||
je ask_n
|
||||
_else
|
||||
cmp al,CM_CR
|
||||
je ask_n
|
||||
cmp al,SPC
|
||||
je ask_y
|
||||
_endif
|
||||
_endif
|
||||
jmp ask1
|
||||
ask_c: mov ax,-1
|
||||
jmps ask8
|
||||
ask_y: mov ax,TRUE
|
||||
jmps ask7
|
||||
ask_n: mov ax,FALSE
|
||||
ask7: tst ax
|
||||
ask8: pushf
|
||||
push ax
|
||||
call newline
|
||||
call csroff
|
||||
pop ax
|
||||
popf
|
||||
VZ_RET
|
||||
|
||||
dispaskn:
|
||||
mov al,dl
|
||||
call getloc
|
||||
push dx
|
||||
mov dl,al
|
||||
call dispmsg
|
||||
mov si,offset cgroup:mg_ask
|
||||
call putmg
|
||||
pop dx
|
||||
call locate
|
||||
jmp ask1
|
||||
dispask endp
|
||||
|
||||
;--- Display split pole ---
|
||||
; DH,CH :pole def.
|
||||
|
||||
public disppole
|
||||
disppole proc
|
||||
mov al,ATR_TXT
|
||||
call setatr
|
||||
mov dl,vsplit
|
||||
call locate
|
||||
call vlinec
|
||||
VZ_RET
|
||||
disppole endp
|
||||
|
||||
;****************************
|
||||
; Display status line
|
||||
;****************************
|
||||
; DS :text segment
|
||||
|
||||
assume ds:cgroup
|
||||
|
||||
public dispstat
|
||||
dispstat proc
|
||||
call issilent
|
||||
push ds
|
||||
movseg ds,ss
|
||||
call setatr_r
|
||||
mov al,[bp].wsplit
|
||||
mov cx,doswd ; ##156.123
|
||||
cmp al,SPLIT_V ; ##156.99
|
||||
_if ae
|
||||
shr cx,1
|
||||
clr dx
|
||||
cmp al,SPLIT_L
|
||||
_ifn e
|
||||
mov dl,cl
|
||||
_endif
|
||||
sub cx,WD/2
|
||||
pushm <cx,dx>
|
||||
call locate
|
||||
mov al,GRC_VL
|
||||
call gputc
|
||||
call editmode
|
||||
call indibar
|
||||
popm <dx,cx>
|
||||
push cx
|
||||
_ifn cxz
|
||||
call gputc
|
||||
dec cx
|
||||
_endif
|
||||
call fillright
|
||||
inc dh
|
||||
call locate
|
||||
call setatr_p
|
||||
mov al,GRC_VL
|
||||
call gputc
|
||||
call displabel1
|
||||
call linecolm
|
||||
call putspc
|
||||
_else
|
||||
sub cx,WD
|
||||
push cx
|
||||
clr dl
|
||||
mov dh,[bp].tw_py
|
||||
dec dh
|
||||
call locate
|
||||
call putspc
|
||||
call editmode
|
||||
test word ptr dspsw,DSP_STLHEAD
|
||||
_ifn z
|
||||
call setatr_p
|
||||
call putspc
|
||||
call displabel1
|
||||
call linecolm
|
||||
call indibar
|
||||
call gputc
|
||||
_else
|
||||
call putspc
|
||||
call linecolm
|
||||
call indibar
|
||||
call setatr_p
|
||||
call gputc
|
||||
call displabel1
|
||||
_endif
|
||||
_endif
|
||||
pop cx
|
||||
call fillright
|
||||
mov al,ATR_TXT
|
||||
call setatr
|
||||
pop ds
|
||||
VZ_RET
|
||||
|
||||
setatr_r:
|
||||
mov al,[bp].atrstt1
|
||||
tst al
|
||||
_ifn z
|
||||
call set_attr
|
||||
VZ_RET
|
||||
_endif
|
||||
mov al,ATR_STT
|
||||
tstb [bp].tchf
|
||||
_if s
|
||||
mov al,ATR_STTR
|
||||
_endif
|
||||
tstb [bp].wnum
|
||||
_if z
|
||||
mov al,ATR_STT2
|
||||
_endif
|
||||
call setatr
|
||||
VZ_RET
|
||||
|
||||
fillright proc
|
||||
_ifn cxz
|
||||
_repeat
|
||||
call putspc
|
||||
_loop
|
||||
_endif
|
||||
VZ_RET
|
||||
fillright endp
|
||||
|
||||
;--- Edit mode ---
|
||||
|
||||
editmode:
|
||||
mov bx,offset cgroup:sym_page
|
||||
mov al,pagm
|
||||
cmp al,PG_STRSCH
|
||||
_if ae
|
||||
call revatr
|
||||
mov al,PG_STRSCH
|
||||
_endif
|
||||
shl al,1
|
||||
cbw
|
||||
add bx,ax
|
||||
mov dx,cs:[bx]
|
||||
xchg dl,dh
|
||||
call putcw
|
||||
call setatr_r
|
||||
call putspc
|
||||
|
||||
tstb [bp].blkm
|
||||
_ifn z
|
||||
call revatr
|
||||
_endif
|
||||
mov dx,cs:sym_page+6
|
||||
xchg dl,dh
|
||||
call putcw
|
||||
jmp setatr_r
|
||||
|
||||
;--- Line/Column number ---
|
||||
|
||||
linecolm:
|
||||
mov al,[bp].lx
|
||||
clr ah
|
||||
inc ax
|
||||
push ax
|
||||
mov ax,[bp].lnumb
|
||||
mov si,offset cgroup:pf_linecolm
|
||||
call isdnumb
|
||||
_ifn z
|
||||
mov ax,[bp].dnumb
|
||||
mov si,offset cgroup:pf_dlinecolm
|
||||
_endif
|
||||
push ax
|
||||
mov bx,sp
|
||||
call printf
|
||||
add sp,4
|
||||
VZ_RET
|
||||
|
||||
;--- Indicator bar ---
|
||||
|
||||
indibar:
|
||||
test dspsw,DSP_SYS
|
||||
jnz sysparm
|
||||
mov al,GRC_VR
|
||||
call gputc
|
||||
call fillset
|
||||
call getcurptr
|
||||
tst dh
|
||||
_ifn z
|
||||
mov ax,-1
|
||||
mov dl,al
|
||||
_endif
|
||||
mov dh,dl
|
||||
mov dl,ah
|
||||
mov ah,al
|
||||
clr al
|
||||
_repeat
|
||||
_break cxz
|
||||
shr cx,1
|
||||
rcr bx,1
|
||||
shr dx,1
|
||||
rcr ax,1
|
||||
_until
|
||||
tst bx
|
||||
_ifn z
|
||||
div bx
|
||||
mov dx,ax
|
||||
_endif
|
||||
mov cl,3
|
||||
shr dx,cl
|
||||
mov cx,ax
|
||||
and cl,7
|
||||
test hardware,IDN_PC98
|
||||
_ifn z
|
||||
shr cl,1
|
||||
shr cl,1
|
||||
_endif
|
||||
push dx
|
||||
tst dx
|
||||
_ifn z
|
||||
_repeat
|
||||
call putspc
|
||||
dec dx
|
||||
_until z
|
||||
_endif
|
||||
call revatr
|
||||
mov al,SPC
|
||||
tst cl
|
||||
_ifn z
|
||||
call get_indichar
|
||||
_endif
|
||||
call gputc
|
||||
push ax
|
||||
call revatr
|
||||
pop ax
|
||||
pop dx
|
||||
cmp dl,32
|
||||
_ifn e
|
||||
call gputc
|
||||
_endif
|
||||
mov dl,33
|
||||
call fillspc
|
||||
mov al,GRC_VL
|
||||
VZ_RET
|
||||
|
||||
;--- System parameter ---
|
||||
|
||||
sysparm:
|
||||
mov si,offset cgroup:pf_bytechar
|
||||
call gettcp
|
||||
inc ax
|
||||
cmp ax,[bp].tend
|
||||
mov ax,EOF
|
||||
_if b
|
||||
mov ax,[bp].ccode
|
||||
cmp ax,CR
|
||||
_if e
|
||||
mov ax,0D0Ah
|
||||
_endif
|
||||
tst ah
|
||||
_ifn z
|
||||
mov si,offset cgroup:pf_wordchar
|
||||
_endif
|
||||
_endif
|
||||
push ax
|
||||
mov bx,sp
|
||||
call printf
|
||||
pop ax
|
||||
|
||||
mov ax,gends
|
||||
mov dx,sends
|
||||
test dh,EMSMASK
|
||||
_if z
|
||||
mov dx,rends ; rtops
|
||||
_endif
|
||||
sub ax,dx
|
||||
mov cl,6
|
||||
shr ax,cl
|
||||
push ax ; /free
|
||||
push send ; /stack
|
||||
call getcurptr
|
||||
_if ae
|
||||
mov ax,100
|
||||
jmps sys_cp
|
||||
_endif
|
||||
pushm <cx,bx>
|
||||
_repeat
|
||||
_break cxz
|
||||
shr cx,1
|
||||
rcr bx,1
|
||||
shr dx,1
|
||||
rcr ax,1
|
||||
_until
|
||||
mov si,100
|
||||
mul si
|
||||
div bx
|
||||
popm <bx,cx>
|
||||
sys_cp: push ax ; %
|
||||
pushm <cx,bx> ; /text
|
||||
|
||||
mov bx,sp
|
||||
mov si,offset cgroup:pf_sysparm
|
||||
call printf
|
||||
add sp,10
|
||||
VZ_RET
|
||||
dispstat endp
|
||||
|
||||
assume ds:nothing
|
||||
|
||||
;--- Calc text size ---
|
||||
;<-- DX:AX :text size
|
||||
|
||||
public textsize
|
||||
textsize proc
|
||||
tstl [bp].readp
|
||||
_ifn z
|
||||
ldl [bp].eofp
|
||||
call isviewmode ; ##16
|
||||
je tsize9
|
||||
add ax,1
|
||||
adc dx,0
|
||||
subl [bp].readp
|
||||
_else
|
||||
clr ax
|
||||
cwd
|
||||
_endif
|
||||
addl [bp].headp
|
||||
addl [bp].tailp
|
||||
add ax,[bp].tend
|
||||
adc dx,0
|
||||
sub ax,[bp].ttop
|
||||
sbb dx,0
|
||||
test edtsw,EDT_EOF
|
||||
_if z
|
||||
sub ax,1
|
||||
sbb dx,0
|
||||
_endif
|
||||
tsize9: VZ_RET
|
||||
textsize endp
|
||||
|
||||
;--- Get current ptr ---
|
||||
;<--
|
||||
; DX:AX :current ptr
|
||||
; CX:BX :text size
|
||||
|
||||
getcurptr proc
|
||||
call textsize
|
||||
pushm <dx,ax>
|
||||
call gettcp
|
||||
sub ax,[bp].ttop
|
||||
clr dx
|
||||
addl [bp].headp
|
||||
popm <bx,cx>
|
||||
cmphl cx,bx
|
||||
_if a
|
||||
mov dx,cx
|
||||
mov ax,bx
|
||||
_endif
|
||||
VZ_RET
|
||||
getcurptr endp
|
||||
|
||||
gettcp proc
|
||||
mov ax,[bp].tcp
|
||||
tstb [bp].inbuf
|
||||
_ifn z
|
||||
sub ax,[bp].btop
|
||||
add ax,[bp].tnow
|
||||
cmp ax,[bp].tnxt
|
||||
_if a
|
||||
mov ax,[bp].tnxt
|
||||
_endif
|
||||
_endif
|
||||
VZ_RET
|
||||
gettcp endp
|
||||
|
||||
;--- Display text label ---
|
||||
|
||||
setatr_p proc
|
||||
push ax
|
||||
mov al,[bp].atrpath1
|
||||
tst al
|
||||
_ifn z
|
||||
call set_attr
|
||||
_else
|
||||
tstw atrpath
|
||||
_ifn z
|
||||
mov al,ATR_PATH
|
||||
call setatr
|
||||
_endif
|
||||
_endif
|
||||
pop ax
|
||||
VZ_RET
|
||||
setatr_p endp
|
||||
|
||||
displabel1 proc
|
||||
call fillset
|
||||
call displabel
|
||||
call putspc
|
||||
call setatr_r
|
||||
VZ_RET
|
||||
displabel1 endp
|
||||
|
||||
public displabel
|
||||
displabel proc
|
||||
mov al,[bp].wnum
|
||||
add al,'0'
|
||||
cmp al,'9'
|
||||
_if a
|
||||
add al,'A'-'9'-1
|
||||
cmp al,'Z'
|
||||
_if a
|
||||
mov al,SPC
|
||||
_endif
|
||||
_endif
|
||||
call putc
|
||||
mov al,SPC
|
||||
cmp [bp].tchf,0
|
||||
_ifn e
|
||||
mov al,'*'
|
||||
_if le
|
||||
mov al,'R'
|
||||
call isviewmode
|
||||
_if e
|
||||
mov al,'V'
|
||||
_endif
|
||||
_endif
|
||||
_endif
|
||||
call putc
|
||||
call putspc
|
||||
push ds
|
||||
mov si,[bp].labelp
|
||||
movseg ds,ss
|
||||
call puts
|
||||
pop ds
|
||||
mov dl,28
|
||||
call fillspc
|
||||
VZ_RET
|
||||
displabel endp
|
||||
|
||||
;--- Display Line header ---
|
||||
; SI :text pointer
|
||||
; CL :y pos
|
||||
; DX :line number
|
||||
|
||||
public disphead
|
||||
disphead proc
|
||||
push dx
|
||||
mov dx,word ptr [bp].tw_px
|
||||
add dh,cl
|
||||
call locate
|
||||
pop dx
|
||||
push dx
|
||||
mov al,dspsw
|
||||
or al,[bp].dspsw1
|
||||
test al,DSP_NUM
|
||||
_ifn z
|
||||
mov al,ATR_NUM
|
||||
call setatr
|
||||
push si
|
||||
call isdnumb
|
||||
_if z
|
||||
cmp byte ptr [si-1],LF
|
||||
mov si,offset cgroup:pf_linenum
|
||||
_ifn e
|
||||
mov si,offset cgroup:pf_linespc
|
||||
_endif
|
||||
_else
|
||||
mov si,offset cgroup:pf_dispnum
|
||||
mov bx,pagec
|
||||
tst bx
|
||||
_ifn z
|
||||
dec dx
|
||||
mov ax,dx
|
||||
clr dx
|
||||
div bx
|
||||
tst dx
|
||||
_if z
|
||||
mov dx,ax
|
||||
mov si,offset cgroup:pf_pagenum
|
||||
_endif
|
||||
inc dx
|
||||
_endif
|
||||
_endif
|
||||
; push ds
|
||||
; movseg ds,cs
|
||||
push dx
|
||||
mov bx,sp
|
||||
call printf
|
||||
pop dx
|
||||
; pop ds
|
||||
pop si
|
||||
_endif
|
||||
pop dx
|
||||
VZ_RET
|
||||
disphead endp
|
||||
|
||||
endcs
|
||||
|
||||
eseg
|
||||
|
||||
;--- Draw window frame ---
|
||||
; AL :frame attribute
|
||||
|
||||
public dispframe
|
||||
dispframe proc
|
||||
pushm <cx,dx>
|
||||
call setatr2
|
||||
call getwindow
|
||||
mov dh,-1
|
||||
mov dl,cl
|
||||
call locate
|
||||
mov al,GRC_TR
|
||||
call vputc
|
||||
mov dl,-1
|
||||
call locate
|
||||
mov al,GRC_TL
|
||||
call vputc
|
||||
mov al,GRC_H
|
||||
call repputc
|
||||
mov dx,cx
|
||||
call locate
|
||||
mov al,GRC_BR
|
||||
call vputc
|
||||
mov dl,-1
|
||||
call locate
|
||||
mov al,GRC_BL
|
||||
call vputc
|
||||
mov al,GRC_H
|
||||
call repputc
|
||||
movhl dx,0,-1
|
||||
call locate
|
||||
call vlinec
|
||||
mov dl,cl
|
||||
call locate
|
||||
call vlinec
|
||||
popm <dx,cx>
|
||||
VZ_RET
|
||||
dispframe endp
|
||||
|
||||
;--- Repeat put char ---
|
||||
; AL :ASCII code
|
||||
; CL :repeat count
|
||||
|
||||
public repputc
|
||||
repputc proc
|
||||
push cx
|
||||
clr ch
|
||||
_repeat
|
||||
push ax
|
||||
call putc
|
||||
pop ax
|
||||
_loop
|
||||
pop cx
|
||||
VZ_RET
|
||||
repputc endp
|
||||
|
||||
assume ds:cgroup
|
||||
|
||||
;--- Display prompt ---
|
||||
|
||||
public dispprmpt
|
||||
dispprmpt proc
|
||||
push ds
|
||||
movseg ds,ss
|
||||
call newline
|
||||
mov al,ATR_MSG
|
||||
call setatr
|
||||
mov si,prompt
|
||||
call puts_t
|
||||
pop ds
|
||||
VZ_RET
|
||||
dispprmpt endp
|
||||
|
||||
;--- Display key mode ---
|
||||
;--> SI :dword data ptr
|
||||
|
||||
public dispkeymode,clrkeymode,offkeymode
|
||||
offkeymode:
|
||||
tstb dspkeyf
|
||||
jz dspk9
|
||||
clrkeymode:
|
||||
mov si,offset cgroup:clrkey
|
||||
mov dl,FALSE
|
||||
jmps dspk0
|
||||
dispkeymode proc
|
||||
mov dl,TRUE
|
||||
dspk0: mov dspkeyf,dl
|
||||
push ax
|
||||
call dosheight
|
||||
tst cl
|
||||
_if z
|
||||
cmp sysmode,SYS_DOS
|
||||
je dspk8
|
||||
_endif
|
||||
mov dh,ch
|
||||
clr dl
|
||||
call mkscrnp
|
||||
mov al,ATR_KEY
|
||||
call getatr
|
||||
mov dl,al
|
||||
mov dh,al
|
||||
mov cx,4
|
||||
mov al,SPC
|
||||
_repeat
|
||||
tst al
|
||||
jz dspk2
|
||||
lodsb
|
||||
mov dl,dh
|
||||
cmp al,SPC
|
||||
ja dspk2
|
||||
push ax
|
||||
mov al,ATR_DOS
|
||||
call getatr
|
||||
mov dl,al
|
||||
pop ax
|
||||
dspk2: clr ah
|
||||
call abputc
|
||||
_loop
|
||||
dspk8: pop ax
|
||||
dspk9: VZ_RET
|
||||
dispkeymode endp
|
||||
|
||||
;--- Display macro message ---
|
||||
;-->
|
||||
; SI :macro ptr
|
||||
; BX :argument ptr
|
||||
; DI :0=dispmsg, 1=dispask
|
||||
|
||||
public dispmacmsg
|
||||
dispmacmsg proc
|
||||
tst si
|
||||
_if z
|
||||
cmp msgon,1
|
||||
je macmsg9
|
||||
_endif
|
||||
push silent
|
||||
mov ax,di
|
||||
call off_silent
|
||||
call savewloc
|
||||
push ax
|
||||
call newline
|
||||
tstb [si]
|
||||
_ifn z
|
||||
mov msgon,2
|
||||
_endif
|
||||
mov al,ATR_MSG
|
||||
call setatr
|
||||
cmp si,100h
|
||||
_if b
|
||||
mov dx,si
|
||||
call dispmsg
|
||||
_else
|
||||
movseg es,ss
|
||||
mov di,pfbufp
|
||||
push di
|
||||
call sprintf
|
||||
pop si
|
||||
call puts
|
||||
_endif
|
||||
movseg ds,ss
|
||||
movseg es,ss ;;
|
||||
pop ax
|
||||
tst ax
|
||||
_ifn z
|
||||
mov ax,MAC_GETC
|
||||
xchg macmode,ax
|
||||
push ax
|
||||
push sysmode
|
||||
call dispask1
|
||||
pop sysmode
|
||||
pop macmode
|
||||
mov retval,ax
|
||||
_endif
|
||||
call loadwloc
|
||||
pop silent
|
||||
macmsg9:VZ_RET
|
||||
dispmacmsg endp
|
||||
|
||||
;--- Put message ---
|
||||
|
||||
public putmg
|
||||
putmg proc
|
||||
push ds
|
||||
movseg ds,cs
|
||||
call puts
|
||||
pop ds
|
||||
VZ_RET
|
||||
putmg endp
|
||||
|
||||
endes
|
||||
|
||||
end
|
||||
|
||||
;****************************
|
||||
; End of 'disp.asm'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
||||
|
1347
SRC/dos.asm
1347
SRC/dos.asm
File diff suppressed because it is too large
Load Diff
1063
SRC/ems.asm
1063
SRC/ems.asm
File diff suppressed because it is too large
Load Diff
1107
SRC/expr.asm
1107
SRC/expr.asm
File diff suppressed because it is too large
Load Diff
1355
SRC/ezkey.asm
1355
SRC/ezkey.asm
File diff suppressed because it is too large
Load Diff
3966
SRC/filer.asm
3966
SRC/filer.asm
File diff suppressed because it is too large
Load Diff
768
SRC/froll.asm
768
SRC/froll.asm
@ -1,768 +0,0 @@
|
||||
;****************************
|
||||
; 'froll.com'
|
||||
; BIOS fast scroll for J-3100
|
||||
;****************************
|
||||
|
||||
STDSEG equ TRUE
|
||||
|
||||
include std.inc
|
||||
|
||||
;--- Equations ---
|
||||
|
||||
WD equ 80
|
||||
SEG_BIOS equ 0070h
|
||||
SEG_VRAM equ 0B800h
|
||||
FROLLLEN equ 5
|
||||
|
||||
INT_VIDEO equ 10h
|
||||
STT_INVZ equ 00000001b
|
||||
STT_ACTIVE equ 10000000b
|
||||
|
||||
;--- BIOS work ---
|
||||
|
||||
_bios segment at 0
|
||||
|
||||
org 0449h
|
||||
vmode db ?
|
||||
width dw ?
|
||||
dw ?
|
||||
cbpage dw ?
|
||||
csrxy dw ?
|
||||
org 0463h
|
||||
crtc dw ?
|
||||
org 04D0h
|
||||
_04D0 db ?
|
||||
org 04D4h
|
||||
lines db ?
|
||||
csrh db ?
|
||||
vrhome dw ?
|
||||
cbhome dw ?
|
||||
cbseg dw ?
|
||||
csrvrp dw ?
|
||||
org 04E2h
|
||||
_04E2 dw ?
|
||||
|
||||
_bios ends
|
||||
|
||||
cseg
|
||||
|
||||
org 2Ch
|
||||
envseg label word
|
||||
|
||||
org 81h
|
||||
cmdline label byte
|
||||
|
||||
org 100h
|
||||
entry: jmp startup
|
||||
|
||||
;--- Work area ---
|
||||
|
||||
vct10 dd 0
|
||||
csrprocp dw 0
|
||||
status db 0
|
||||
db "FR"
|
||||
|
||||
assume ds:_bios
|
||||
|
||||
;--- Video bios entry ---
|
||||
|
||||
videoin:
|
||||
cmp ah,06h
|
||||
je video1
|
||||
cmp ah,07h
|
||||
je video1
|
||||
toorg: jmp cs:vct10
|
||||
video1:
|
||||
tst al
|
||||
jz toorg
|
||||
tstb cs:status
|
||||
jz toorg
|
||||
pushm <si,ds>
|
||||
clr si
|
||||
mov ds,si
|
||||
cmp vmode,64h
|
||||
popm <ds,si>
|
||||
jb toorg
|
||||
sti
|
||||
pushm <es,ds,bp,di,si,dx,cx,bx,ax>
|
||||
mov bp,sp
|
||||
push ax
|
||||
clr ax
|
||||
mov ds,ax
|
||||
or byte ptr _04D0,80h
|
||||
mov al,_04D0
|
||||
test al,03h
|
||||
jz video2
|
||||
test al,40h
|
||||
jz video2
|
||||
test al,20h
|
||||
jz video2
|
||||
and byte ptr _04D0,not 20h
|
||||
call flickcsr
|
||||
video2: pop ax
|
||||
call rollmain
|
||||
and byte ptr _04D0,not 80h
|
||||
popm <ax,bx,cx,dx,si,di,bp,ds,es>
|
||||
iret
|
||||
|
||||
rollmain:
|
||||
cld
|
||||
mov si,SEG_VRAM
|
||||
mov es,si
|
||||
test byte ptr _04E2,1
|
||||
jnz softroll
|
||||
; cmp al,7
|
||||
; je softroll
|
||||
cmp al,1
|
||||
jnz softroll
|
||||
tst cx
|
||||
jnz softroll
|
||||
cmp byte ptr [bp+6],79 ; dl
|
||||
jb softroll
|
||||
mov dl,lines
|
||||
sub dl,2
|
||||
cmp [bp+7],dl ; dh
|
||||
jb softroll
|
||||
jmp hardroll
|
||||
|
||||
;--- Software scroll ---
|
||||
|
||||
softroll:
|
||||
push ax
|
||||
call setparm
|
||||
mov cx,di
|
||||
call mkcbufp
|
||||
mov di,cx
|
||||
mov cx,si
|
||||
call mkcbufp
|
||||
mov si,cx
|
||||
cmp al,0
|
||||
_ifn e
|
||||
call move_cbuf
|
||||
mov dh,al
|
||||
_endif
|
||||
call fill_cbuf
|
||||
call setparm
|
||||
mov cx,di
|
||||
call mkvramp
|
||||
mov di,cx
|
||||
mov cx,si
|
||||
call mkvramp
|
||||
mov si,cx
|
||||
pop ax
|
||||
cmp al,0
|
||||
_ifn e
|
||||
call move_vram
|
||||
mov dh,al
|
||||
_endif
|
||||
call fill_vram
|
||||
VZ_RET
|
||||
|
||||
;--- Move video ram ---
|
||||
|
||||
move_vram:
|
||||
pushm <ax,ds>
|
||||
cmp ah,06h
|
||||
_ifn e
|
||||
neg bx
|
||||
add si,WD*3
|
||||
add di,WD*3
|
||||
cmp lines,25
|
||||
_ifn e
|
||||
add si,WD
|
||||
add di,WD
|
||||
_endif
|
||||
_endif
|
||||
mov ah,dh
|
||||
shlm dh,2
|
||||
cmp lines,25
|
||||
_ifn e
|
||||
add dh,ah
|
||||
_endif
|
||||
movseg ds,es
|
||||
mov ah,4
|
||||
tst dh
|
||||
jz movvr9
|
||||
_repeat
|
||||
pushm <ax,ds>
|
||||
_repeat
|
||||
pushm <si,di>
|
||||
and si,1FFFh
|
||||
and di,1FFFh
|
||||
cmp si,1FFFh-WD
|
||||
ja vramend_si
|
||||
cmp di,1FFFh-WD
|
||||
ja vramend_di
|
||||
movvr1:
|
||||
mov cl,dl
|
||||
movvr2: clr ch
|
||||
shr cx,1
|
||||
rep movsw
|
||||
_if c
|
||||
movsb
|
||||
_endif
|
||||
popm <di,si>
|
||||
mov cx,es
|
||||
add ch,2
|
||||
mov es,cx
|
||||
mov ds,cx
|
||||
dec ah
|
||||
_until z
|
||||
popm <ds,ax>
|
||||
movseg es,ds
|
||||
add di,bx
|
||||
add si,bx
|
||||
dec dh
|
||||
_until z
|
||||
movvr9: popm <ds,ax>
|
||||
VZ_RET
|
||||
|
||||
vramend_si:
|
||||
mov cx,2000h
|
||||
sub cx,si
|
||||
cmp cl,dl
|
||||
jae movvr1
|
||||
push cx
|
||||
rep movsb
|
||||
pop cx
|
||||
sub cl,dl
|
||||
neg cl
|
||||
clr si
|
||||
jmp movvr2
|
||||
|
||||
vramend_di:
|
||||
mov cx,2000h
|
||||
sub cx,di
|
||||
cmp cl,dl
|
||||
jae movvr1
|
||||
push cx
|
||||
rep movsb
|
||||
pop cx
|
||||
sub cl,dl
|
||||
neg cl
|
||||
clr di
|
||||
jmp movvr2
|
||||
|
||||
;--- Fill video ram ---
|
||||
|
||||
fill_vram:
|
||||
push ax
|
||||
mov ah,dh
|
||||
shlm dh,2
|
||||
cmp lines,25
|
||||
_ifn z
|
||||
add dh,ah
|
||||
_endif
|
||||
mov ah,4
|
||||
clr al
|
||||
test byte ptr [bp+3],07h ; bh
|
||||
_if z
|
||||
test byte ptr [bp+3],70h ; bh
|
||||
_ifn z
|
||||
not al
|
||||
_endif
|
||||
_endif
|
||||
_repeat
|
||||
pushm <ax,es>
|
||||
_repeat
|
||||
push di
|
||||
mov cl,dl
|
||||
clr ch
|
||||
_repeat
|
||||
and di,1FFFh
|
||||
stosb
|
||||
_loop
|
||||
pop di
|
||||
mov cx,es
|
||||
add ch,2
|
||||
mov es,cx
|
||||
dec ah
|
||||
_until z
|
||||
popm <es,ax>
|
||||
add di,bx
|
||||
dec dh
|
||||
_until z
|
||||
pop ax
|
||||
VZ_RET
|
||||
|
||||
;--- Move code buffer ---
|
||||
|
||||
move_cbuf:
|
||||
pushm <ax,ds,es>
|
||||
cmp ah,06h
|
||||
_ifn e
|
||||
neg bx
|
||||
_endif
|
||||
mov es,cbseg
|
||||
movseg ds,es
|
||||
tst dh
|
||||
je movcb9
|
||||
_repeat
|
||||
mov cl,dl
|
||||
clr ch
|
||||
pushm <si,di>
|
||||
_repeat
|
||||
and si,0FFEh
|
||||
and di,0FFEh
|
||||
movsw
|
||||
_loop
|
||||
popm <di,si>
|
||||
add si,bx
|
||||
add di,bx
|
||||
dec dh
|
||||
_until z
|
||||
movcb9: popm <es,ds,ax>
|
||||
VZ_RET
|
||||
|
||||
;--- Fill code buffer ---
|
||||
|
||||
fill_cbuf:
|
||||
pushm <ax,es>
|
||||
mov es,cbseg
|
||||
mov ah,[bp+3] ; bh
|
||||
mov al,SPC
|
||||
_repeat
|
||||
mov cl,dl
|
||||
clr ch
|
||||
push di
|
||||
_repeat
|
||||
and di,0FFEh
|
||||
stosw
|
||||
_loop
|
||||
pop di
|
||||
add di,bx
|
||||
dec dh
|
||||
_until z
|
||||
popm <es,ax>
|
||||
VZ_RET
|
||||
|
||||
;--- Hardware scroll ---
|
||||
|
||||
hardroll:
|
||||
mov al,FALSE
|
||||
_if e
|
||||
mov ch,lines
|
||||
dec ch
|
||||
clr cl
|
||||
push cx
|
||||
call mkcbufp
|
||||
mov si,cx
|
||||
mov di,cx
|
||||
pop dx
|
||||
push dx
|
||||
cmp ah,06h
|
||||
_if e
|
||||
add di,bx
|
||||
inc dh
|
||||
_else
|
||||
sub di,bx
|
||||
dec dh
|
||||
_endif
|
||||
push dx
|
||||
movhl dx,1,WD
|
||||
call move_cbuf
|
||||
pop cx
|
||||
call mkvramp
|
||||
mov di,cx
|
||||
pop cx
|
||||
call mkvramp
|
||||
mov si,cx
|
||||
movhl dx,1,WD
|
||||
call move_vram
|
||||
mov al,TRUE
|
||||
_endif
|
||||
mov ch,-1
|
||||
cmp ah,06h
|
||||
_if e
|
||||
mov ch,lines
|
||||
tst al
|
||||
_ifn z
|
||||
dec ch
|
||||
_endif
|
||||
_endif
|
||||
clr cl
|
||||
push cx
|
||||
call mkcbufp
|
||||
mov di,cx
|
||||
movhl dx,1,WD
|
||||
call fill_cbuf
|
||||
pop cx
|
||||
call mkvramp
|
||||
mov di,cx
|
||||
movhl dx,1,WD
|
||||
call fill_vram
|
||||
|
||||
mov bx,WD*4
|
||||
cmp lines,25
|
||||
_ifn z
|
||||
mov bx,WD*5
|
||||
_endif
|
||||
cmp ah,06h
|
||||
_ifn e
|
||||
neg bx
|
||||
_endif
|
||||
push ax
|
||||
push bx
|
||||
mov ax,csrvrp
|
||||
add bx,ax
|
||||
and bx,1FFFh
|
||||
and ax,not 1FFFh
|
||||
or ax,bx
|
||||
mov csrvrp,ax
|
||||
pop bx
|
||||
add bx,vrhome
|
||||
and bx,1FFFh
|
||||
mov vrhome,bx
|
||||
shr bx,1
|
||||
mov al,12
|
||||
call outcrtc
|
||||
pop ax
|
||||
mov bx,WD*2
|
||||
cmp ah,06h
|
||||
_ifn e
|
||||
neg bx
|
||||
_endif
|
||||
add bx,cbhome
|
||||
and bx,0FFEh
|
||||
mov cbhome,bx
|
||||
mov ax,csrxy
|
||||
mov bx,ax
|
||||
mov al,WD
|
||||
mul ah
|
||||
clr bh
|
||||
add ax,bx
|
||||
shl ax,1
|
||||
add ax,cbpage
|
||||
shr ax,1
|
||||
mov bx,ax
|
||||
mov al,14
|
||||
call outcrtc
|
||||
VZ_RET
|
||||
|
||||
;--- Sub routine ---
|
||||
|
||||
outcrtc:
|
||||
mov dx,crtc
|
||||
cli
|
||||
mov ah,al
|
||||
out dx,al
|
||||
jmpw
|
||||
inc dx
|
||||
mov al,bh
|
||||
out dx,al
|
||||
jmpw
|
||||
dec dx
|
||||
xchg ah,al
|
||||
inc al
|
||||
out dx,al
|
||||
jmpw
|
||||
inc dx
|
||||
mov al,bl
|
||||
out dx,al
|
||||
sti
|
||||
VZ_RET
|
||||
|
||||
;--- Set parameter ---
|
||||
;<--
|
||||
; SI
|
||||
; DI
|
||||
; DX
|
||||
|
||||
setparm:
|
||||
push ax
|
||||
clr bl
|
||||
mov bh,[bp] ; al
|
||||
mov cx,[bp+4] ; cx
|
||||
mov dx,[bp+6] ; dx
|
||||
cmp dl,WD
|
||||
_ifn b
|
||||
mov dl,WD-1
|
||||
_endif
|
||||
cmp cl,dl
|
||||
_ifn be
|
||||
mov cl,dl
|
||||
_endif
|
||||
cmp ah,06h
|
||||
_if e
|
||||
mov si,cx
|
||||
add si,bx
|
||||
mov di,cx
|
||||
_else
|
||||
mov al,cl
|
||||
mov ah,dh
|
||||
mov si,ax
|
||||
mov di,ax
|
||||
sub si,bx
|
||||
_endif
|
||||
sub dx,cx
|
||||
sub dx,bx
|
||||
inc dh
|
||||
inc dl
|
||||
pop ax
|
||||
VZ_RET
|
||||
|
||||
;--- Make video ram ptr ---
|
||||
;--> CX
|
||||
;<-- BX,CX
|
||||
|
||||
mkvramp:
|
||||
push ax
|
||||
mov bx,WD
|
||||
mov al,ch
|
||||
imul bl
|
||||
push cx
|
||||
mov cx,ax
|
||||
shlm ax,2
|
||||
cmp lines,25
|
||||
_ifn e
|
||||
add ax,cx
|
||||
_endif
|
||||
pop cx
|
||||
clr ch
|
||||
add cx,ax
|
||||
add cx,vrhome
|
||||
and cx,1FFFh
|
||||
pop ax
|
||||
VZ_RET
|
||||
|
||||
;--- Make code buffer ptr ---
|
||||
;--> CX
|
||||
;<-- BX,CX
|
||||
|
||||
mkcbufp:
|
||||
push ax
|
||||
mov al,ch
|
||||
mov bx,WD
|
||||
imul bl
|
||||
clr ch
|
||||
add ax,cx
|
||||
shl ax,1
|
||||
add ax,cbhome
|
||||
and ax,0FFEh
|
||||
add ax,cbpage
|
||||
mov cx,ax
|
||||
shl bx,1
|
||||
pop ax
|
||||
VZ_RET
|
||||
|
||||
;--- Flick Cursor ---
|
||||
|
||||
flickcsr proc
|
||||
pushm <ax,bx,cx,es>
|
||||
mov cx,csrxy
|
||||
call mkcbufp
|
||||
mov bx,cx
|
||||
mov es,cbseg
|
||||
mov al,es:[bx]
|
||||
clr ah
|
||||
cmp al,81h
|
||||
jb kjno
|
||||
cmp al,9Fh
|
||||
jbe kjyes
|
||||
cmp al,0E0h
|
||||
jb kjno
|
||||
cmp al,0FCh
|
||||
jbe kjyes
|
||||
kjyes: not ah
|
||||
kjno: mov al,0FFh
|
||||
mov cx,SEG_VRAM
|
||||
mov es,cx
|
||||
mov bx,csrvrp
|
||||
mov cl,csrh
|
||||
flcsr1:
|
||||
xor es:[bx],ax
|
||||
dec cl
|
||||
jz flcsr8
|
||||
add bx,2000h
|
||||
jns flcsr1
|
||||
add bx,WD
|
||||
and bx,1FFFh
|
||||
jmp flcsr1
|
||||
flcsr8: popm <es,cx,bx,ax>
|
||||
VZ_RET
|
||||
flickcsr endp
|
||||
|
||||
fret dd 0
|
||||
|
||||
flickcsr1 proc far
|
||||
mov bx,csrvrp
|
||||
mov ah,csrh
|
||||
cmp vmode,74h
|
||||
_if e
|
||||
call flickcsr
|
||||
pop ax
|
||||
pop fret.@seg
|
||||
popm <ax,bx,es,ds>
|
||||
pop fret.@off
|
||||
push fret.@seg
|
||||
push fret.@off
|
||||
_endif
|
||||
VZ_RET
|
||||
flickcsr1 endp
|
||||
|
||||
;--- Startup ---
|
||||
|
||||
assume ds:cgroup
|
||||
|
||||
startup proc
|
||||
cli
|
||||
mov dx,offset mg_title
|
||||
msdos F_DSPSTR
|
||||
mov al,INT_VIDEO
|
||||
msdos F_GETVCT
|
||||
mov dx,offset videoin
|
||||
cmp bx,dx
|
||||
jne install
|
||||
remove:
|
||||
push ds
|
||||
lds dx,es:vct10
|
||||
mov al,INT_VIDEO
|
||||
msdos F_SETVCT
|
||||
msdos F_FREE
|
||||
pop ds
|
||||
sti
|
||||
mov dx,offset mg_remove
|
||||
msdos F_DSPSTR
|
||||
call resetcsrproc
|
||||
mov al,0
|
||||
msdos F_TERM
|
||||
|
||||
install:
|
||||
mov vct10.@off,bx
|
||||
mov vct10.@seg,es
|
||||
mov dx,offset videoin
|
||||
mov al,INT_VIDEO
|
||||
msdos F_SETVCT
|
||||
sti
|
||||
mov dx,offset mg_install
|
||||
msdos F_DSPSTR
|
||||
call free_env
|
||||
mov ah,0Fh
|
||||
int INT_VIDEO
|
||||
; cmp al,74h
|
||||
;_if e
|
||||
call setcsrproc
|
||||
_if c
|
||||
mov dx,offset mg_csrproc
|
||||
msdos F_DSPSTR
|
||||
_endif
|
||||
;_endif
|
||||
mov si,offset cmdline
|
||||
_repeat
|
||||
lodsb
|
||||
cmp al,CR
|
||||
je exit
|
||||
cmp al,'a'
|
||||
_until e
|
||||
or status,STT_ACTIVE
|
||||
exit:
|
||||
mov dx,offset startup
|
||||
add dx,15
|
||||
mov cl,4
|
||||
shr dx,cl
|
||||
mov al,0
|
||||
msdos F_KEEP
|
||||
startup endp
|
||||
|
||||
;--- Free environment ---
|
||||
|
||||
free_env proc
|
||||
movseg es,cs
|
||||
mov dx,FROLLLEN
|
||||
mov si,offset cmdline
|
||||
mov cl,[si-1]
|
||||
clr ch
|
||||
add si,cx
|
||||
inc cx
|
||||
mov di,si
|
||||
add di,dx
|
||||
std
|
||||
rep movsb
|
||||
cld
|
||||
mov di,si
|
||||
add [di],dl
|
||||
inc di
|
||||
mov si,offset nm_froll
|
||||
mov cx,dx
|
||||
rep movsb
|
||||
mov es,envseg
|
||||
msdos F_FREE
|
||||
VZ_RET
|
||||
free_env endp
|
||||
|
||||
;--- Replace display cursor proc. ---
|
||||
|
||||
assume ds:_bios
|
||||
|
||||
org_csrproc:
|
||||
mov bx,csrvrp
|
||||
mov ah,csrh
|
||||
org_csrproc9:
|
||||
|
||||
new_csrproc:
|
||||
db 9Ah ; call far
|
||||
vctcsr dd 0
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
new_csrproc9:
|
||||
|
||||
assume ds:cgroup
|
||||
|
||||
setcsrproc:
|
||||
mov vctcsr.@off,offset flickcsr1
|
||||
mov vctcsr.@seg,cs
|
||||
cld
|
||||
ldseg es,SEG_BIOS
|
||||
clr di ; search at 70:0000 - 70:8000
|
||||
mov cx,8000h ;
|
||||
srch1: mov si,offset org_csrproc
|
||||
lodsb
|
||||
repne scasb
|
||||
jne srch_x
|
||||
srch2: cmpsb
|
||||
jne srch1
|
||||
cmp si,offset org_csrproc9
|
||||
jne srch2
|
||||
mov csrprocp,di
|
||||
sub di,offset org_csrproc9 - offset org_csrproc
|
||||
mov si,offset new_csrproc
|
||||
mov cx,offset new_csrproc9 - offset new_csrproc
|
||||
cli
|
||||
rep movsb
|
||||
sti
|
||||
clc
|
||||
VZ_RET
|
||||
srch_x: stc
|
||||
VZ_RET
|
||||
|
||||
resetcsrproc:
|
||||
mov di,es:csrprocp
|
||||
tst di
|
||||
_ifn z
|
||||
sub di,offset org_csrproc9 - offset org_csrproc
|
||||
cld
|
||||
ldseg es,SEG_BIOS
|
||||
mov si,offset org_csrproc
|
||||
mov cx,offset org_csrproc9 - offset org_csrproc
|
||||
cli
|
||||
rep movsb
|
||||
sti
|
||||
_endif
|
||||
VZ_RET
|
||||
|
||||
;--- Messages ---
|
||||
|
||||
nm_froll db "froll"
|
||||
mg_title db "FROLL Version 1.01 (for J-3100) by c.mos ... $"
|
||||
mg_install db "installed.",CR,LF,"$"
|
||||
mg_remove db "removed.",CR,LF,"$"
|
||||
mg_csrproc db "全角カーソルは対応できません.",CR,LF,"$"
|
||||
|
||||
endcs
|
||||
end entry
|
||||
|
||||
;****************************
|
||||
; End of 'froll.com'
|
||||
;****************************
|
||||
|
578
SRC/gets.asm
578
SRC/gets.asm
@ -1,578 +0,0 @@
|
||||
;****************************
|
||||
; 'gets.asm'
|
||||
;****************************
|
||||
|
||||
include vz.inc
|
||||
|
||||
;--- Equations ---
|
||||
|
||||
GETTABC equ 1
|
||||
|
||||
bufwk_top equ btop ; ##100.16
|
||||
bufwk_end equ largf
|
||||
|
||||
;--- Gets work record (in stack) ---
|
||||
|
||||
_getswk struc
|
||||
db bufwk_end dup(?)
|
||||
cutmode db ?
|
||||
getsmode db ?
|
||||
hbtop dw ?
|
||||
hbend dw ?
|
||||
hbptr dw ?
|
||||
bcmp dw ?
|
||||
bword dw ?
|
||||
_getswk ends
|
||||
|
||||
;--- External symbols ---
|
||||
|
||||
wseg
|
||||
extrn insm :byte
|
||||
|
||||
extrn sbuf :word
|
||||
extrn tmpbuf :word
|
||||
endws
|
||||
|
||||
extrn cptoxy :near
|
||||
extrn csroff1 :near
|
||||
extrn disptext :near
|
||||
extrn getkey :near
|
||||
extrn getwindow :near
|
||||
extrn hadjust :near
|
||||
extrn lineedit :near
|
||||
extrn locate :near
|
||||
extrn skipstr :near
|
||||
extrn strcmp :near
|
||||
extrn strcpy :near
|
||||
extrn strcpy :near
|
||||
extrn wrdicmp :near
|
||||
|
||||
eseg
|
||||
assume ds:cgroup
|
||||
|
||||
;--- Get String ---
|
||||
;-->
|
||||
; DS:SI :history buffer ptr ([SI-2,1]:size of buffer)
|
||||
; CL :maximum string length ( < TMPSZ)
|
||||
; AL :0=initial input, 1=copy previous string, 3=macro edit,
|
||||
; :4,5=DOS line edit(5:continue)
|
||||
;<--
|
||||
; NC :enter, CY :escape
|
||||
; CX :input string length
|
||||
|
||||
public gets
|
||||
gets proc
|
||||
pushm <si,bp,ds>
|
||||
movseg ds,ss
|
||||
movseg es,ss
|
||||
call csroff1 ; ##153.41
|
||||
mov bp,sp
|
||||
sub bp,type _getswk
|
||||
sub sp,type _getswk-bufwk_top
|
||||
call initgets
|
||||
gets0:
|
||||
clr al
|
||||
mov [bp].fofs,al
|
||||
mov [bp].fskp,al
|
||||
mov si,[bp].bend
|
||||
call cptoxy
|
||||
mov [bp].ly,ch
|
||||
gets1:
|
||||
clr dx
|
||||
call locate
|
||||
call hadjust
|
||||
mov si,[bp].btop
|
||||
clr ax
|
||||
pushm <ax,ax,ax>
|
||||
clr ah
|
||||
mov al,[bp].tabr
|
||||
push ax
|
||||
mov ah,[bp].fsiz
|
||||
mov al,DSP_TAB+DSP_ZENSPC
|
||||
push ax
|
||||
mov bl,[bp].fofs
|
||||
mov bh,[bp].tw_sx
|
||||
add bh,bl
|
||||
mov dx,sp
|
||||
call disptext
|
||||
add sp,10
|
||||
gets2:
|
||||
mov dx,word ptr [bp].lx
|
||||
sub dl,[bp].fofs
|
||||
call locate
|
||||
mov al,ss:insm
|
||||
mov dl,SYS_GETS
|
||||
test [bp].getsmode,GETS_DOS
|
||||
_ifn z
|
||||
mov dl,SYS_DOS
|
||||
_endif
|
||||
call getkey
|
||||
jnz gets3
|
||||
mov al,CM_SEDIT
|
||||
jmps gets4
|
||||
gets3:
|
||||
cmp al,CM_LEDIT
|
||||
jb gets6
|
||||
cmp al,CM_SPREAD
|
||||
jae gets_cr
|
||||
cmp al,CM_DOS
|
||||
jae getscr1
|
||||
cmp al,CM_SEDIT
|
||||
jae gets0
|
||||
gets4: call lineedit
|
||||
tstw [bp].bword
|
||||
_ifn z
|
||||
mov ax,[bp].tcp
|
||||
cmp ax,[bp].btop
|
||||
jne gets5
|
||||
_endif
|
||||
mov ax,[bp].hbtop
|
||||
mov [bp].hbptr,ax
|
||||
gets5: mov [bp].bcmp,0
|
||||
jmp gets1
|
||||
gets6:
|
||||
cmp al,CM_ESC
|
||||
je gets_esc
|
||||
cmp al,CM_CR
|
||||
je gets_cr
|
||||
cmp al,CM_U
|
||||
je gets_u
|
||||
cmp al,CM_D
|
||||
je gets_d
|
||||
jmp gets0
|
||||
gets_u:
|
||||
call histup
|
||||
jmp gets0
|
||||
gets_d:
|
||||
call histdwn
|
||||
jmp gets0
|
||||
gets_cr:
|
||||
push ax
|
||||
call storestr
|
||||
pop ax
|
||||
getscr1:
|
||||
add sp,type _getswk-bufwk_top
|
||||
clc
|
||||
jmps gets8
|
||||
gets_esc:
|
||||
add sp,type _getswk-bufwk_top
|
||||
stc
|
||||
gets8:
|
||||
popm <ds,bp,si>
|
||||
VZ_RET
|
||||
|
||||
;--- Init gets ---
|
||||
|
||||
initgets:
|
||||
mov [bp].cutmode,FALSE
|
||||
mov [bp].getsmode,al
|
||||
mov [bp].hbtop,si
|
||||
mov [bp].hbptr,si
|
||||
mov [bp].bword,0
|
||||
mov di,si
|
||||
add di,[si-2]
|
||||
mov [bp].hbend,di
|
||||
|
||||
mov [bp].inbuf,-1
|
||||
mov [bp].lbseg,ss
|
||||
mov [bp].fsiz,TMPSZ-1
|
||||
mov [bp].tabr,GETTABC
|
||||
mov di,tmpbuf
|
||||
mov [bp].btop,di
|
||||
clr ch
|
||||
tst cl
|
||||
jz igets1
|
||||
cmp cl,TMPSZ-1
|
||||
jbe igets2
|
||||
igets1: mov cl,TMPSZ-1
|
||||
igets2: add di,cx
|
||||
mov [bp].bmax,di
|
||||
|
||||
cmp al,GETS_DOSC
|
||||
jb igets3
|
||||
call curstr
|
||||
jmps igets4
|
||||
igets3: test al,GETS_COPY
|
||||
jnz igets5
|
||||
call newstr
|
||||
igets4: mov [bp].bcmp,0
|
||||
jmps igets6
|
||||
igets5: call loadstr
|
||||
mov [bp].bcmp,-1
|
||||
igets6: call getwindow
|
||||
mov word ptr [bp].tw_px,dx
|
||||
mov word ptr [bp].tw_sx,cx
|
||||
VZ_RET
|
||||
|
||||
;--- Scan history buffer ---
|
||||
|
||||
histup:
|
||||
mov si,[bp].hbptr
|
||||
cmp byte ptr [si],0
|
||||
je stup9
|
||||
call iscmphist
|
||||
jz stup2
|
||||
_repeat
|
||||
call skipword
|
||||
je stup1
|
||||
call histcmp
|
||||
je stup2
|
||||
stup1: call nextstr
|
||||
tstb [si]
|
||||
_until z
|
||||
VZ_RET
|
||||
stup2: call loadstr
|
||||
stup9: VZ_RET
|
||||
|
||||
histdwn:
|
||||
mov si,[bp].hbptr
|
||||
cmp si,[bp].hbtop
|
||||
je newstr
|
||||
call iscmphist
|
||||
jz stdn2
|
||||
call prestr
|
||||
jc stdn9
|
||||
call prestr
|
||||
_repeat
|
||||
call skipword
|
||||
je stdn1
|
||||
call histcmp
|
||||
je stdn3
|
||||
stdn1: cmp si,[bp].hbtop
|
||||
je stdn9
|
||||
call prestr
|
||||
_until
|
||||
stdn2: call prestr
|
||||
jc newstr
|
||||
call prestr
|
||||
stdn3: call loadstr
|
||||
stdn9: VZ_RET
|
||||
|
||||
newstr:
|
||||
mov [bp].hbptr,si
|
||||
mov di,[bp].btop
|
||||
mov byte ptr [di],LF
|
||||
mov [bp].bend,di
|
||||
mov [bp].bword,0
|
||||
VZ_RET
|
||||
|
||||
curstr:
|
||||
mov di,[bp].btop
|
||||
mov cx,[bp].bmax
|
||||
sub cx,di
|
||||
mov al,LF
|
||||
repne scasb
|
||||
dec di
|
||||
mov [di],al
|
||||
mov [bp].bend,di
|
||||
VZ_RET
|
||||
|
||||
;
|
||||
loadstr:
|
||||
mov di,[bp].bword
|
||||
mov ah,SPC
|
||||
tst di
|
||||
_if z
|
||||
mov di,[bp].btop
|
||||
mov ah,0
|
||||
_endif
|
||||
_repeat
|
||||
lodsb
|
||||
push ax
|
||||
cmp al,NULLCODE
|
||||
_if e
|
||||
clr al
|
||||
_endif
|
||||
stosb
|
||||
pop ax
|
||||
cmp al,ah
|
||||
_until be
|
||||
dec di
|
||||
mov byte ptr [di],LF
|
||||
tst ah
|
||||
_ifn z
|
||||
call skipsp
|
||||
_endif
|
||||
mov [bp].hbptr,si
|
||||
mov [bp].bend,di
|
||||
VZ_RET
|
||||
|
||||
nextstr:
|
||||
tstw [bp].bword
|
||||
jnz nextword
|
||||
_repeat
|
||||
lodsb
|
||||
tst al
|
||||
_until z
|
||||
VZ_RET
|
||||
nextword:
|
||||
_repeat
|
||||
lodsb
|
||||
cmp al,SPC
|
||||
_until be
|
||||
skipsp:
|
||||
_repeat
|
||||
lodsb
|
||||
cmp al,SPC ; ##153.44
|
||||
_break a
|
||||
or al,[si]
|
||||
_until z
|
||||
dec si
|
||||
VZ_RET
|
||||
|
||||
prestr:
|
||||
cmp si,[bp].hbtop
|
||||
je prest_c
|
||||
tstw [bp].bword
|
||||
jnz preword
|
||||
_repeat
|
||||
dec si
|
||||
cmp si,[bp].hbtop
|
||||
je prest_c
|
||||
tstb [si-1]
|
||||
_until z
|
||||
VZ_RET
|
||||
preword:
|
||||
_repeat
|
||||
dec si
|
||||
cmp si,[bp].hbtop
|
||||
je prest_c
|
||||
mov ax,[si-1]
|
||||
cmp ah,SPC
|
||||
_cont be
|
||||
cmp al,SPC
|
||||
_until be
|
||||
clc
|
||||
VZ_RET
|
||||
prest_c:stc
|
||||
VZ_RET
|
||||
|
||||
;
|
||||
skipword proc
|
||||
mov di,[bp].bword
|
||||
tst di
|
||||
jz skword1
|
||||
cmp [bp].getsmode,GETS_DOS
|
||||
jb skword1
|
||||
cmp si,[bp].hbtop
|
||||
je skword9
|
||||
tstb [si-1]
|
||||
jz skword9
|
||||
skword1:
|
||||
push si
|
||||
_repeat
|
||||
cmpsb
|
||||
jne skword8
|
||||
cmp byte ptr [si],SPC
|
||||
_until be
|
||||
cmp byte ptr [di],SPC ; ##155.73
|
||||
ja skword8
|
||||
clr al ; stz
|
||||
skword8:pop si
|
||||
skword9:VZ_RET
|
||||
skipword endp
|
||||
|
||||
;
|
||||
iscmphist:
|
||||
mov ax,[bp].bcmp
|
||||
tst ax
|
||||
_ifn z
|
||||
cmp ax,-1
|
||||
_else
|
||||
clr di
|
||||
mov ax,[bp].tcp
|
||||
cmp ax,[bp].btop
|
||||
_if e
|
||||
mov ax,-1
|
||||
_endif
|
||||
mov [bp].bcmp,ax
|
||||
_ifn z
|
||||
pushf
|
||||
mov di,ax
|
||||
_repeat
|
||||
cmp byte ptr [di-1],SPC
|
||||
je iscmp1
|
||||
dec di
|
||||
cmp di,[bp].btop
|
||||
_until e
|
||||
clr di
|
||||
jmps iscmp2
|
||||
iscmp1: cmp di,ax
|
||||
_ifn e
|
||||
iscmp2: mov si,[bp].hbtop
|
||||
_endif
|
||||
popf
|
||||
_endif
|
||||
mov [bp].bword,di
|
||||
_endif
|
||||
VZ_RET
|
||||
|
||||
histcmp:
|
||||
push si
|
||||
mov di,[bp].bword
|
||||
tst di
|
||||
_if z
|
||||
mov di,[bp].btop
|
||||
_endif
|
||||
_repeat
|
||||
cmp di,[bp].bcmp
|
||||
_break e
|
||||
cmpsb
|
||||
_while e
|
||||
pop si
|
||||
VZ_RET
|
||||
|
||||
gets endp
|
||||
|
||||
;--- Store string to history buffer ---
|
||||
;<-- CX :length
|
||||
|
||||
storestr proc
|
||||
mov si,[bp].btop
|
||||
mov cx,[bp].bend
|
||||
sub cx,si
|
||||
jz stst9
|
||||
push cx
|
||||
_repeat
|
||||
lodsb
|
||||
tst al
|
||||
_if z
|
||||
mov byte ptr [si-1],NULLCODE
|
||||
_endif
|
||||
_loop
|
||||
mov [si],cl
|
||||
pop cx
|
||||
inc cx
|
||||
mov di,[bp].hbtop
|
||||
_repeat
|
||||
mov al,[di]
|
||||
tst al
|
||||
jz stst3
|
||||
mov si,[bp].btop
|
||||
mov bx,di
|
||||
tstb [bp].cutmode
|
||||
_if z
|
||||
call strcmp
|
||||
clc
|
||||
_if e
|
||||
stc
|
||||
_endif
|
||||
_else
|
||||
call wrdicmp
|
||||
_endif
|
||||
pushf
|
||||
call skipstr
|
||||
popf
|
||||
_until c
|
||||
mov si,di
|
||||
mov di,bx
|
||||
_repeat
|
||||
mov al,[si]
|
||||
tst al
|
||||
_break z
|
||||
call strcpy
|
||||
inc di
|
||||
_until
|
||||
stst3: stosb
|
||||
mov si,di
|
||||
add di,cx
|
||||
cmp di,[bp].hbend
|
||||
_if a
|
||||
call stcut
|
||||
_endif
|
||||
push cx
|
||||
mov cx,si
|
||||
sub cx,[bp].hbtop
|
||||
dec si
|
||||
dec di
|
||||
std
|
||||
rep movsb
|
||||
cld
|
||||
pop cx
|
||||
push cx
|
||||
mov si,[bp].btop
|
||||
mov di,[bp].hbtop
|
||||
rep movsb
|
||||
pop cx
|
||||
dec cx
|
||||
stst9: VZ_RET
|
||||
|
||||
stcut:
|
||||
mov si,[bp].hbend
|
||||
sub si,cx
|
||||
mov di,[bp].hbtop
|
||||
stct1: cmp si,di
|
||||
jbe stct2
|
||||
dec si
|
||||
tstb [si]
|
||||
jnz stct1
|
||||
inc si
|
||||
jmps stct3
|
||||
stct2: je stct3
|
||||
mov si,di
|
||||
mov cx,[bp].hbend
|
||||
dec cx
|
||||
sub cx,si
|
||||
stct3: mov byte ptr [si],0
|
||||
inc si
|
||||
mov di,si
|
||||
add di,cx
|
||||
VZ_RET
|
||||
storestr endp
|
||||
|
||||
|
||||
;--- Copy string to history buffer ---
|
||||
;-->
|
||||
; DS:SI :top of string
|
||||
; DI :end of string (if DS == SS && CX == 0)
|
||||
; CX :string length (if DS != SS)
|
||||
; BX :destin. buffer
|
||||
; AL :cut mode
|
||||
|
||||
public histcpy,histcpy_w,histcpy1
|
||||
histcpy proc
|
||||
mov al,FALSE
|
||||
skip2
|
||||
histcpy_w:
|
||||
mov al,TRUE
|
||||
histcpy1:
|
||||
pushm <bp,ds>
|
||||
mov bp,sp
|
||||
sub bp,type _getswk
|
||||
sub sp,type _getswk-bufwk_top
|
||||
movseg es,ss
|
||||
_ifn cxz
|
||||
mov di,ss:tmpbuf
|
||||
push di
|
||||
cmp cx,TMPSZ-2
|
||||
_if a
|
||||
mov cx,TMPSZ-2
|
||||
_endif
|
||||
rep movsb
|
||||
pop si
|
||||
_endif
|
||||
movseg ds,ss
|
||||
mov [bp].cutmode,al
|
||||
mov [bp].btop,si
|
||||
mov [bp].bend,di
|
||||
mov [bp].hbtop,bx
|
||||
mov [bp].hbptr,bx
|
||||
mov cx,[bx-2]
|
||||
_ifn cxz
|
||||
add bx,cx
|
||||
mov [bp].hbend,bx
|
||||
call storestr
|
||||
_endif
|
||||
add sp,type _getswk-bufwk_top
|
||||
popm <ds,bp>
|
||||
VZ_RET
|
||||
histcpy endp
|
||||
|
||||
endes
|
||||
end
|
||||
|
||||
;****************************
|
||||
; End of 'gets.asm'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
||||
|
143
SRC/harderr.asm
143
SRC/harderr.asm
@ -1,143 +0,0 @@
|
||||
;****************************
|
||||
; 'harderr.asm'
|
||||
;****************************
|
||||
|
||||
include vz.inc
|
||||
|
||||
;--- Equations ---
|
||||
|
||||
HARDMSGCNT equ 3
|
||||
|
||||
;--- External symbols ---
|
||||
|
||||
wseg
|
||||
extrn silent :word
|
||||
endws
|
||||
|
||||
extrn mg_harderr :byte
|
||||
extrn mg_drive :byte
|
||||
extrn mg_abort :byte
|
||||
|
||||
extrn csroff :near
|
||||
extrn loadwloc :near
|
||||
extrn newline :near
|
||||
extrn printf :near
|
||||
extrn putmg :near
|
||||
extrn resetint1 :near
|
||||
extrn savewloc :near
|
||||
extrn setatr :near
|
||||
extrn setint1 :near
|
||||
extrn skipstr :near
|
||||
extrn toupper :near
|
||||
extrn wait_key1 :near
|
||||
extrn off_silent :near
|
||||
|
||||
dseg
|
||||
|
||||
;--- Local work ---
|
||||
|
||||
vct24 dd 0
|
||||
|
||||
endds
|
||||
|
||||
eseg
|
||||
|
||||
;--- Set/reset INT24h ---
|
||||
|
||||
public setint24
|
||||
setint24 proc
|
||||
mov bx,offset cgroup:vct24
|
||||
mov di,24h*4
|
||||
mov ax,offset cgroup:int24in
|
||||
mov dx,cs
|
||||
call setint1
|
||||
VZ_RET
|
||||
setint24 endp
|
||||
|
||||
public resetint24
|
||||
resetint24 proc
|
||||
mov bx,offset cgroup:vct24
|
||||
mov di,24h*4
|
||||
mov dx,cs
|
||||
call resetint1
|
||||
VZ_RET
|
||||
resetint24 endp
|
||||
|
||||
;--- INT24h handler ---
|
||||
|
||||
int24in proc
|
||||
pushm <bx,cx,dx,si,di,bp,ds,es>
|
||||
movseg ds,cs
|
||||
mov dx,di
|
||||
push ss:silent
|
||||
call off_silent
|
||||
call savewloc
|
||||
push ax
|
||||
call newline
|
||||
mov al,ATR_MSG
|
||||
call setatr
|
||||
pop ax
|
||||
push ax
|
||||
tst ah
|
||||
_ifn s
|
||||
mov si,offset cgroup:mg_drive
|
||||
add al,'A'
|
||||
cbw ; ##151.08
|
||||
push ax
|
||||
mov bx,sp
|
||||
call printf
|
||||
pop ax
|
||||
_endif
|
||||
clr cx
|
||||
mov di,offset cgroup:mg_harderr
|
||||
movseg es,cs
|
||||
_repeat
|
||||
cmp cl,dl
|
||||
_break e
|
||||
call skipstr
|
||||
inc cx
|
||||
cmp cl,HARDMSGCNT
|
||||
_while b
|
||||
mov si,di
|
||||
push dx
|
||||
mov bx,sp
|
||||
call printf
|
||||
pop dx
|
||||
mov si,offset cgroup:mg_abort
|
||||
call putmg
|
||||
_repeat
|
||||
call csroff
|
||||
call wait_key1 ; ##156.113
|
||||
call toupper
|
||||
mov cl,al
|
||||
cmp al,'A'
|
||||
_break e
|
||||
cmp al,'R'
|
||||
_until e
|
||||
call newline
|
||||
pop ax
|
||||
call loadwloc
|
||||
pop ss:silent
|
||||
cmp cl,'R'
|
||||
jne abort
|
||||
mov al,1
|
||||
popm <es,ds,bp,di,si,dx,cx,bx>
|
||||
iret
|
||||
abort:
|
||||
msdos 54h
|
||||
mov bp,sp
|
||||
or byte ptr [bp+22*2],1
|
||||
mov ax,INVALID
|
||||
add sp,12*2
|
||||
popm <bx,cx,dx,si,di,bp,ds,es>
|
||||
iret
|
||||
int24in endp
|
||||
|
||||
endes
|
||||
end
|
||||
|
||||
;****************************
|
||||
; End of 'harderr.asm'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
||||
|
1682
SRC/inst.asm
1682
SRC/inst.asm
File diff suppressed because it is too large
Load Diff
996
SRC/key.asm
996
SRC/key.asm
@ -1,996 +0,0 @@
|
||||
;****************************
|
||||
; 'key.asm'
|
||||
;****************************
|
||||
|
||||
include vz.inc
|
||||
|
||||
IFNDEF US
|
||||
CVTKANA equ TRUE ; ##153.32
|
||||
ENDIF
|
||||
|
||||
;--- Equations ---
|
||||
|
||||
KSYM_SHIFT equ '\'
|
||||
KSYM_CTRL equ '^'
|
||||
KSYM_ALT equ '@'
|
||||
KSYM_L equ '['
|
||||
KSYM_R equ ']'
|
||||
|
||||
KEY_DOS equ 0
|
||||
KEY_FNC equ 1
|
||||
KEY_VZ equ 2
|
||||
|
||||
PKEYCNT equ 6
|
||||
FP_MSK equ -1
|
||||
|
||||
FP_DEVICE equ 1
|
||||
FP_MSKANJI equ 2
|
||||
|
||||
;--- External symbols ---
|
||||
|
||||
wseg
|
||||
; extrn fkeytype :byte
|
||||
extrn fptype :byte
|
||||
extrn pkeytbl :byte
|
||||
extrn stopf :byte
|
||||
extrn sysmode :byte
|
||||
extrn sysmode0 :byte
|
||||
extrn extsw :byte
|
||||
extrn macmode :byte
|
||||
extrn breakf :byte
|
||||
extrn rolc :byte
|
||||
extrn hardware :byte
|
||||
|
||||
extrn ckeytbl :word
|
||||
extrn dosktbl :word
|
||||
extrn retval :word
|
||||
extrn syssw :word
|
||||
extrn vzktbl :word
|
||||
extrn kanatbl :word
|
||||
extrn as_count :word
|
||||
extrn as_delay :word
|
||||
extrn inpchar :word
|
||||
endws
|
||||
|
||||
extrn addmacro :near
|
||||
extrn clrkeymode :near
|
||||
extrn csroff2 :near
|
||||
extrn csron :near
|
||||
extrn dispkeymode :near
|
||||
extrn domacro :near
|
||||
extrn ismacro :near
|
||||
extrn offkeymode :near
|
||||
extrn postmacro :near
|
||||
extrn premacro :near
|
||||
extrn puts :near
|
||||
; extrn setgbank :near
|
||||
extrn toupper :near
|
||||
extrn scantbl :near
|
||||
extrn initrolc :near
|
||||
extrn is_dossilent :near
|
||||
extrn do_evmac :near
|
||||
extrn strichr :near
|
||||
extrn editloc :near
|
||||
|
||||
dseg ; eseg
|
||||
|
||||
;--- Local work ---
|
||||
|
||||
keysym db 16 dup(0)
|
||||
;breakf db 0 ; ##155.83
|
||||
keymode db 0
|
||||
fkeycnt db 0
|
||||
fkeytype db 0 ; ##16
|
||||
tblsize dw 0
|
||||
tblmode dw 0
|
||||
as_waitc dw 0 ; ##16
|
||||
gkey_sp dw 0 ; ##16
|
||||
as_ringp dw 0 ; ##16
|
||||
kmg_ctrl db " ^ "
|
||||
|
||||
latch db 0 ; + latch, - sense
|
||||
trgp dw 0
|
||||
trgbit db 0
|
||||
trgc db 0
|
||||
sft db 0
|
||||
IFNDEF US
|
||||
KKfunc dd 0 ; ##156.90
|
||||
Func dw 5 ;5=function call mode
|
||||
Func0 dw 0
|
||||
dd 3 dup (0)
|
||||
ENDIF
|
||||
;
|
||||
; endes
|
||||
;
|
||||
; bseg
|
||||
GDATA fpmode, db, 0 ; ##156.109
|
||||
lastkey dw 0FFFEh
|
||||
endds ; endbs
|
||||
|
||||
iseg
|
||||
assume ds:nothing
|
||||
|
||||
;--- Init FEP ---
|
||||
|
||||
public initfp
|
||||
initfp proc
|
||||
IFNDEF US
|
||||
pushm <ds,es>
|
||||
movseg ds,cs
|
||||
mov ch,fptype
|
||||
mov si,offset cgroup:tb_fep
|
||||
clr cl
|
||||
_repeat
|
||||
inc cl
|
||||
inifp1:
|
||||
clr ax
|
||||
mov es,ax
|
||||
mov bl,[si].fp_int
|
||||
tst bl
|
||||
jz inifp_x
|
||||
cmp bl,FP_MSKANJI
|
||||
_if e ; ##156.90
|
||||
push cx
|
||||
call ismskanji
|
||||
pop ax
|
||||
jnc inifp8
|
||||
mov cx,ax
|
||||
inc si
|
||||
jmp inifp1
|
||||
_endif
|
||||
cmp bl,FP_DEVICE ; ##156.90
|
||||
_if e
|
||||
push cx
|
||||
mov dx,[si].fp_idoff
|
||||
clr cx
|
||||
msdos F_OPEN,0
|
||||
pop cx
|
||||
_ifn c
|
||||
mov bx,ax
|
||||
msdos F_CLOSE
|
||||
jmps inifp8
|
||||
_endif
|
||||
_else
|
||||
clr bh
|
||||
shlm bx,2
|
||||
mov ax,es:[bx].@off ; ##155.78
|
||||
cmp ax,es:[bx-4].@off
|
||||
je inifp2
|
||||
cmp cl,ch
|
||||
je inifp8
|
||||
tst ch ; ##156.90
|
||||
jnz inifp2
|
||||
mov es,es:[bx].@seg
|
||||
clr bx
|
||||
tstb [si].fp_absoff
|
||||
_ifn z
|
||||
mov bx,ax
|
||||
_endif
|
||||
add bx,[si].fp_idoff
|
||||
mov ax,es:[bx]
|
||||
cmp ax,[si].fp_id
|
||||
je inifp8
|
||||
_endif
|
||||
inifp2: add si,type _fep
|
||||
_until
|
||||
inifp_x:
|
||||
clr cl
|
||||
inifp8: mov fptype,cl
|
||||
mov al,sysmode0
|
||||
mov fpmode,al
|
||||
popm <es,ds>
|
||||
ENDIF
|
||||
VZ_RET
|
||||
initfp endp
|
||||
|
||||
;--- Check MS-KANJI API --- ; ##156.90
|
||||
|
||||
IFNDEF US
|
||||
mskID db "@:MS$KANJI",0
|
||||
|
||||
ismskanji proc
|
||||
mov dx,offset cgroup:mskID
|
||||
clr cx
|
||||
msdos F_OPEN,0
|
||||
_ifn c
|
||||
mov bx,ax
|
||||
mov cx,4
|
||||
mov dx,offset cgroup:KKfunc
|
||||
movseg ds,ss
|
||||
msdos F_IOCTRL,2
|
||||
msdos F_CLOSE
|
||||
mov cl,FP_MSK
|
||||
movseg ds,cs
|
||||
clc
|
||||
_endif
|
||||
VZ_RET
|
||||
ismskanji endp
|
||||
|
||||
ENDIF
|
||||
endis
|
||||
|
||||
eseg
|
||||
assume ds:cgroup
|
||||
|
||||
;--- Get/Set key table ---
|
||||
|
||||
public getdoskey
|
||||
getdoskey proc
|
||||
tstb breakf ; ##156.129
|
||||
_if s
|
||||
msdos F_CTRL_C,0
|
||||
mov breakf,dl
|
||||
mov dl,FALSE
|
||||
msdos F_CTRL_C,1
|
||||
call on_ezkey
|
||||
mov dx,dosktbl
|
||||
call getkeytbl
|
||||
_endif
|
||||
VZ_RET
|
||||
getdoskey endp
|
||||
|
||||
public setdoskey
|
||||
setdoskey proc
|
||||
mov dl,-1
|
||||
xchg dl,breakf
|
||||
msdos F_CTRL_C,1
|
||||
call off_ezkey
|
||||
mov dx,dosktbl
|
||||
mov al,KEY_DOS
|
||||
call setkey
|
||||
VZ_RET
|
||||
setdoskey endp
|
||||
|
||||
public setvzkey
|
||||
setvzkey proc
|
||||
push ds
|
||||
movseg ds,ss
|
||||
cmp keymode,KEY_VZ
|
||||
clc
|
||||
_ifn e
|
||||
mov dx,vzktbl
|
||||
mov al,KEY_VZ
|
||||
call setkey
|
||||
stc
|
||||
_endif
|
||||
pop ds
|
||||
VZ_RET
|
||||
setvzkey endp
|
||||
|
||||
;--- Control EZKEY ---
|
||||
|
||||
on_ezkey proc
|
||||
mov al,TRUE
|
||||
jmps ctrezkey
|
||||
off_ezkey:
|
||||
mov al,FALSE
|
||||
ctrezkey:
|
||||
test hardware,IDN_PC98
|
||||
_if z
|
||||
push es
|
||||
push ax
|
||||
msdos F_GETVCT,INT_EZKEY
|
||||
pop ax
|
||||
cmp word ptr es:[bx-2],'ZE'
|
||||
_if e
|
||||
or extsw,ESW_EZKEY
|
||||
mov ah,2 ; EZKEY set status
|
||||
int INT_EZKEY
|
||||
_else
|
||||
and extsw,not ESW_EZKEY
|
||||
_endif
|
||||
pop es
|
||||
_endif
|
||||
VZ_RET
|
||||
on_ezkey endp
|
||||
|
||||
vwx_call proc
|
||||
int 0E9h
|
||||
retf
|
||||
vwx_call endp
|
||||
|
||||
;****************************
|
||||
; Get key
|
||||
;****************************
|
||||
;-->
|
||||
; AL :cursor type (0=insert, 1=overwrite, -1=off)
|
||||
; DL :system mode
|
||||
;<--
|
||||
; AL : + command code, - macro code(NOT)
|
||||
; DX :input data (AL=0)
|
||||
; ZR : tst al
|
||||
|
||||
public getkey,gkey0
|
||||
getkey proc
|
||||
pushm <bx,cx,si,di,ds>
|
||||
movseg ds,ss
|
||||
movseg es,ss
|
||||
mov ah,dl
|
||||
gkey00:
|
||||
mov sysmode,ah
|
||||
push ax
|
||||
gkey0:
|
||||
call premacro
|
||||
jmpl c,gkey8
|
||||
movseg es,ss
|
||||
pop ax
|
||||
mov sysmode,ah
|
||||
cmp ah,SYS_SEDIT
|
||||
_if e
|
||||
push ax
|
||||
call editloc
|
||||
pop ax
|
||||
_endif
|
||||
push ax
|
||||
call csron
|
||||
gkey1:
|
||||
mov gkey_sp,sp
|
||||
call pre_delay
|
||||
call getkeycode
|
||||
jc gkey1
|
||||
tst ax
|
||||
_ifn z
|
||||
mov dx,0
|
||||
_endif
|
||||
mov inpchar,dx
|
||||
_if z
|
||||
cmp sysmode,SYS_SEDIT
|
||||
_if e
|
||||
tstw as_count
|
||||
_ifn z
|
||||
inc [bp].inpcnt
|
||||
_endif
|
||||
mov si,[bp].ektbl
|
||||
tst si
|
||||
_ifn z
|
||||
call event_key
|
||||
jc gkey0
|
||||
_endif
|
||||
_endif
|
||||
_endif
|
||||
tst ah
|
||||
jmpl z,gkey7
|
||||
cbw
|
||||
test extsw,ESW_ESCKEY
|
||||
_if z
|
||||
cmp sysmode,SYS_SEDIT
|
||||
je gpfix2
|
||||
_endif
|
||||
cmp ax,0FF9Ah ; [ESC]
|
||||
je gcmd11
|
||||
gpfix2: call cvtpfix
|
||||
jc gkey1
|
||||
gcmd1:
|
||||
tstb macmode ; ##154.69
|
||||
_if z
|
||||
push ax
|
||||
call chkstopkey
|
||||
pop ax
|
||||
jc gkey1
|
||||
_endif
|
||||
cmp sysmode,SYS_SEDIT
|
||||
_if e
|
||||
push ax
|
||||
call ismacro
|
||||
pop ax
|
||||
_if c
|
||||
mov lastkey,ax
|
||||
jmp gkey0
|
||||
_endif
|
||||
_endif
|
||||
gcmd11:
|
||||
mov di,ckeytbl
|
||||
mov dx,di
|
||||
call scankey1
|
||||
_if c
|
||||
mov ax,lastkey
|
||||
jmp gcmd1
|
||||
_endif
|
||||
mov bl,sysmode
|
||||
tst bl
|
||||
_if z
|
||||
mov lastkey,ax
|
||||
_endif
|
||||
call scankey1
|
||||
jc gmacro
|
||||
call scancmkey
|
||||
jnc gcmd5
|
||||
gcmd4:
|
||||
mov ax,di
|
||||
sub ax,dx
|
||||
shr ax,1
|
||||
cmp al,CM_CTRL
|
||||
je gctrlchr
|
||||
jmps gkey7
|
||||
gcmd5:
|
||||
cmp ax,0FFDCh ; ##151.10 [CTRL]+[BS]
|
||||
_if e
|
||||
mov al,14 ; Backspace
|
||||
jmps gkey81
|
||||
_endif
|
||||
cmp sysmode,SYS_SEDIT ; ##152.14
|
||||
_ifn e
|
||||
call ismacro
|
||||
_if c
|
||||
cmp sysmode,SYS_GETC
|
||||
_if e
|
||||
mov al,dl
|
||||
jmps gkey7
|
||||
_endif
|
||||
_endif
|
||||
_endif
|
||||
call addmacro
|
||||
jmp gkey0
|
||||
gmacro:
|
||||
call domacro
|
||||
gkey1b: jmp gkey1
|
||||
gctrlchr:
|
||||
mov si,offset cgroup:kmg_ctrl
|
||||
call getalpha
|
||||
jc gkey1b
|
||||
cmp al,LF
|
||||
je gkey1b
|
||||
cbw
|
||||
mov dx,ax
|
||||
clr al
|
||||
gkey7:
|
||||
pushm <ax,dx>
|
||||
call postmacro
|
||||
jnc gkey80
|
||||
popm <dx,ax> ; ##154.69
|
||||
pop ax
|
||||
jmp gkey00
|
||||
gkey80:
|
||||
call offkeymode
|
||||
popm <dx,ax>
|
||||
gkey8:
|
||||
cmp sysmode,SYS_DOS
|
||||
_ifn e
|
||||
tst al
|
||||
_ifn z
|
||||
call flush_key
|
||||
_endif
|
||||
_endif
|
||||
gkey81:
|
||||
; call setgbank
|
||||
push ax
|
||||
call csroff2
|
||||
pop ax
|
||||
pop bx
|
||||
popm <ds,di,si,cx,bx>
|
||||
tst al
|
||||
VZ_RET
|
||||
getkey endp
|
||||
|
||||
;----- Auto saver -----
|
||||
|
||||
pre_delay proc
|
||||
call get_time
|
||||
mov as_waitc,ax
|
||||
call get_ringp
|
||||
mov as_ringp,ax
|
||||
VZ_RET
|
||||
pre_delay endp
|
||||
|
||||
check_delay proc
|
||||
cmp sysmode,SYS_SEDIT
|
||||
jne chkdly9
|
||||
mov cx,as_delay
|
||||
tst cx
|
||||
jz chkdly9
|
||||
tstw as_ringp
|
||||
jz chkdly9
|
||||
call get_ringp
|
||||
cmp ax,as_ringp
|
||||
_ifn e
|
||||
mov as_ringp,0
|
||||
jmps chkdly9
|
||||
_endif
|
||||
call get_time
|
||||
sub ax,as_waitc
|
||||
_if c
|
||||
add ax,3600
|
||||
_endif
|
||||
cmp ax,cx
|
||||
_if ae
|
||||
mov al,EV_TIMER
|
||||
call do_evmac
|
||||
mov sp,gkey_sp
|
||||
jmp gkey0
|
||||
_endif
|
||||
chkdly9: VZ_RET
|
||||
check_delay endp
|
||||
|
||||
get_time proc
|
||||
pushm <cx,dx>
|
||||
msdos 2Ch
|
||||
mov al,60
|
||||
mul cl
|
||||
add al,dh
|
||||
adc ah,0
|
||||
popm <dx,cx>
|
||||
VZ_RET
|
||||
get_time endp
|
||||
|
||||
;----- Event key -----
|
||||
|
||||
event_key proc
|
||||
push dx
|
||||
call strichr
|
||||
_if c
|
||||
mov al,EV_EDIT
|
||||
call do_evmac
|
||||
_endif
|
||||
pop dx
|
||||
VZ_RET
|
||||
event_key endp
|
||||
|
||||
;----- Scan Command -----
|
||||
;<-- CY :found
|
||||
|
||||
tb_scancmd:
|
||||
ofs scc_sedit
|
||||
ofs scc_gets
|
||||
ofs scc_dos
|
||||
ofs scc_filer
|
||||
ofs scc_getc
|
||||
|
||||
scancmkey proc
|
||||
push bx
|
||||
clr bh
|
||||
shl bx,1
|
||||
add bx,offset cgroup:tb_scancmd
|
||||
call cs:[bx]
|
||||
pop bx
|
||||
VZ_RET
|
||||
|
||||
scc_sedit:
|
||||
mov cx,CM_FILER - CM_ESC
|
||||
jmps scankey
|
||||
|
||||
scc_gets:
|
||||
mov cx,CM_SEDIT - CM_ESC
|
||||
jmps scankey
|
||||
|
||||
scc_dos:
|
||||
call scc_gets
|
||||
jc scfl9
|
||||
add di,(CM_DOS - CM_SEDIT)*2
|
||||
mov cx,CMCNT - CM_DOS
|
||||
jmps scfl7
|
||||
scc_filer:
|
||||
mov cx,CM_COMMON-CM_ESC
|
||||
call scankey
|
||||
jc scfl9
|
||||
add di,(CM_FILER - CM_COMMON)*2
|
||||
mov cx,CM_DOS - CM_FILER
|
||||
call scankey
|
||||
jc scfl8
|
||||
sub di,(CM_DOS - CM_COMMON)*2
|
||||
mov cx,CM_FILER1 - CM_COMMON
|
||||
call scankey
|
||||
jc scfl8
|
||||
add di,(CM_SFTCR - CM_FILER1)*2
|
||||
mov cx,1
|
||||
scfl7: call scankey
|
||||
_if c
|
||||
scfl8: mov lastkey,ax
|
||||
_endif
|
||||
scfl9: VZ_RET
|
||||
|
||||
scc_getc:
|
||||
mov cx,CM_FILER-CM_ESC
|
||||
jmps scankey
|
||||
scancmkey endp
|
||||
|
||||
;--- Scan key table ---
|
||||
;-->
|
||||
; AX :key code
|
||||
; DI :key table ptr
|
||||
;<--
|
||||
; CY :found
|
||||
|
||||
public scankey1
|
||||
scankey1:
|
||||
mov cx,1
|
||||
scankey proc
|
||||
shl cx,1
|
||||
sckey1:
|
||||
jcxz sckey_x
|
||||
repnz scasb
|
||||
jne sckey_x
|
||||
tst al
|
||||
_if s
|
||||
test cl,1
|
||||
_ifn z
|
||||
tst ah
|
||||
jnz sckey1
|
||||
_else
|
||||
tst ah
|
||||
jz sckey1
|
||||
_endif
|
||||
_endif
|
||||
inc di
|
||||
and di,not 1
|
||||
stc
|
||||
VZ_RET
|
||||
sckey_x:
|
||||
clc
|
||||
VZ_RET
|
||||
scankey endp
|
||||
|
||||
;--- Check STOP key ---
|
||||
;<-- CY :stop key
|
||||
|
||||
public chkstopkey
|
||||
chkstopkey proc
|
||||
clr al
|
||||
xchg cs:stopf,al
|
||||
tst al
|
||||
_ifn z
|
||||
mov dl,0FFh
|
||||
msdos F_CONIO
|
||||
stc
|
||||
_endif
|
||||
VZ_RET
|
||||
chkstopkey endp
|
||||
|
||||
;--- Convert prefix key ---
|
||||
;--> AX :key code
|
||||
;<--
|
||||
; AX :2 stroke key code
|
||||
; CY :error
|
||||
; ZR :[ESC]0
|
||||
|
||||
cvtpfix proc
|
||||
mov di,offset cgroup:pkeytbl
|
||||
mov cx,PKEYCNT
|
||||
repne scasb
|
||||
jne cvpf9
|
||||
push ax
|
||||
mov dl,al
|
||||
mov al,PKEYCNT-1
|
||||
sub al,cl
|
||||
push ax
|
||||
clr dh
|
||||
mov di,offset cgroup:keysym
|
||||
push di
|
||||
call setpkeysym
|
||||
pop si
|
||||
call getalpha
|
||||
pop dx
|
||||
pop cx
|
||||
_if c
|
||||
sub al,30h
|
||||
jb cvpf_x
|
||||
cmp al,0Fh
|
||||
ja cvpf_x
|
||||
clr ah ; stz
|
||||
mov retval,ax
|
||||
mov ax,cx
|
||||
VZ_RET
|
||||
_endif
|
||||
add dl,2
|
||||
rorm dl,3
|
||||
or al,dl
|
||||
clr ah
|
||||
cvpf9: or dl,1 ; clz
|
||||
VZ_RET
|
||||
cvpf_x: stc
|
||||
VZ_RET
|
||||
cvtpfix endp
|
||||
|
||||
;--- Get A,^A key ---
|
||||
;<--
|
||||
; CY :error
|
||||
; NC,AL :char code
|
||||
|
||||
getalpha proc
|
||||
test extsw,ESW_FPQUIT ; ##156.109
|
||||
_ifn z
|
||||
call resetfp
|
||||
_endif
|
||||
call dispkeymode
|
||||
call wait_key
|
||||
call clrkeymode
|
||||
tst al
|
||||
_if z
|
||||
cmp ah,1Ah ; ^@
|
||||
jne getal_x
|
||||
_endif
|
||||
cmp al,20h
|
||||
jb getal8
|
||||
call toupper
|
||||
cmp al,40h
|
||||
jb cvpf_x
|
||||
cmp al,5Fh
|
||||
ja cvpf_x
|
||||
and al,1Fh
|
||||
getal8: clc
|
||||
VZ_RET
|
||||
getal_x:stc
|
||||
VZ_RET
|
||||
getalpha endp
|
||||
|
||||
;--- KANA to aplha ---
|
||||
|
||||
public cvtkanakey
|
||||
cvtkanakey proc
|
||||
IFDEF CVTKANA
|
||||
cmp al,SPC
|
||||
_if a
|
||||
pushm <cx,di>
|
||||
mov di,kanatbl ; ##155.77
|
||||
tstb [di]
|
||||
_ifn z
|
||||
mov cx,42 ; ##156.111
|
||||
repne scasb
|
||||
_if e
|
||||
mov al,'@'+42-1
|
||||
sub al,cl
|
||||
cmp al,'@'+32
|
||||
_if ae
|
||||
sub al,'@'+32-'0'
|
||||
_endif
|
||||
_endif
|
||||
_endif
|
||||
popm <di,cx>
|
||||
_endif
|
||||
ENDIF
|
||||
VZ_RET
|
||||
cvtkanakey endp
|
||||
|
||||
;--- Store decimal word ---
|
||||
;--> AL :store data
|
||||
|
||||
public storedeciw
|
||||
storedeciw proc
|
||||
aam
|
||||
xchg al,ah
|
||||
add ax,3030h
|
||||
stosw
|
||||
VZ_RET
|
||||
storedeciw endp
|
||||
|
||||
;--- Display key symbol ---
|
||||
;--> AX :pare of key code
|
||||
|
||||
public dispkeysym ; ##1.5
|
||||
dispkeysym proc
|
||||
pushm <cx,si,di>
|
||||
mov di,offset cgroup:keysym
|
||||
push di
|
||||
call setkeysym
|
||||
pop si
|
||||
call puts
|
||||
popm <di,si,cx>
|
||||
VZ_RET
|
||||
dispkeysym endp
|
||||
|
||||
;--- Set key symbol ---
|
||||
;-->
|
||||
; AX :pare of key code
|
||||
; DI :store ptr
|
||||
|
||||
public setkeysym
|
||||
setkeysym proc
|
||||
mov byte ptr [di],0
|
||||
cmp al,INVALID
|
||||
_ifn e
|
||||
push ax
|
||||
mov ah,0
|
||||
call setkeysym1
|
||||
pop ax
|
||||
cmp ah,INVALID
|
||||
_ifn e
|
||||
mov byte ptr [di-1],SPC
|
||||
_endif
|
||||
_endif
|
||||
cmp ah,INVALID
|
||||
_ifn e
|
||||
mov al,ah
|
||||
cbw
|
||||
call setkeysym1
|
||||
_endif
|
||||
VZ_RET
|
||||
|
||||
setkeysym1:
|
||||
cmp ax,0040h
|
||||
jl setpkeysym1
|
||||
pushm <ax,bx>
|
||||
mov bx,offset cgroup:pkeytbl-2
|
||||
rolm al,3
|
||||
and al,00000111b
|
||||
xlat
|
||||
call setpkeysym1
|
||||
popm <bx,ax>
|
||||
and al,1Fh
|
||||
add al,40h
|
||||
dec di
|
||||
stosb
|
||||
clr al
|
||||
stosb
|
||||
VZ_RET
|
||||
setkeysym endp
|
||||
|
||||
;--- Set prefix key symbol ---
|
||||
;-->
|
||||
; DL :key code
|
||||
; DH :0=ESC, 1=[ESC]
|
||||
; DI :store ptr
|
||||
;<--
|
||||
; DI :next store ptr
|
||||
|
||||
setpkeysym1:
|
||||
mov dl,al
|
||||
mov dh,1
|
||||
setpkeysym proc
|
||||
tst dl
|
||||
js dsppk2
|
||||
mov al,KSYM_CTRL
|
||||
test dl,00100000b
|
||||
jz dsppk1
|
||||
mov al,KSYM_ALT
|
||||
dsppk1: mov ah,dl
|
||||
and ah,1Fh
|
||||
add ah,40h
|
||||
stosw
|
||||
jmps dsppk8
|
||||
dsppk2: tst dh
|
||||
jz dsppk4
|
||||
mov ah,dl
|
||||
and ah,01100000b
|
||||
jz dsppk31
|
||||
mov al,KSYM_SHIFT
|
||||
cmp ah,01000000b
|
||||
jb dsppk3
|
||||
mov al,KSYM_CTRL
|
||||
je dsppk3
|
||||
mov al,KSYM_ALT
|
||||
dsppk3: stosb
|
||||
dsppk31:mov al,KSYM_L
|
||||
stosb
|
||||
dsppk4: mov al,dl
|
||||
and al,1Fh
|
||||
cmp al,10h
|
||||
jb dsppk6
|
||||
and al,0Fh
|
||||
shlm al,2
|
||||
cbw
|
||||
mov si,offset cgroup:tb_xkey
|
||||
add si,ax
|
||||
mov cx,4
|
||||
dsppk5: lods cs:tb_xkey
|
||||
cmp al,SPC
|
||||
je dsppk7
|
||||
stosb
|
||||
loop dsppk5
|
||||
jmps dsppk7
|
||||
dsppk6: push ax
|
||||
mov al,'F'
|
||||
stosb
|
||||
pop ax
|
||||
call storedeciw
|
||||
dsppk7: tst dh
|
||||
jz dsppk8
|
||||
mov al,KSYM_R
|
||||
stosb
|
||||
dsppk8: clr al
|
||||
stosb
|
||||
VZ_RET
|
||||
setpkeysym endp
|
||||
|
||||
;--- Get one char ---
|
||||
;--> AL :cursor type (0=insert, 1=overwrite, -1=off)
|
||||
;<-- AL 01h-08h :command code
|
||||
; 20h-5Fh :char(toupper)
|
||||
; 00h :other key(AH)
|
||||
; CY :escape
|
||||
|
||||
public getc
|
||||
getc proc
|
||||
getc1: mov dl,SYS_GETC
|
||||
call getkey
|
||||
jz getc2
|
||||
js getc_x
|
||||
cmp al,CM_COMMON
|
||||
jae getc_x
|
||||
cmp al,CM_ESC
|
||||
jne getc8
|
||||
stc
|
||||
VZ_RET
|
||||
getc2: mov al,dl
|
||||
call toupper
|
||||
getc8: clc
|
||||
VZ_RET
|
||||
getc_x:
|
||||
mov ah,al
|
||||
clr al
|
||||
VZ_RET
|
||||
getc endp
|
||||
|
||||
;--- Check FEP ---
|
||||
;--> AH :sysmode
|
||||
|
||||
public resetfp,ctrlfp ; ##156.110
|
||||
resetfp:
|
||||
IFDEF US
|
||||
checkfp:
|
||||
ctrlfp:
|
||||
VZ_RET
|
||||
ELSE
|
||||
mov ah,SYS_DOS
|
||||
checkfp proc
|
||||
call isDBCS ; ##156.132
|
||||
push ax
|
||||
test syssw,SW_FP
|
||||
jz chkfp9
|
||||
mov al,fptype
|
||||
tst al
|
||||
jz chkfp9
|
||||
cmp ah,sysmode0
|
||||
je chkfp9
|
||||
tst ah
|
||||
_if z
|
||||
call ctrlfp
|
||||
_else
|
||||
tstb sysmode0
|
||||
_if z
|
||||
mov ah,FEP_OFF
|
||||
call ctrlfp
|
||||
mov fpmode,al ; ##151.11
|
||||
_endif
|
||||
_endif
|
||||
chkfp9: pop ax
|
||||
mov sysmode0,ah
|
||||
VZ_RET
|
||||
checkfp endp
|
||||
|
||||
;--- Control FEP ---
|
||||
;-->
|
||||
; AH :FEP control code
|
||||
|
||||
ctrlfp proc
|
||||
call isDBCS ; ##156.132
|
||||
pushm <bx,cx,dx,ds,es>
|
||||
movseg ds,ss
|
||||
test syssw,SW_FP
|
||||
_ifn z
|
||||
mov al,fptype
|
||||
tst al
|
||||
_ifn z
|
||||
mov bl,al ; ##156.90
|
||||
cmp al,FP_MSK
|
||||
_if e
|
||||
clr bl
|
||||
_endif
|
||||
clr bh
|
||||
shlm bx,2
|
||||
add bl,ah
|
||||
adc bh,0
|
||||
shl bx,1
|
||||
add bx,offset cgroup:tb_fepjmp
|
||||
mov al,fpmode
|
||||
call cs:[bx]
|
||||
; mov fpmode,al ; ##151.11
|
||||
_endif
|
||||
_endif
|
||||
popm <es,ds,dx,cx,bx>
|
||||
VZ_RET
|
||||
ctrlfp endp
|
||||
|
||||
ENDIF
|
||||
endes
|
||||
|
||||
IFDEF PC98
|
||||
include key98.asm
|
||||
ELSE
|
||||
include keyibm.asm
|
||||
ENDIF
|
||||
end
|
||||
|
||||
;****************************
|
||||
; End of 'key.asm'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
||||
|
957
SRC/key98.asm
957
SRC/key98.asm
@ -1,957 +0,0 @@
|
||||
;****************************
|
||||
; 'key98.asm'
|
||||
;****************************
|
||||
|
||||
;--- Equations ---
|
||||
|
||||
ATOK7 equ TRUE
|
||||
|
||||
FKEYCODE equ 07Fh
|
||||
DOSXKEYC equ 11
|
||||
XKEYCNT equ 5
|
||||
TENKEYCNT equ 17
|
||||
XKEY_ESC equ 10h+10
|
||||
KEY_SHIFT equ 00000001b
|
||||
KEY_KANA equ 00000100b
|
||||
KEY_ALT equ 00001000b
|
||||
KEY_CTRL equ 00010000b
|
||||
SCAN_RLUP equ 36h
|
||||
SCAN_CLR equ 3Eh
|
||||
SCAN_HOME equ 0AEh
|
||||
SCAN_F01 equ 062h
|
||||
SCAN_CTR_F01 equ 092h
|
||||
SCAN_TENKEY equ 40h
|
||||
KTBLSZ equ 16*20+6*11
|
||||
KTBLSZ2 equ 16*30+6*11
|
||||
KTBLSZ3 equ 16*45+6*11
|
||||
|
||||
ringp equ 0526h
|
||||
keycnt equ 0528h
|
||||
keytbl equ 052Ah
|
||||
keysft equ 053Ah
|
||||
|
||||
INT_VJEB equ 70h
|
||||
INT_MTTK equ 70h
|
||||
INT_ATOK equ 6Fh
|
||||
INT_WXP equ 70h
|
||||
|
||||
bseg
|
||||
GDATA stopintnum,dw, 06h*4
|
||||
endbs
|
||||
|
||||
;--- External symbols ---
|
||||
|
||||
wseg
|
||||
extrn cmdlinef :byte
|
||||
|
||||
; extrn ds_shift :word
|
||||
extrn fkeytbl :word
|
||||
extrn tenkey_c :word
|
||||
extrn tenkey_g :word
|
||||
endws
|
||||
|
||||
extrn chkscreen :near
|
||||
extrn iskanji :near
|
||||
; extrn chkmem :near
|
||||
|
||||
hseg
|
||||
|
||||
;--- Constants ---
|
||||
|
||||
public tb_xkey
|
||||
tb_xkey db "RLUPRLDNINS DEL UP <-- --> DOWNCLR HELP"
|
||||
db "ESC TAB BS CR NFER"
|
||||
db "PGDNPGUPHOMEEND "
|
||||
|
||||
tb_xkeyscan db "[IHM_"
|
||||
db 1Bh,17h,22h,2Fh,33h
|
||||
db 00h,0Fh,0Eh,1Ch,51h
|
||||
|
||||
tb_tenkey db "-/789*456+123=0,."
|
||||
|
||||
tb_fep: _fep <INT_VJEB,12h,0,'JV'>
|
||||
_fep <INT_MTTK,12h,0,'TM'>
|
||||
_fep <INT_ATOK,03h,1,'TA'>
|
||||
_fep <INT_WXP ,22h,0,'XW'> ; ##155.78
|
||||
IFDEF ATOK7
|
||||
_fep <INT_ATOK,33h,1,'7K'> ; ##156j.04
|
||||
ENDIF
|
||||
db FP_MSKANJI
|
||||
db 0
|
||||
|
||||
assume ds:cgroup
|
||||
|
||||
;--- FEP control routine ---
|
||||
|
||||
fpctr macro fep
|
||||
dw offset cgroup:fep&_on
|
||||
dw offset cgroup:fep&_off
|
||||
dw offset cgroup:fep&_act
|
||||
dw offset cgroup:fep&_mask
|
||||
endm
|
||||
|
||||
tb_fepjmp:
|
||||
fpctr msk ; ##156.90
|
||||
fpctr vje
|
||||
fpctr mttk
|
||||
fpctr atok
|
||||
fpctr wxp ; ##155.78
|
||||
IFDEF ATOK7
|
||||
fpctr atok7 ; ##156j.04
|
||||
ENDIF
|
||||
; fpctr else
|
||||
|
||||
vje_on:
|
||||
mov ah,1
|
||||
int INT_VJEB
|
||||
VZ_RET
|
||||
vje_off:
|
||||
mov ah,0
|
||||
int INT_VJEB
|
||||
push ax
|
||||
movhl ax,1,0
|
||||
int INT_VJEB
|
||||
pop ax
|
||||
vje_act:
|
||||
vje_mask:
|
||||
VZ_RET
|
||||
|
||||
mttk_on:
|
||||
mov ah,0
|
||||
int INT_MTTK
|
||||
VZ_RET
|
||||
mttk_off:
|
||||
push es
|
||||
mov ah,21
|
||||
int INT_MTTK
|
||||
mov al,es:[bx+5]
|
||||
push ax
|
||||
clr ax
|
||||
int INT_MTTK
|
||||
pop ax
|
||||
pop es
|
||||
mttk_act:
|
||||
mttk_mask:
|
||||
VZ_RET
|
||||
|
||||
atok_on:
|
||||
tst al
|
||||
_if z
|
||||
mov al,0Bh
|
||||
_endif
|
||||
mov ah,al
|
||||
int INT_ATOK
|
||||
VZ_RET
|
||||
atok_off:
|
||||
mov ah,66h
|
||||
int INT_ATOK
|
||||
push ax
|
||||
mov ah,0Bh
|
||||
int INT_ATOK
|
||||
pop ax
|
||||
atok_act:
|
||||
atok_mask:
|
||||
VZ_RET
|
||||
|
||||
wxp_on: ; ##155.78
|
||||
mov ah,0
|
||||
int INT_WXP
|
||||
VZ_RET
|
||||
wxp_off:
|
||||
mov ah,4Ch
|
||||
int INT_WXP
|
||||
push ax
|
||||
mov ax,0
|
||||
int INT_WXP
|
||||
pop ax
|
||||
wxp_act:
|
||||
wxp_mask:
|
||||
VZ_RET
|
||||
|
||||
;--- Control ATOK7 by junk.35 ---
|
||||
|
||||
IFDEF ATOK7
|
||||
|
||||
call_a7 dd NULL
|
||||
packet dw NULL
|
||||
|
||||
atok7_on: ; ##156j.04
|
||||
call init_a7
|
||||
tst al
|
||||
_ifn z
|
||||
call atok7_force_on
|
||||
call atok7_change_mode
|
||||
_else
|
||||
call atok7_force_off
|
||||
_endif
|
||||
VZ_RET
|
||||
atok7_off:
|
||||
call init_a7
|
||||
call atok7_getmode
|
||||
call atok7_force_off
|
||||
atok7_act:
|
||||
atok7_mask:
|
||||
VZ_RET
|
||||
|
||||
atok7_getmode:
|
||||
mov ax,3
|
||||
mov cs:packet,-1
|
||||
call vz_atok7
|
||||
mov ax,cs:packet
|
||||
VZ_RET
|
||||
|
||||
atok7_change_mode:
|
||||
push ax
|
||||
mov word ptr cs:packet,ax
|
||||
mov ax,3
|
||||
jmps call_atok7
|
||||
atok7_force_on:
|
||||
push ax
|
||||
mov ax,1
|
||||
jmps call_atok7
|
||||
atok7_force_off:
|
||||
push ax
|
||||
mov ax,2
|
||||
call_atok7:
|
||||
call vz_atok7
|
||||
pop ax
|
||||
VZ_RET
|
||||
|
||||
vz_atok7:
|
||||
pushm <es,cs>
|
||||
pop es
|
||||
mov bx,offset cs:packet
|
||||
call cs:call_a7
|
||||
pop es
|
||||
VZ_RET
|
||||
|
||||
init_a7:
|
||||
tstw cs:call_a7
|
||||
_if z
|
||||
pushm <es,ax,bx>
|
||||
msdos F_GETVCT,6Fh
|
||||
add bx,20h
|
||||
mov word ptr cs:call_a7,bx
|
||||
mov word ptr cs:call_a7+2,es
|
||||
popm <bx,ax,es>
|
||||
_endif
|
||||
VZ_RET
|
||||
ENDIF
|
||||
|
||||
;--- MS-KANJI API --- ; ##156.90
|
||||
|
||||
msk_on:
|
||||
mov ah,80h
|
||||
call mskanji
|
||||
VZ_RET
|
||||
|
||||
msk_off:
|
||||
mov ax,0
|
||||
call mskanji
|
||||
push Func0
|
||||
mov ax,8001h
|
||||
call mskanji
|
||||
pop ax
|
||||
msk_act:
|
||||
msk_mask:
|
||||
VZ_RET
|
||||
|
||||
mskanji proc
|
||||
push bp
|
||||
mov bp,sp
|
||||
push bx
|
||||
mov bx,sp
|
||||
mov Func0,ax
|
||||
push ss
|
||||
mov ax,offset cgroup:Func
|
||||
push ax
|
||||
call KKfunc
|
||||
mov sp,bx
|
||||
pop bx
|
||||
pop bp
|
||||
VZ_RET
|
||||
mskanji endp
|
||||
|
||||
endhs
|
||||
|
||||
iseg
|
||||
|
||||
;--- Init key table size ---
|
||||
;--> DI :offset doskeytbl
|
||||
|
||||
public initkeytbl
|
||||
initkeytbl proc
|
||||
mov ax,0020h
|
||||
eios 11h ; ##150.03 suppress printer echo
|
||||
clr ax
|
||||
test word ptr extsw,ESW_FKEY
|
||||
_ifn z
|
||||
eios 12h
|
||||
tst ah ; ##156 DOS5.0 AX=0101h
|
||||
_ifn z
|
||||
mov al,3
|
||||
_endif
|
||||
_endif
|
||||
mov fkeytype,al
|
||||
mov ax,KTBLSZ
|
||||
clr dx
|
||||
mov cl,10
|
||||
mov ch,fkeytype
|
||||
dec ch
|
||||
_ifn s
|
||||
mov ax,KTBLSZ2
|
||||
_ifn z
|
||||
mov ax,KTBLSZ3
|
||||
_endif
|
||||
mov dl,0FFh
|
||||
mov cl,15
|
||||
_endif
|
||||
stosw
|
||||
stosw
|
||||
mov tblsize,ax
|
||||
mov tblmode,dx
|
||||
mov fkeycnt,cl
|
||||
VZ_RET
|
||||
initkeytbl endp
|
||||
|
||||
;--- Init VZ key table ---
|
||||
|
||||
public initvzkey
|
||||
initvzkey proc
|
||||
movseg es,ss
|
||||
mov si,fkeytbl
|
||||
mov di,vzktbl
|
||||
; mov ax,ds_shift
|
||||
; add si,ax
|
||||
; add di,ax
|
||||
; add ax,dosktbl
|
||||
; call chkmem
|
||||
mov dh,20h ; ##150.03
|
||||
call initfnckey
|
||||
mov dh,40h ; shift+
|
||||
call initfnckey
|
||||
call initxkey
|
||||
cmp fkeytype,3 ; ##156.137
|
||||
_if e
|
||||
mov dh,60h ; ctrl+
|
||||
call initfnckey
|
||||
_endif
|
||||
VZ_RET
|
||||
initvzkey endp
|
||||
|
||||
initxkey proc
|
||||
mov cx,DOSXKEYC
|
||||
mov dl,30h ; ##150.03
|
||||
_repeat
|
||||
mov ah,dl
|
||||
mov al,FKEYCODE
|
||||
stosw
|
||||
clr ax
|
||||
stosw
|
||||
stosw
|
||||
cmp cx,2
|
||||
_if e
|
||||
dec dl ; HOME
|
||||
_else
|
||||
inc dl
|
||||
_endif
|
||||
_loop
|
||||
VZ_RET
|
||||
initxkey endp
|
||||
|
||||
initfnckey proc
|
||||
mov dl,1
|
||||
_repeat
|
||||
mov al,0FEh
|
||||
stosb
|
||||
mov cx,5
|
||||
mov al,[si]
|
||||
cmp al,CR
|
||||
je ifkey1
|
||||
_repeat
|
||||
lodsb
|
||||
tst al
|
||||
jz ifkey1
|
||||
stosb
|
||||
_loop
|
||||
_repeat
|
||||
lodsb
|
||||
tst al
|
||||
_until z
|
||||
ifkey1:
|
||||
mov al,SPC
|
||||
rep stosb
|
||||
mov cx,8
|
||||
mov al,FKEYCODE
|
||||
stosb
|
||||
mov al,dl
|
||||
or al,dh
|
||||
stosb
|
||||
clr al
|
||||
rep stosb
|
||||
inc dl
|
||||
cmp dl,fkeycnt
|
||||
_while be
|
||||
_repeat
|
||||
lodsb
|
||||
cmp al,CR
|
||||
_until e
|
||||
cmp byte ptr [si],-1
|
||||
_if e
|
||||
dec si
|
||||
_endif
|
||||
VZ_RET
|
||||
initfnckey endp
|
||||
|
||||
endis
|
||||
|
||||
hseg
|
||||
|
||||
;--- Get/Set key table ---
|
||||
|
||||
; public getkeytbl
|
||||
getkeytbl proc
|
||||
call is_dossilent
|
||||
mov cl,0Ch
|
||||
getkeytbl1:
|
||||
push ds
|
||||
movseg ds,ss
|
||||
mov ax,tblmode
|
||||
int 0DCh
|
||||
pop ds
|
||||
VZ_RET
|
||||
getkeytbl endp
|
||||
|
||||
; public setkey
|
||||
setkey proc
|
||||
call is_dossilent
|
||||
mov keymode,al
|
||||
cmp al,KEY_VZ ; ##156.137
|
||||
mov ax,0
|
||||
_ifn e
|
||||
inc ax
|
||||
_endif
|
||||
eios 0Fh
|
||||
mov cl,0Dh
|
||||
jmp getkeytbl1
|
||||
setkey endp
|
||||
|
||||
public setfnckey
|
||||
setfnckey proc
|
||||
call is_dossilent
|
||||
pushm <ds,es>
|
||||
movseg ds,ss
|
||||
movseg es,ss
|
||||
cmp keymode,KEY_FNC
|
||||
_ifn e
|
||||
call swapktbl
|
||||
mov dx,dosktbl
|
||||
mov al,KEY_FNC
|
||||
call setkey
|
||||
call swapktbl
|
||||
_endif
|
||||
popm <es,ds>
|
||||
VZ_RET
|
||||
setfnckey endp
|
||||
|
||||
swapktbl proc
|
||||
mov di,vzktbl ; ##154.63
|
||||
mov bx,tblsize
|
||||
add di,16*20
|
||||
tstb tblmode
|
||||
_ifn z
|
||||
add di,16*10
|
||||
_endif
|
||||
mov cx,6*11/2
|
||||
swapk1: mov ax,[di]
|
||||
xchg [di+bx],ax
|
||||
stosw
|
||||
loop swapk1
|
||||
VZ_RET
|
||||
swapktbl endp
|
||||
|
||||
;--- Get keycode ---
|
||||
|
||||
public getkeycode
|
||||
getkeycode proc
|
||||
mov ah,sysmode
|
||||
cmp ah,SYS_FILER
|
||||
_if b
|
||||
call checkfp
|
||||
cmp ah,SYS_DOS
|
||||
_if e
|
||||
tstb cs:cmdlinef
|
||||
_ifn z
|
||||
clr bx
|
||||
_repeat
|
||||
call check_delay
|
||||
call chkscreen ; ##156.133
|
||||
int 28h ; ##1.5
|
||||
msdos F_IOCTRL,6
|
||||
tst al
|
||||
_while z
|
||||
cmp ah,03h ; CTRL-C
|
||||
mov ah,F_CONIN
|
||||
_if e
|
||||
mov ah,F_READKEY
|
||||
_endif
|
||||
int 21h
|
||||
jmps gchar1
|
||||
_endif
|
||||
_endif
|
||||
_repeat
|
||||
call check_delay
|
||||
mov dl,0FFh
|
||||
msdos F_CONIO
|
||||
_while z
|
||||
gchar1: clr ah
|
||||
_else
|
||||
_repeat
|
||||
call check_delay
|
||||
int 28h ; ##16
|
||||
call read_key
|
||||
_while z
|
||||
IFDEF CVTKANA
|
||||
call cvtkanakey
|
||||
ENDIF
|
||||
_endif
|
||||
cmp ax,1A00h ; ^@ ##16
|
||||
_if e
|
||||
clr ax
|
||||
_endif
|
||||
mov dx,ax
|
||||
call shift_key
|
||||
and ah,KEY_CTRL+KEY_ALT+KEY_SHIFT
|
||||
cmp dl,FKEYCODE
|
||||
je gfunc1
|
||||
cmp dl,SPC
|
||||
jb gctrl1
|
||||
test ah,KEY_CTRL+KEY_ALT
|
||||
jz gchar2
|
||||
call ctrltenkey
|
||||
jnc gchar4
|
||||
gchar2: mov ax,dx
|
||||
clr dh
|
||||
tst ah
|
||||
jnz gchar4
|
||||
call iskanji
|
||||
jnc gchar4
|
||||
mov dh,dl
|
||||
msdos F_CONIN
|
||||
gchar3: mov dl,al
|
||||
gchar4: clr ax
|
||||
jmps gcode9
|
||||
gfunc1:
|
||||
mov dh,ah
|
||||
msdos F_CONIN
|
||||
mov ah,dh
|
||||
add al,60h ; ##150.03
|
||||
test al,00010000b
|
||||
_if z
|
||||
and ah,not KEY_SHIFT
|
||||
cmp al,10100000b
|
||||
jae gcode8
|
||||
_endif
|
||||
call cvtshift ; clc
|
||||
jmps gcode8
|
||||
gctrl1:
|
||||
call cvtctrl
|
||||
gcode8: mov ah,TRUE
|
||||
gcode9: VZ_RET
|
||||
getkeycode endp
|
||||
|
||||
get_ringp proc
|
||||
push es
|
||||
clr ax
|
||||
movseg es,ax
|
||||
mov ax,es:[ringp]
|
||||
pop es
|
||||
VZ_RET
|
||||
get_ringp endp
|
||||
|
||||
;--- Convert ctrl code ---
|
||||
;-->
|
||||
; DL :ctrl code (00h-20h)
|
||||
; DH :scan code (if bios call)
|
||||
; AH :shift status
|
||||
;<--
|
||||
; AL :key code
|
||||
; CY :ignore
|
||||
|
||||
cvtctrl proc
|
||||
tst dh
|
||||
jz cvctr3
|
||||
tst dl
|
||||
jnz cvctr3
|
||||
mov al,dh ; by scan code
|
||||
cmp al,SCAN_HOME
|
||||
_if e
|
||||
mov al,SCAN_CLR
|
||||
_endif
|
||||
cmp al,SCAN_F01
|
||||
jae cvctr2
|
||||
sub al,SCAN_RLUP - 10h
|
||||
js cvctr_x
|
||||
cmp al,XKEY_ESC
|
||||
jb cvtshift
|
||||
cvctr_x:stc
|
||||
VZ_RET
|
||||
cvctr2:
|
||||
cmp al,SCAN_CTR_F01
|
||||
_if ae
|
||||
add al,10h
|
||||
_endif
|
||||
add al,1Fh ; 62h->81h
|
||||
jmps cvctr9
|
||||
|
||||
cvctr3:
|
||||
mov di,offset cgroup:tb_xkeyscan
|
||||
mov cx,XKEYCNT
|
||||
mov al,dl
|
||||
add al,40h
|
||||
call scantbl
|
||||
jne cvctr7
|
||||
mov al,XKEYCNT-1+XKEY_ESC
|
||||
sub al,cl
|
||||
mov cl,cs:[di+XKEYCNT-1]
|
||||
tst dh
|
||||
_ifn z
|
||||
cmp dh,cl
|
||||
je cvctr7
|
||||
jmps cvtshift
|
||||
_endif
|
||||
push ax
|
||||
mov al,cl
|
||||
call testkey
|
||||
pop ax
|
||||
_ifn z
|
||||
test ah,KEY_CTRL+KEY_ALT
|
||||
jnz cvctr7
|
||||
_endif
|
||||
push ax
|
||||
mov al,cs:[di+XKEYCNT*2-1]
|
||||
call testkey
|
||||
pop ax
|
||||
jz cvctr5
|
||||
cvtshift:
|
||||
mov ch,11100000b
|
||||
test ah,KEY_ALT
|
||||
jnz cvctr6
|
||||
mov ch,11000000b
|
||||
test ah,KEY_CTRL
|
||||
jnz cvctr6
|
||||
mov ch,10100000b
|
||||
test ah,KEY_SHIFT
|
||||
jnz cvctr6
|
||||
cvctr5: mov ch,10000000b
|
||||
cvctr6: or al,ch
|
||||
jmps cvctr9
|
||||
|
||||
cvctr7:
|
||||
mov al,dl
|
||||
test ah,KEY_ALT
|
||||
jz cvctr9
|
||||
or al,00100000b
|
||||
cvctr9: clc
|
||||
VZ_RET
|
||||
cvtctrl endp
|
||||
|
||||
;--- Test Key bit ---
|
||||
;--> AL :scan code
|
||||
;<-- NZ :key on
|
||||
|
||||
testkey proc
|
||||
push es
|
||||
clr bx
|
||||
mov es,bx
|
||||
mov bx,keytbl
|
||||
mov cl,al
|
||||
and cl,7
|
||||
shrm al,3
|
||||
add bl,al
|
||||
adc bh,0
|
||||
mov al,1
|
||||
shl al,cl
|
||||
test es:[bx],al
|
||||
pop es
|
||||
VZ_RET
|
||||
testkey endp
|
||||
|
||||
;--- Get [CTRL]/[ALT]+tenkey ---
|
||||
;<-- CY :not defined
|
||||
|
||||
ctrltenkey proc
|
||||
pushm <ax,si>
|
||||
mov si,tenkey_c
|
||||
test ah,KEY_ALT
|
||||
_ifn z
|
||||
mov si,tenkey_g
|
||||
_endif
|
||||
tenk1: lodsb
|
||||
tst al
|
||||
jz tenk_x
|
||||
cmp al,dl
|
||||
je tenk2
|
||||
inc si
|
||||
inc si
|
||||
jmp tenk1
|
||||
tenk2: mov di,offset cgroup:tb_tenkey
|
||||
mov cx,TENKEYCNT
|
||||
call scantbl
|
||||
jne tenk_x
|
||||
mov al,TENKEYCNT-1+SCAN_TENKEY
|
||||
sub al,cl
|
||||
call testkey
|
||||
jz tenk_x
|
||||
mov dx,[si]
|
||||
xchg dl,dh
|
||||
clc
|
||||
jmps tenk9
|
||||
tenk_x: stc
|
||||
tenk9: popm <si,ax>
|
||||
VZ_RET
|
||||
ctrltenkey endp
|
||||
|
||||
;--- BIOS key function ---
|
||||
|
||||
public wait_key,wait_key1
|
||||
wait_key proc
|
||||
wait_key1:
|
||||
; push bx ; ##150.01
|
||||
; mov ah,FEP_MASK
|
||||
; call ctrlfp
|
||||
_repeat
|
||||
call read_key
|
||||
_while z
|
||||
; bios 00h
|
||||
; push ax
|
||||
; mov ah,FEP_ACT
|
||||
; call ctrlfp
|
||||
; pop ax
|
||||
; pop bx
|
||||
IFDEF CVTKANA
|
||||
call cvtkanakey
|
||||
ENDIF
|
||||
VZ_RET
|
||||
wait_key endp
|
||||
|
||||
public sense_key
|
||||
sense_key proc
|
||||
push bx
|
||||
bios 01h
|
||||
tst bh
|
||||
pop bx
|
||||
VZ_RET
|
||||
sense_key endp
|
||||
|
||||
public read_key
|
||||
read_key proc
|
||||
push bx
|
||||
bios 05h
|
||||
tst bh
|
||||
pop bx
|
||||
VZ_RET
|
||||
read_key endp
|
||||
|
||||
public flush_key
|
||||
flush_key proc
|
||||
pushm <ax,bx>
|
||||
_repeat
|
||||
call sense_key
|
||||
_break z
|
||||
cmp al,08 ; ##156.124
|
||||
_break e
|
||||
cmp al,SPC
|
||||
_break ae
|
||||
bios 00h
|
||||
_until
|
||||
popm <bx,ax>
|
||||
VZ_RET
|
||||
flush_key endp
|
||||
|
||||
public shift_key
|
||||
shift_key proc
|
||||
push es
|
||||
clr ax
|
||||
mov es,ax
|
||||
mov al,es:[keysft]
|
||||
mov ah,al
|
||||
pop es
|
||||
VZ_RET
|
||||
shift_key endp
|
||||
|
||||
public beep_on
|
||||
beep_on proc
|
||||
outi 37h,6
|
||||
VZ_RET
|
||||
beep_on endp
|
||||
|
||||
public beep_off
|
||||
beep_off proc
|
||||
outi 37h,7
|
||||
VZ_RET
|
||||
beep_off endp
|
||||
|
||||
;****************************
|
||||
; Smooth scroll sub
|
||||
;****************************
|
||||
|
||||
LATCHC equ 10
|
||||
FREEC equ -4
|
||||
KEY_INIT equ 10000000b
|
||||
|
||||
assume ds:cgroup
|
||||
|
||||
;--- Get trigger key ---
|
||||
|
||||
public sm_gettrgkey
|
||||
sm_gettrgkey proc
|
||||
push ds
|
||||
movseg ds,ss
|
||||
clr ax
|
||||
mov es,ax
|
||||
mov di,keytbl
|
||||
mov cx,14
|
||||
clr al
|
||||
repz scasb
|
||||
mov al,1
|
||||
_ifn z
|
||||
dec di
|
||||
mov trgp,di
|
||||
mov al,es:[di]
|
||||
mov trgbit,al
|
||||
mov al,0
|
||||
_endif
|
||||
mov latch,al
|
||||
mov trgc,0
|
||||
pop ds
|
||||
VZ_RET
|
||||
sm_gettrgkey endp
|
||||
|
||||
;--- Sense key ---
|
||||
|
||||
public sm_sensekey
|
||||
sm_sensekey proc
|
||||
push ds
|
||||
movseg ds,ss
|
||||
clr ax
|
||||
mov es,ax
|
||||
call shift_key
|
||||
mov di,trgp
|
||||
mov al,trgbit
|
||||
cmp al,es:[di]
|
||||
mov al,trgc
|
||||
jne sens0
|
||||
xor ah,sft
|
||||
and ah,KEY_CTRL+KEY_ALT
|
||||
je sens2
|
||||
sens0: tst al
|
||||
js sens1
|
||||
clr al
|
||||
sens1: dec al
|
||||
js sens4
|
||||
mov al,80h
|
||||
jmps sens4
|
||||
sens2: tst al
|
||||
jns sens3
|
||||
clr al
|
||||
sens3: inc al
|
||||
jns sens4
|
||||
mov al,7Fh
|
||||
sens4:
|
||||
tstb latch
|
||||
jne sens8
|
||||
cmp al,LATCHC
|
||||
jb sens8
|
||||
mov ah,1
|
||||
tst al
|
||||
js sens5
|
||||
mov ah,-1
|
||||
sens5: mov latch,ah
|
||||
sens8: mov trgc,al
|
||||
pop ds
|
||||
VZ_RET
|
||||
sm_sensekey endp
|
||||
|
||||
assume ds:nothing
|
||||
|
||||
;--- Check key ---
|
||||
;<-- CY :break
|
||||
|
||||
public sm_chkkey
|
||||
sm_chkkey proc
|
||||
mov al,latch
|
||||
tst al
|
||||
jg chkk2
|
||||
je chkk0
|
||||
cmp trgc,FREEC
|
||||
jl chkk9
|
||||
chkk1: call read_key
|
||||
jnz chkk1
|
||||
jmps sm_chksft
|
||||
chkk2:
|
||||
call read_key
|
||||
jz sm_chksft
|
||||
cmp al,SPC ; ##153.51
|
||||
je chkk_p
|
||||
cmp al,'.'
|
||||
jne chkk3
|
||||
chkk_p: push ax
|
||||
call wait_key
|
||||
pop cx
|
||||
cmp al,cl
|
||||
je sm_chksft
|
||||
chkk3: sub al,'0'
|
||||
jb chkk9
|
||||
cmp al,8 ; ##153.50
|
||||
ja chkk9
|
||||
mov rolc,al
|
||||
call initrolc
|
||||
chkk0: clc
|
||||
VZ_RET
|
||||
chkk9: stc
|
||||
VZ_RET
|
||||
sm_chkkey endp
|
||||
|
||||
;--- Check [SHIFT] key ---
|
||||
;--> BH :init flag
|
||||
|
||||
public sm_chksft
|
||||
sm_chksft proc
|
||||
call shift_key
|
||||
tst bh
|
||||
_ifn z
|
||||
mov sft,al
|
||||
jmps chks1
|
||||
_endif
|
||||
xor al,sft
|
||||
test al,KEY_SHIFT
|
||||
_ifn z
|
||||
xor sft,KEY_SHIFT
|
||||
chks1:
|
||||
mov al,rolc
|
||||
test ah,KEY_SHIFT
|
||||
_ifn z
|
||||
cmp al,4
|
||||
_if e
|
||||
mov al,3
|
||||
_else
|
||||
mov al,4
|
||||
_endif
|
||||
_endif
|
||||
call initrolc
|
||||
_endif
|
||||
clc
|
||||
VZ_RET
|
||||
sm_chksft endp
|
||||
|
||||
isDBCS proc ; ##156.132
|
||||
VZ_RET
|
||||
isDBCS endp
|
||||
|
||||
endhs
|
||||
|
||||
;****************************
|
||||
; End of 'key98.asm'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
1250
SRC/keyibm.asm
1250
SRC/keyibm.asm
File diff suppressed because it is too large
Load Diff
959
SRC/ledit.asm
959
SRC/ledit.asm
@ -1,959 +0,0 @@
|
||||
;****************************
|
||||
; 'ledit.asm'
|
||||
;****************************
|
||||
|
||||
include vz.inc
|
||||
|
||||
;--- Equations ---
|
||||
|
||||
CT_EOF equ 0
|
||||
CT_EOL equ 1
|
||||
CT_SPC equ 2 ; 00h-20h,8140h
|
||||
CT_SYM equ 3 ; !"#$...<2E>I<EFBFBD>h<EFBFBD>”<EFBFBD><E2809D>...
|
||||
CT_HIRA equ 4 ; ‚ ‚¢‚¤...
|
||||
CT_JIS equ 5 ; JIS
|
||||
CT_ANK equ 6 ; ANK
|
||||
|
||||
;--- External symbols ---
|
||||
|
||||
wseg
|
||||
extrn edtsw :byte
|
||||
extrn syssw :byte
|
||||
extrn extsw :byte
|
||||
extrn insm :byte
|
||||
|
||||
extrn cbuf :word
|
||||
extrn cbuf_end :word
|
||||
; extrn gtops :word
|
||||
extrn sbuf :word
|
||||
extrn w_act :word
|
||||
extrn windrec :word
|
||||
endws
|
||||
|
||||
extrn cptoxy :near
|
||||
extrn disperr :near
|
||||
extrn do_tab :near
|
||||
extrn iskanji :near
|
||||
extrn islower :near
|
||||
extrn isupper :near
|
||||
extrn off_silent :near
|
||||
extrn tolower :near
|
||||
extrn toupper :near
|
||||
extrn xtocp2 :near
|
||||
|
||||
dseg
|
||||
|
||||
;--- Local work ---
|
||||
|
||||
cend dw 0
|
||||
cmax dw 0
|
||||
cbufsz dw 0
|
||||
|
||||
endds
|
||||
|
||||
eseg
|
||||
|
||||
;--- Word delimiter check bit ---
|
||||
|
||||
tb_delimbits db 80h,40h,20h,10h
|
||||
db 8,4,2,1
|
||||
db 08h,00h,0FFh,0C0h ;20h-3Fh
|
||||
db 7Fh,0FFh,0FFh,0E1h ;40h-5Fh
|
||||
db 7Fh,0FFh,0FFh,0E0h ;60h-7Fh
|
||||
endes
|
||||
|
||||
iseg
|
||||
assume ds:cgroup
|
||||
|
||||
;--- Init delete char buffer ---
|
||||
|
||||
public initcbuf
|
||||
initcbuf proc
|
||||
mov ax,cbuf
|
||||
mov cend,ax
|
||||
mov cx,cbuf_end
|
||||
dec cx
|
||||
dec cx
|
||||
mov cmax,cx
|
||||
sub cx,ax
|
||||
mov cbufsz,cx
|
||||
VZ_RET
|
||||
initcbuf endp
|
||||
|
||||
endis
|
||||
|
||||
eseg
|
||||
|
||||
assume ds:nothing
|
||||
|
||||
;--- Line Edit Main ---
|
||||
;-->
|
||||
; AL :command code
|
||||
; DX :input character
|
||||
;<--
|
||||
; AL :command code
|
||||
; AH :0=current, 1=next, -1=pre, 2=DEL-CR, 3=BS-CR, 4=UNDO-BS, 5=UNDO-DEL
|
||||
|
||||
public lineedit,setctype
|
||||
setctype:
|
||||
clr al
|
||||
lineedit proc
|
||||
pushm <ds,es>
|
||||
push ax
|
||||
mov ds,[bp].lbseg
|
||||
movseg es,ds
|
||||
mov si,[bp].tcp
|
||||
tst al
|
||||
_ifn z
|
||||
mov bx,offset cgroup:le_table
|
||||
sub al,CM_LEDIT
|
||||
shl al,1
|
||||
cbw
|
||||
add bx,ax
|
||||
call cs:[bx]
|
||||
mov bl,ah
|
||||
pop ax
|
||||
mov ah,bl
|
||||
push ax
|
||||
call cptoxy
|
||||
_endif
|
||||
call settype
|
||||
pop ax
|
||||
popm <es,ds>
|
||||
le_nop:
|
||||
VZ_RET
|
||||
lineedit endp
|
||||
|
||||
;--- Command table ---
|
||||
|
||||
le_table:
|
||||
ofs le_charl
|
||||
ofs le_charr
|
||||
ofs le_wordl
|
||||
ofs le_wordr
|
||||
ofs le_top
|
||||
ofs le_end
|
||||
ofs le_insmode
|
||||
ofs le_bakchar
|
||||
ofs le_delchar
|
||||
ofs le_bakword
|
||||
ofs le_delword
|
||||
ofs le_baktop
|
||||
ofs le_delend
|
||||
ofs le_undo
|
||||
ofs le_tab
|
||||
dw 0 ; ^P
|
||||
ofs le_case
|
||||
ofs le_copystr
|
||||
ofs le_copyfile
|
||||
ofs le_nop
|
||||
ofs le_nop
|
||||
ofs le_nop
|
||||
ofs le_redraw
|
||||
ofs outchr
|
||||
|
||||
;--- Is it word delimitor? ---
|
||||
;<-- ZR :word delimitor
|
||||
|
||||
public isdelim
|
||||
isdelim proc
|
||||
pushm <ax,bx>
|
||||
tst al
|
||||
js chkdz
|
||||
sub al,SPC
|
||||
jnb chkd1
|
||||
chkdz: stz
|
||||
jmps chkd8
|
||||
chkd1:
|
||||
mov ah,al
|
||||
and al,7
|
||||
mov bx,offset cgroup:tb_delimbits
|
||||
xlat cs:tb_delimbits
|
||||
xchg al,ah
|
||||
shr al,1
|
||||
shr al,1
|
||||
shr al,1
|
||||
add al,8
|
||||
xlat cs:tb_delimbits
|
||||
test al,ah
|
||||
chkd8:
|
||||
popm <bx,ax>
|
||||
VZ_RET
|
||||
|
||||
isdelim endp
|
||||
|
||||
;--- Set wordlevel ---
|
||||
;-->
|
||||
; DL :previous wordlevel
|
||||
;<--
|
||||
; DH :current wordlevel
|
||||
; AH :NZ=kanji
|
||||
|
||||
public wordlevel
|
||||
wordlevel proc
|
||||
clr ah
|
||||
mov dh,CT_SPC
|
||||
cmp al,SPC
|
||||
jbe wlvl8
|
||||
call iskanji
|
||||
jnc wlvl_a
|
||||
mov ah,al
|
||||
lodsb
|
||||
cmp al,40h
|
||||
jb wlvl_kx
|
||||
cmp ax,8140h
|
||||
je wlvl8
|
||||
mov dh,CT_SYM
|
||||
cmp ax,8152h
|
||||
jb wlvl8
|
||||
cmp ax,815Ch
|
||||
jb wlvl_k1
|
||||
cmp ax,824Fh
|
||||
jb wlvl8
|
||||
cmp ax,829Eh
|
||||
jb wlvl_k1
|
||||
cmp ax,833Fh
|
||||
jae wlvl_k1
|
||||
mov dh,CT_HIRA
|
||||
jmps wlvl8
|
||||
wlvl_k1:
|
||||
mov dh,CT_JIS
|
||||
jmps wlvl8
|
||||
wlvl_kx:
|
||||
dec si
|
||||
mov al,ah
|
||||
clr ah
|
||||
wlvl_a:
|
||||
call isdelim
|
||||
mov dh,CT_SYM
|
||||
jz wlvl8
|
||||
mov dh,CT_ANK
|
||||
wlvl8: tst dl
|
||||
jz wlvl9
|
||||
cmp dh,dl
|
||||
wlvl9: mov dl,dh
|
||||
VZ_RET
|
||||
wordlevel endp
|
||||
|
||||
;--- Decriment si ---
|
||||
|
||||
public decsi
|
||||
decsi proc
|
||||
clr cx
|
||||
dec si
|
||||
push si
|
||||
jmps decs2
|
||||
decs1:
|
||||
inc cx
|
||||
decs2:
|
||||
cmp si,[bp].btop
|
||||
je decs3
|
||||
dec si
|
||||
mov al,[si]
|
||||
call iskanji
|
||||
jc decs1
|
||||
decs3:
|
||||
pop si
|
||||
and cx,1
|
||||
sub si,cx
|
||||
VZ_RET
|
||||
decsi endp
|
||||
|
||||
;--- Shift buffer ---
|
||||
;<--
|
||||
; AX: offset
|
||||
; SI: move start
|
||||
;-->
|
||||
; CY: buffer full
|
||||
|
||||
sftbuf proc
|
||||
mov cx,[bp].bend
|
||||
inc cx
|
||||
inc cx
|
||||
sub cx,si
|
||||
tst ax
|
||||
jz shft0
|
||||
jns shftr
|
||||
mov di,si
|
||||
add di,ax
|
||||
rep movsb
|
||||
dec di
|
||||
dec di
|
||||
mov [bp].bend,di
|
||||
clc
|
||||
VZ_RET
|
||||
shftr:
|
||||
mov si,[bp].bend
|
||||
mov di,si
|
||||
add di,ax
|
||||
cmp di,[bp].bmax
|
||||
jae shft_x
|
||||
mov [bp].bend,di
|
||||
inc si
|
||||
inc di
|
||||
std
|
||||
rep movsb
|
||||
cld
|
||||
shft0: clc
|
||||
VZ_RET
|
||||
shft_x:
|
||||
tstb [bp].inbuf
|
||||
_ifn s
|
||||
push si
|
||||
mov dl,E_NOLINE
|
||||
call disperr
|
||||
pop si
|
||||
_endif
|
||||
stc
|
||||
VZ_RET
|
||||
sftbuf endp
|
||||
|
||||
;--- Store char to buffer ---
|
||||
; BL :mode (0:BS 80h:DEL)
|
||||
; AX :char len
|
||||
|
||||
public storchr
|
||||
storchr proc
|
||||
test extsw,ESW_TRUSH
|
||||
_if z
|
||||
pushm <ax,si,di,ds,es>
|
||||
mov ds,[bp].lbseg
|
||||
movseg es,ss
|
||||
mov si,[bp].tcp
|
||||
tst bl
|
||||
_if z
|
||||
add si,ax
|
||||
_else
|
||||
cmp word ptr [si],CRLF
|
||||
_if e
|
||||
inc si
|
||||
_endif
|
||||
_endif
|
||||
neg ax
|
||||
; cmp ax,127 ; ##156.108
|
||||
;_if a
|
||||
; mov ax,127
|
||||
;_endif
|
||||
inc ax
|
||||
inc ax
|
||||
cmp ax,cbufsz
|
||||
_if ae
|
||||
mov ax,cbufsz
|
||||
_endif
|
||||
dec ax
|
||||
dec ax
|
||||
mov cx,ax
|
||||
mov ax,cend
|
||||
mov di,ax
|
||||
add ax,cx
|
||||
inc ax
|
||||
inc ax
|
||||
sub ax,cmax
|
||||
_ifn b
|
||||
call cutold
|
||||
_endif
|
||||
push cx
|
||||
rep movsb
|
||||
pop ax
|
||||
or ah,bl
|
||||
stosw
|
||||
mov cend,di
|
||||
popm <es,ds,di,si,ax>
|
||||
_endif
|
||||
VZ_RET
|
||||
|
||||
assume ds:cgroup
|
||||
cutold:
|
||||
pushm <cx,dx,si,ds,es>
|
||||
movseg ds,ss
|
||||
movseg es,ss
|
||||
add ax,cbuf
|
||||
mov dx,ax
|
||||
mov di,cend
|
||||
_repeat
|
||||
mov si,di
|
||||
dec di
|
||||
dec di
|
||||
mov ax,[di]
|
||||
and ax,7FFFh
|
||||
sub di,ax
|
||||
cmp di,dx
|
||||
_while a
|
||||
mov cx,cend
|
||||
sub cx,si
|
||||
mov di,cbuf
|
||||
rep movsb
|
||||
popm <es,ds,si,dx,cx>
|
||||
VZ_RET
|
||||
storchr endp
|
||||
|
||||
assume ds:nothing
|
||||
|
||||
;--- Type set ---
|
||||
|
||||
settype proc
|
||||
pushm <ax,si>
|
||||
mov dh,FALSE
|
||||
clr ah
|
||||
lodsb
|
||||
cmp al,SPC
|
||||
_if be
|
||||
mov dl,CT_EOL
|
||||
cmp al,CR
|
||||
je sttyp8
|
||||
mov dl,CT_SPC
|
||||
cmp al,LF
|
||||
jne sttyp8
|
||||
mov dl,CT_EOL
|
||||
; cmp bp,cbuf
|
||||
; ja sttyp8
|
||||
cmp bp,windrec ; ##16
|
||||
jb sttyp8 ;
|
||||
cmp si,[bp].tend
|
||||
jb sttyp8
|
||||
tstb [bp].inbuf
|
||||
js sttyp8
|
||||
test [bp].largf,FL_TAIL
|
||||
jnz sttyp8
|
||||
mov dl,CT_EOF
|
||||
jmps sttyp8
|
||||
_endif
|
||||
call wordlevel
|
||||
mov dl,dh
|
||||
mov dh,FALSE
|
||||
tst ah
|
||||
_ifn z
|
||||
mov dh,TRUE
|
||||
_endif
|
||||
sttyp8: mov word ptr [bp].ctype,dx
|
||||
mov [bp].ccode,ax
|
||||
popm <si,ax>
|
||||
VZ_RET
|
||||
settype endp
|
||||
|
||||
;--- Char right ---
|
||||
|
||||
le_charr proc
|
||||
cmp si,[bp].bend
|
||||
_if e
|
||||
inc ah
|
||||
VZ_RET
|
||||
_endif
|
||||
tstb [bp].ckanj
|
||||
_ifn z
|
||||
inc si
|
||||
_endif
|
||||
inc si
|
||||
VZ_RET
|
||||
le_charr endp
|
||||
|
||||
;--- Char left ---
|
||||
|
||||
le_charl proc
|
||||
cmp si,[bp].btop
|
||||
_ifn e
|
||||
dec si
|
||||
VZ_RET
|
||||
_endif
|
||||
dec ah
|
||||
VZ_RET
|
||||
le_charl endp
|
||||
|
||||
;--- Word right ---
|
||||
|
||||
le_wordr proc
|
||||
cmp si,[bp].bend
|
||||
_if e
|
||||
inc ah
|
||||
VZ_RET
|
||||
_endif
|
||||
clr dl
|
||||
_repeat
|
||||
lodsb
|
||||
call wordlevel
|
||||
mov ah,0
|
||||
ja wrdr8
|
||||
cmp si,[bp].bend
|
||||
_until e
|
||||
VZ_RET
|
||||
wrdr8: dec si
|
||||
VZ_RET
|
||||
le_wordr endp
|
||||
|
||||
;--- Word left ---
|
||||
|
||||
le_wordl proc
|
||||
cmp si,[bp].btop
|
||||
_if e
|
||||
dec ah
|
||||
VZ_RET
|
||||
_endif
|
||||
clr dl
|
||||
_repeat
|
||||
push si
|
||||
call decsi
|
||||
mov al,[si]
|
||||
push si
|
||||
inc si
|
||||
call wordlevel
|
||||
pop si
|
||||
pop ax
|
||||
jb wrdl8
|
||||
cmp si,[bp].btop
|
||||
_until e
|
||||
jmps wrdl9
|
||||
wrdl8: mov si,ax
|
||||
wrdl9: clr ah
|
||||
VZ_RET
|
||||
le_wordl endp
|
||||
|
||||
;--- Line top/end ---
|
||||
|
||||
le_top proc
|
||||
mov si,[bp].btop
|
||||
VZ_RET
|
||||
le_top endp
|
||||
|
||||
le_end proc
|
||||
mov si,[bp].bend
|
||||
VZ_RET
|
||||
le_end endp
|
||||
|
||||
;--- Insert mode ---
|
||||
|
||||
le_insmode proc
|
||||
mov al,insm
|
||||
tst al
|
||||
mov al,0
|
||||
_if z
|
||||
public set_insm
|
||||
set_insm:
|
||||
test syssw,SW_CLMOVW
|
||||
mov al,1
|
||||
_ifn z
|
||||
mov al,2
|
||||
_endif
|
||||
_endif
|
||||
mov insm,al
|
||||
VZ_RET
|
||||
le_insmode endp
|
||||
|
||||
;--- Back char ---
|
||||
|
||||
le_bakchar proc
|
||||
cmp si,[bp].btop
|
||||
je bscr
|
||||
mov di,si
|
||||
call decsi
|
||||
mov ax,-1
|
||||
_ifn cxz
|
||||
dec ax
|
||||
_endif
|
||||
push si
|
||||
mov si,di
|
||||
bspc8: mov bl,0
|
||||
bspc9: call storchr
|
||||
call sftbuf
|
||||
pop si
|
||||
clr ah
|
||||
VZ_RET
|
||||
bscr:
|
||||
mov ah,2
|
||||
VZ_RET
|
||||
le_bakchar endp
|
||||
|
||||
;--- Delete char ---
|
||||
|
||||
le_delchar proc
|
||||
cmp si,[bp].bend
|
||||
je delcr
|
||||
push si
|
||||
inc si
|
||||
mov ax,-1
|
||||
tstb [bp].ckanj
|
||||
jz delc8
|
||||
dec ax
|
||||
inc si
|
||||
delc8: mov bl,80h
|
||||
jmp bspc9
|
||||
|
||||
delcr: mov ah,3
|
||||
VZ_RET
|
||||
le_delchar endp
|
||||
|
||||
;--- Back word ---
|
||||
|
||||
le_bakword proc
|
||||
cmp si,[bp].btop
|
||||
je bscr
|
||||
push si
|
||||
clr dl
|
||||
_repeat
|
||||
cmp si,[bp].btop
|
||||
je bakw6
|
||||
push si
|
||||
call decsi
|
||||
mov al,[si]
|
||||
push si
|
||||
inc si
|
||||
call wordlevel
|
||||
pop si
|
||||
pop ax
|
||||
_while e
|
||||
mov si,ax
|
||||
bakw6: mov ax,si
|
||||
pop si
|
||||
bakw8: push ax
|
||||
sub ax,si
|
||||
jmp bspc8
|
||||
le_bakword endp
|
||||
|
||||
;--- Delete word ---
|
||||
|
||||
le_delword proc
|
||||
cmp si,[bp].bend
|
||||
je delcr
|
||||
push si
|
||||
push si
|
||||
clr dl
|
||||
_repeat
|
||||
cmp si,[bp].bend
|
||||
je delw6
|
||||
push si
|
||||
lodsb
|
||||
call wordlevel
|
||||
pop ax
|
||||
_while e
|
||||
mov si,ax
|
||||
delw6: pop ax
|
||||
sub ax,si
|
||||
jmp delc8
|
||||
le_delword endp
|
||||
|
||||
;--- Back to line top ---
|
||||
|
||||
le_baktop proc
|
||||
cmp si,[bp].btop
|
||||
jz dlin9
|
||||
mov ax,[bp].btop
|
||||
jmp bakw8
|
||||
le_baktop endp
|
||||
|
||||
;--- Delete to line end ---
|
||||
|
||||
le_delend proc
|
||||
mov ax,si
|
||||
sub ax,[bp].bend
|
||||
jz dlin9
|
||||
mov bl,80h
|
||||
call storchr
|
||||
mov bx,si
|
||||
xchg [bp].bend,bx
|
||||
mov ax,[bx]
|
||||
mov [si],ax
|
||||
dlin9: clr ah
|
||||
VZ_RET
|
||||
le_delend endp
|
||||
|
||||
;--- Space-Tab ---
|
||||
|
||||
sptab:
|
||||
mov cl,[bp].lx
|
||||
call do_tab
|
||||
mov cl,al
|
||||
clr ch
|
||||
_repeat
|
||||
push cx
|
||||
mov dx,SPC
|
||||
call outchr
|
||||
pop cx
|
||||
_loop
|
||||
VZ_RET
|
||||
|
||||
;--- Overwrite Tab ---
|
||||
|
||||
ovwtab:
|
||||
cmp si,[bp].bend
|
||||
_if ae
|
||||
inc ah
|
||||
VZ_RET
|
||||
_endif
|
||||
mov cl,[bp].lx
|
||||
tstb [bp].ckanj
|
||||
_ifn z
|
||||
inc cl
|
||||
_endif
|
||||
call do_tab
|
||||
mov dl,cl
|
||||
mov si,[bp].tfld
|
||||
call xtocp2
|
||||
clr ah
|
||||
VZ_RET
|
||||
|
||||
;--- Output char ---
|
||||
|
||||
le_tab:
|
||||
tstb [bp].inbuf
|
||||
_ifn s
|
||||
tstb insm
|
||||
jnz ovwtab
|
||||
_endif
|
||||
test edtsw,EDT_UNTAB
|
||||
jnz sptab
|
||||
mov dx,TAB
|
||||
outchr:
|
||||
mov al,insm
|
||||
tst al
|
||||
jz inst
|
||||
cmp si,[bp].bend
|
||||
je inst
|
||||
cmp al,2
|
||||
jne over
|
||||
jmps column_ovw
|
||||
inst:
|
||||
push si
|
||||
mov ax,1
|
||||
tst dh
|
||||
jz over2
|
||||
inc ax
|
||||
jmps over2
|
||||
over:
|
||||
push si
|
||||
inc si
|
||||
mov al,[bp].ckanj
|
||||
cbw
|
||||
tst ax
|
||||
jnz over1
|
||||
tst dh
|
||||
jz over2
|
||||
inc ax
|
||||
jmps over2
|
||||
over1: inc si
|
||||
clr ax
|
||||
tst dh
|
||||
jnz over2
|
||||
dec ax
|
||||
over2: call sftbuf
|
||||
pop si
|
||||
jc over9
|
||||
tst dh
|
||||
_ifn z
|
||||
mov [si],dh
|
||||
inc si
|
||||
_endif
|
||||
mov [si],dl
|
||||
inc si
|
||||
over9: clr ah
|
||||
VZ_RET
|
||||
|
||||
;----- Column Overwrite mode -----
|
||||
|
||||
column_ovw proc
|
||||
mov al,[si]
|
||||
cmp al,TAB
|
||||
_if e
|
||||
mov cl,[bp].lx
|
||||
mov al,[bp].tabr
|
||||
dec al
|
||||
and cl,al
|
||||
tst dh
|
||||
_if z
|
||||
cmp cl,al
|
||||
jne inst
|
||||
_else
|
||||
dec al
|
||||
cmp cl,al
|
||||
jb inst
|
||||
je over
|
||||
cmp byte ptr [si+1],TAB
|
||||
je over
|
||||
_endif
|
||||
_endif
|
||||
mov al,[bp].ckanj
|
||||
tst dh
|
||||
_if z
|
||||
mov [si],dl
|
||||
inc si
|
||||
tst al
|
||||
_ifn z
|
||||
mov byte ptr [si],SPC
|
||||
_endif
|
||||
_else
|
||||
tst al
|
||||
_if z
|
||||
inc si
|
||||
cmp si,[bp].bend
|
||||
_if e
|
||||
mov ax,1
|
||||
push si
|
||||
call sftbuf
|
||||
pop si
|
||||
dec si
|
||||
_else
|
||||
mov al,[si]
|
||||
dec si
|
||||
call iskanji
|
||||
_if c
|
||||
mov byte ptr [si+2],SPC
|
||||
_endif
|
||||
_endif
|
||||
_endif
|
||||
mov [si],dh
|
||||
inc si
|
||||
mov [si],dl
|
||||
inc si
|
||||
_endif
|
||||
clr ah
|
||||
VZ_RET
|
||||
column_ovw endp
|
||||
|
||||
;--- String copy ---
|
||||
|
||||
le_copystr proc
|
||||
mov bx,sbuf
|
||||
jmps copy1
|
||||
le_copyfile:
|
||||
mov bx,w_act
|
||||
tst bx
|
||||
jz copy9
|
||||
lea bx,[bx].path
|
||||
copy1:
|
||||
_repeat
|
||||
call settype
|
||||
clr dx
|
||||
mov al,ss:[bx]
|
||||
inc bx
|
||||
tst al
|
||||
jz copy9
|
||||
cmp al,NULLCODE
|
||||
_if e
|
||||
clr al
|
||||
_endif
|
||||
call iskanji
|
||||
_if c
|
||||
mov dh,al
|
||||
mov al,ss:[bx]
|
||||
inc bx
|
||||
tst al
|
||||
jz copy9
|
||||
_endif
|
||||
mov dl,al
|
||||
call outchr
|
||||
_until
|
||||
copy9: VZ_RET
|
||||
le_copystr endp
|
||||
|
||||
;--- Char undo ---
|
||||
|
||||
le_undo proc
|
||||
mov bx,cend
|
||||
cmp bx,cbuf
|
||||
je undo9
|
||||
dec bx
|
||||
dec bx
|
||||
mov ax,ss:[bx]
|
||||
push si
|
||||
push ax
|
||||
and ax,7FFFh
|
||||
sub bx,ax
|
||||
mov cend,bx
|
||||
mov cx,ax
|
||||
_repeat
|
||||
call settype
|
||||
clr dx
|
||||
mov al,ss:[bx]
|
||||
inc bx
|
||||
cmp al,LF
|
||||
je undocr
|
||||
call iskanji
|
||||
jnc undo2
|
||||
dec cx
|
||||
_break z
|
||||
mov dh,al
|
||||
mov al,ss:[bx]
|
||||
inc bx
|
||||
undo2: mov dl,al
|
||||
push cx
|
||||
call inst
|
||||
pop cx
|
||||
_loop
|
||||
pop ax
|
||||
pop bx
|
||||
tst ax
|
||||
jns undo9
|
||||
mov si,bx
|
||||
undo9: clr ah
|
||||
VZ_RET
|
||||
undocr:
|
||||
pop ax
|
||||
pop si
|
||||
and ax,8000h
|
||||
rol ax,1
|
||||
add al,4
|
||||
mov ah,al ; if al=00 then ah=4, if al=80h then ah=5
|
||||
VZ_RET
|
||||
le_undo endp
|
||||
|
||||
;--- Word To upper/lower ---
|
||||
|
||||
le_case proc
|
||||
push si
|
||||
cmp si,[bp].bend
|
||||
je case9
|
||||
mov al,[si]
|
||||
call iskanji
|
||||
jc case9
|
||||
clr bl
|
||||
call isupper
|
||||
jc case1
|
||||
call islower
|
||||
jnc case9
|
||||
inc bl
|
||||
case1:
|
||||
cmp si,[bp].bend
|
||||
je case9
|
||||
lodsb
|
||||
call iskanji
|
||||
jc case9 ; ##16
|
||||
;_if c
|
||||
; inc si
|
||||
; jmps case1
|
||||
;_endif
|
||||
call isupper
|
||||
_ifn c
|
||||
call islower
|
||||
jnc case6
|
||||
_endif
|
||||
tst bl
|
||||
_ifn z
|
||||
call toupper
|
||||
_else
|
||||
call tolower
|
||||
_endif
|
||||
mov [si-1],al
|
||||
jmp case1
|
||||
case6:
|
||||
call isdelim
|
||||
jne case1
|
||||
case9:
|
||||
pop si
|
||||
clr ah
|
||||
VZ_RET
|
||||
le_case endp
|
||||
|
||||
;--- #? ---
|
||||
|
||||
le_redraw proc
|
||||
call off_silent
|
||||
clr ah
|
||||
VZ_RET
|
||||
le_redraw endp
|
||||
|
||||
endes
|
||||
end
|
||||
|
||||
;****************************
|
||||
; End of 'ledit.asm'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
||||
|
3036
SRC/macro.asm
3036
SRC/macro.asm
File diff suppressed because it is too large
Load Diff
2110
SRC/main.asm
2110
SRC/main.asm
File diff suppressed because it is too large
Load Diff
1192
SRC/memo.asm
1192
SRC/memo.asm
File diff suppressed because it is too large
Load Diff
1414
SRC/menu.asm
1414
SRC/menu.asm
File diff suppressed because it is too large
Load Diff
295
SRC/misc.asm
295
SRC/misc.asm
@ -1,295 +0,0 @@
|
||||
;****************************
|
||||
; 'misc.asm'
|
||||
;****************************
|
||||
|
||||
include vz.inc
|
||||
|
||||
;--- External symbols ---
|
||||
|
||||
wseg
|
||||
extrn edtsw :byte
|
||||
extrn w_back :word
|
||||
endws
|
||||
|
||||
extrn disperr :near
|
||||
extrn dispmsg :near
|
||||
extrn dspscr :near
|
||||
extrn endlin :near
|
||||
extrn getkey :near
|
||||
extrn getnum :near
|
||||
extrn initblk :near
|
||||
extrn isend :near
|
||||
extrn istop :near
|
||||
extrn newline :near
|
||||
extrn prelin :near
|
||||
extrn putnum :near
|
||||
extrn restcp :near
|
||||
extrn scrout_lx :near
|
||||
extrn setabsp :near
|
||||
extrn setretp :near
|
||||
extrn settcp :near
|
||||
extrn toplin :near
|
||||
extrn txtmov :near
|
||||
extrn viewpoint :near
|
||||
extrn toptext :near
|
||||
; extrn seektext :near
|
||||
extrn scrout_cp :near
|
||||
extrn touch :near
|
||||
|
||||
cseg
|
||||
assume ds:nothing
|
||||
|
||||
;--- Change indent ---
|
||||
|
||||
public se_chgindent,mc_chgindent
|
||||
se_chgindent proc
|
||||
mov dl,M_MOVE
|
||||
call dispmsg
|
||||
marg1:
|
||||
mov al,CSR_OFF
|
||||
mov dl,SYS_GETC
|
||||
call getkey
|
||||
jz marg1
|
||||
cmp al,CM_CR
|
||||
jnz marg2
|
||||
mov [bp].blkm,0
|
||||
call scrout_lx
|
||||
jmp newline
|
||||
marg2:
|
||||
mov dx,1
|
||||
cmp al,CM_R
|
||||
je marg3
|
||||
neg dx
|
||||
cmp al,CM_L
|
||||
je marg3
|
||||
mov dl,[bp].tabr
|
||||
clr dh
|
||||
cmp al,CM_WR
|
||||
je marg3
|
||||
neg dx
|
||||
cmp al,CM_WL
|
||||
jne marg1
|
||||
marg3:
|
||||
push dx
|
||||
call initblk
|
||||
pop dx
|
||||
jnz marg4
|
||||
call lmarg
|
||||
jmps marg5
|
||||
marg4:
|
||||
call lmarg
|
||||
push dx
|
||||
call isend
|
||||
mov ax,si
|
||||
call setabsp
|
||||
cmpl [bp].trgtp
|
||||
pop dx
|
||||
jb marg4
|
||||
marg5:
|
||||
call restcp
|
||||
call scrout_lx
|
||||
jmp marg1
|
||||
|
||||
mc_chgindent:
|
||||
call isviewmode
|
||||
_ifn e
|
||||
mov si,[bp].tcp
|
||||
mov di,si
|
||||
mov bl,[bp].lx
|
||||
clr bh
|
||||
mov cx,dx ; CX :fill column
|
||||
cmp cx,bx
|
||||
_if a
|
||||
call lmrg4
|
||||
_endif
|
||||
call scrout_lx
|
||||
call touch
|
||||
_endif
|
||||
VZ_RET
|
||||
|
||||
lmarg:
|
||||
clr cx
|
||||
mov di,si
|
||||
lmrg1: lodsb
|
||||
cmp al,SPC
|
||||
jne lmrg2
|
||||
inc cx
|
||||
jmp lmrg1
|
||||
lmrg2: cmp al,TAB
|
||||
jne lmrg3
|
||||
mov al,[bp].tabr
|
||||
cbw
|
||||
add cx,ax
|
||||
neg ax
|
||||
and cx,ax
|
||||
jmp lmrg1
|
||||
lmrg3:
|
||||
cmp al,CR
|
||||
je lmrg1
|
||||
cmp al,LF
|
||||
je lmrg8
|
||||
dec si
|
||||
clr bx ; BX :base
|
||||
add cx,dx
|
||||
jns lmrg4
|
||||
clr cx
|
||||
lmrg4:
|
||||
test edtsw,EDT_UNTAB
|
||||
_ifn z
|
||||
sub cx,bx
|
||||
mov bx,cx
|
||||
clr cx
|
||||
_else
|
||||
mov ax,bx ; ##155.72
|
||||
div [bp].tabr
|
||||
mov bh,al
|
||||
mov ax,cx
|
||||
div [bp].tabr
|
||||
sub al,bh
|
||||
tst al
|
||||
_if z
|
||||
mov ah,cl
|
||||
sub ah,bl
|
||||
_endif
|
||||
mov bl,ah
|
||||
clr bh
|
||||
mov cl,al
|
||||
clr ch
|
||||
_endif
|
||||
push di
|
||||
add di,bx
|
||||
add di,cx
|
||||
push dx
|
||||
call txtmov
|
||||
pop dx
|
||||
mov si,di
|
||||
pop di
|
||||
jc lmrg9
|
||||
push es
|
||||
movseg es,ds
|
||||
mov al,TAB
|
||||
_ifn cxz
|
||||
rep stosb
|
||||
_endif
|
||||
mov al,SPC
|
||||
mov cx,bx
|
||||
_ifn cxz
|
||||
rep stosb
|
||||
_endif
|
||||
_repeat
|
||||
lodsb
|
||||
cmp al,LF
|
||||
_until e
|
||||
pop es
|
||||
lmrg8: clc
|
||||
lmrg9: VZ_RET
|
||||
se_chgindent endp
|
||||
|
||||
;--- Modefy mode ---
|
||||
|
||||
public se_readonly,isviewmode
|
||||
se_readonly proc
|
||||
call isviewmode
|
||||
_if e
|
||||
mov [bp].tchf,0
|
||||
_else
|
||||
not [bp].tchf
|
||||
_endif
|
||||
mmod9: VZ_RET
|
||||
|
||||
isviewmode:
|
||||
cmp [bp].tchf,TCH_VIEW
|
||||
VZ_RET
|
||||
se_readonly endp
|
||||
|
||||
;--- Compare two text ---
|
||||
|
||||
public se_textcomp
|
||||
se_textcomp proc
|
||||
mov bx,w_back
|
||||
tst bx
|
||||
jz mmod9
|
||||
call settcp
|
||||
call getnum
|
||||
xchg bp,bx
|
||||
call settcp
|
||||
call getnum
|
||||
xchg bp,bx
|
||||
tcmp0: mov si,[bp].tcp
|
||||
mov ax,[bp].tend
|
||||
sub ax,si
|
||||
mov dx,ax ; DX :size S
|
||||
xchg bp,bx
|
||||
mov es,[bp].ttops
|
||||
mov di,[bp].tcp
|
||||
mov ax,[bp].tend
|
||||
sub ax,di ; AX :size D
|
||||
mov cx,ax
|
||||
cmp cx,dx
|
||||
_if a
|
||||
mov cx,dx
|
||||
_endif
|
||||
jcxz tcmp_o
|
||||
repe cmpsb
|
||||
tst cx
|
||||
mov [bp].tcp,di
|
||||
xchg bp,bx
|
||||
mov [bp].tcp,si
|
||||
jnz tcmp_x
|
||||
call isend
|
||||
_if e
|
||||
inc cl
|
||||
dec si
|
||||
; dec si ; ##1.5
|
||||
mov [bp].tcp,si
|
||||
_endif
|
||||
xchg bp,bx
|
||||
mov si,[bp].tcp
|
||||
push ds
|
||||
movseg ds,es
|
||||
call isend
|
||||
pop ds
|
||||
_if e
|
||||
inc cl
|
||||
dec si
|
||||
; dec si
|
||||
mov [bp].tcp,si
|
||||
_endif
|
||||
xchg bp,bx
|
||||
tst cl
|
||||
je tcmp0
|
||||
cmp cl,2
|
||||
je tcmp_o
|
||||
tcmp_x: call settcp
|
||||
call putnum
|
||||
call viewpoint
|
||||
xchg bp,bx
|
||||
call settcp
|
||||
call putnum
|
||||
call viewpoint
|
||||
xchg bp,bx
|
||||
mov dl,M_COMPNG
|
||||
stc
|
||||
jmps tcmp3
|
||||
tcmp_o:
|
||||
mov dl,M_COMPOK
|
||||
clc
|
||||
tcmp3: pushf
|
||||
call dispmsg
|
||||
call restcp
|
||||
xchg bp,bx
|
||||
call restcp
|
||||
xchg bp,bx
|
||||
call dspscr
|
||||
popf
|
||||
VZ_RET
|
||||
se_textcomp endp
|
||||
|
||||
endcs
|
||||
end
|
||||
|
||||
;****************************
|
||||
; End of 'misc.asm'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
||||
|
251
SRC/msg.asm
251
SRC/msg.asm
@ -1,251 +0,0 @@
|
||||
;****************************
|
||||
; 'msg.asm'
|
||||
;****************************
|
||||
|
||||
include vz.inc
|
||||
|
||||
hseg
|
||||
|
||||
;--- Messages ---
|
||||
|
||||
GDATA idword, label, byte
|
||||
IFDEF PC98
|
||||
db '98'
|
||||
ENDIF
|
||||
IFDEF DOSV
|
||||
db 'DOSV'
|
||||
ENDIF
|
||||
IFDEF J31
|
||||
db 'J31'
|
||||
ENDIF
|
||||
IFDEF IBMAX
|
||||
db 'AX'
|
||||
ENDIF
|
||||
IFDEF JBM
|
||||
db 'PS55'
|
||||
ENDIF
|
||||
IFDEF US
|
||||
db 'US'
|
||||
ENDIF
|
||||
db 0
|
||||
|
||||
IFNDEF MSG_US
|
||||
GDATA mg_ask, db, <'か? (Y/N) ',0>
|
||||
GDATA message, db, 0
|
||||
db 2,'は見つかりません. 新規ファイルです',0 ;1
|
||||
db 3,'は入力できません',0 ;2
|
||||
db 3,'は出力できません',0 ;3
|
||||
db 'テンポラリファイルエラー',0 ;4
|
||||
db 'ラインバッファがいっぱいです',0 ;5
|
||||
db 'オープンできません',0 ;6
|
||||
db 'ディスクがいっぱいです',0 ;7
|
||||
db 'テキスト領域がいっぱいです',0 ;8
|
||||
db 'ブロックが大きすぎます',0 ;9
|
||||
db 'メモリが足りません',0 ;10
|
||||
db 'バッファがいっぱいです',0 ;11
|
||||
db 'COMMAND.COMを起動できません',0 ;12
|
||||
db 'カスタマイズエラー',0 ;13
|
||||
db 2,'を出力します',0 ;14
|
||||
db 3,'を出力中 ...',0 ;15
|
||||
db '修正テキストを出力します',0 ;16
|
||||
db 'テキストスタックを消去します',0 ;17
|
||||
db 'エディタを終了します',0 ;18
|
||||
db '文字列が見つかりません',0 ;19
|
||||
db '全部一度に置換します',0 ;20
|
||||
db '置換します',0 ;21
|
||||
db 1,'%5u 個の文字列を置換しました',0 ;22
|
||||
db 'カーソルキーで位置を移動して' ;23
|
||||
IFDEF PC98
|
||||
db '[リターン]',0
|
||||
ELSE
|
||||
db '[Enter]',0
|
||||
ENDIF
|
||||
db '一致しました',0 ;24
|
||||
db '相違があります',0 ;25
|
||||
db '括弧が見つかりません',0 ;26
|
||||
db 2,'はオープンされています',0 ;27
|
||||
db 'マークしました',0 ;28
|
||||
db 1,'%5u 項目読み込みました.(%d bytes free)',0 ;29
|
||||
db 2,'はすでに存在します',0 ;30
|
||||
db 2,'は無効なパス名です',0 ;31
|
||||
db 2,'はリードオンリーです',0 ;32
|
||||
db '新規ファイルです',0 ;33
|
||||
db 3,'はすでに存在します. 出力します',0 ;34
|
||||
db 3,'は存在しません. 新たに作成します',0 ;35
|
||||
db '変更できません',0 ;36
|
||||
db '編集テキストを放棄します',0 ;37
|
||||
db 1,'%u 個のファイルを削除します.よろしいです',0 ;38
|
||||
|
||||
GDATA mg_exit, db, <'EXITでエディタへ戻ります',CR,LF,'$'>
|
||||
GDATA mg_install,db, <'メモリに常駐しました.'>
|
||||
GDATA mg_tsr2, db, <'(-zで解放)',CR,LF,'$'>
|
||||
GDATA mg_nospc, db, <'メモリが足りません.',CR,LF,'$'> ; ##155.85
|
||||
|
||||
GDATA mg_harderr, label, byte ; ##151.08
|
||||
db '書込み禁止です',0
|
||||
db '指定が違います',0
|
||||
db '準備ができていません',0
|
||||
db 'ハードエラー#%dです',0
|
||||
GDATA mg_drive, db, <'ドライブ%c:の',0>
|
||||
GDATA mg_abort, db, <' (Abort/Retry)? ',0>
|
||||
|
||||
;
|
||||
ELSE
|
||||
GDATA mg_ask, db, <'? (Y/N) ',0>
|
||||
GDATA message, db, 0
|
||||
db 2,' not found. New file',0 ;1
|
||||
db 2,' is unreadable.',0 ;2
|
||||
db 3,' is unwriteable.',0 ;3
|
||||
db 'Temporary file error.',0 ;4
|
||||
db 'Line too long.',0 ;5
|
||||
db 'Too many open files.',0 ;6
|
||||
db 'Disk full.',0 ;7
|
||||
db 'Text buffer full.',0 ;8
|
||||
db 'Block too large.',0 ;9
|
||||
db 'Out of memory.',0 ;10
|
||||
db 'Buffer full.',0 ;11
|
||||
db 'Cannot execute shell.',0 ;12
|
||||
db 'Customization error.',0 ;13
|
||||
db 2,' not saved. Save',0 ;14
|
||||
db 3,' Saving ...',0 ;15
|
||||
db 'Save modified files',0 ;16
|
||||
db 'Clear text stack',0 ;17
|
||||
db 'Quit from editor',0 ;18
|
||||
db 'Strings not found',0 ;19
|
||||
db 'Replace all',0 ;20
|
||||
db 'Replace',0 ;21
|
||||
db 1,'Replace %5u strings.',0 ;22
|
||||
db 'Move position & hit [Enter].',0 ;23
|
||||
db 'No differenece.',0 ;24
|
||||
db 'Differenece encountered.',0 ;25
|
||||
db 'Braces not found.',0 ;26
|
||||
db 2,' is here.',0 ;27
|
||||
db 'Set marker.',0 ;28
|
||||
db 1,'Read %5u terms. (%d bytes free)',0 ;29
|
||||
db 2,' already exist.',0 ;30
|
||||
db 2,' is an invalid pass.',0 ;31
|
||||
db 2,' is read only',0 ;32
|
||||
db 'New file.',0 ;33
|
||||
db 3,' already exist. Overwrite',0 ;34
|
||||
db 3,' not found. Create',0 ;35
|
||||
db 'Cannot change',0 ;36
|
||||
db 'Abandon Edit',0 ;37
|
||||
db 1,'Delete %u files. Sure',0 ;38
|
||||
|
||||
GDATA mg_exit, db, <'Type EXIT to return.',CR,LF,'$'>
|
||||
GDATA mg_install,db, <'installed.'>
|
||||
GDATA mg_tsr2, db, <'(-z to remove)',CR,LF,'$'>
|
||||
GDATA mg_nospc, db, <'Out of memory.',CR,LF,'$'>
|
||||
|
||||
GDATA mg_harderr, label, byte ; ##151.08
|
||||
db 'write protected',0
|
||||
db 'not exist',0
|
||||
db 'not ready',0
|
||||
db 'hard error #%d',0
|
||||
GDATA mg_drive, db, <'Drive %c: is ',0>
|
||||
GDATA mg_abort, db, <' (Abort/Retry)? ',0>
|
||||
|
||||
ENDIF
|
||||
|
||||
;--- Graphic char table ---
|
||||
|
||||
IFDEF PC98
|
||||
GDATA grctbl, db, <95h,96h,98h,99h,9Ah,9Bh,88h,97h,1Ch,1Fh,1Dh>
|
||||
ELSE
|
||||
IFDEF JBM
|
||||
GDATA grctbl, db, <06h,05h,01h,02h,03h,04h,08h,09h,1Eh,1Bh,1Fh>
|
||||
ELSE
|
||||
GDATA grctbl, db, <0C4h,0B3h,0DAh,0BFh,0C0h,0D9h,0DDh,0DEh,1Ah,19h,11h>
|
||||
ENDIF
|
||||
ENDIF
|
||||
db 0
|
||||
|
||||
IFNDEF MSG_US
|
||||
GDATA sym_page,db, <'PCS□'>
|
||||
ELSE
|
||||
GDATA sym_page,db, <'PgCmSt[]'>
|
||||
ENDIF
|
||||
db 0
|
||||
|
||||
IFDEF IBM
|
||||
GDATA grctbl2, db, <0C4h,0B3h,0DAh,0BFh,0C0h,0D9h,0DDh,0DEh,1Ah,19h,11h>
|
||||
ENDIF
|
||||
endhs
|
||||
|
||||
_tail segment
|
||||
|
||||
;--- Startup messages ---
|
||||
|
||||
IFNDEF MSG_US
|
||||
GDATA mg_remove,db, <'メモリを解放しました.',CR,LF,'$'>
|
||||
GDATA mg_rmerr, db, <'編集中のテキストがあります.',CR,LF,'$'>
|
||||
GDATA mg_noent, db, <'"が見つかりません.$'>
|
||||
;GDATA mg_update,db, <'"を更新しました.',CR,LF,'$'>
|
||||
GDATA mg_synerr,db, <'Syntax Error: $'>
|
||||
GDATA mg_opterr,db, <'Option Error: $'>
|
||||
GDATA mg_cstmerr,db, <CR,LF,'カスタマイズエラー'>
|
||||
GDATA mg_ctrl_c,db, <'(CTRL-Cで中止)$'>
|
||||
GDATA mg_ems, db, <'EMSを最大'>
|
||||
GDATA mg_emspage,db, <'0000 ページ使用します.',CR,LF,'$'>
|
||||
GDATA mg_xms, db, <'XMSを最大'>
|
||||
GDATA mg_xmssize,db, <'000000 KB使用します.',CR,LF,'$'>
|
||||
GDATA mg_verng, db, <'バージョンが違います.',CR,LF,'$'>
|
||||
|
||||
ELSE
|
||||
GDATA mg_remove,db, <'removed.',CR,LF,'$'>
|
||||
GDATA mg_rmerr, db, <'Exist open files.',CR,LF,'$'>
|
||||
GDATA mg_noent, db, <'" not found.$'>
|
||||
;GDATA mg_update,db, <'" was updated.',CR,LF,'$'>
|
||||
GDATA mg_synerr,db, <'Syntax Error: $'>
|
||||
GDATA mg_opterr,db, <'Option Error: $'>
|
||||
GDATA mg_cstmerr,db, <CR,LF,'Customization error.'>
|
||||
GDATA mg_ctrl_c,db, <' (Ctrl-C to break)$'>
|
||||
GDATA mg_ems ,db, <'Allocate'>
|
||||
GDATA mg_emspage,db, <'00000 pages on EMS.',CR,LF,'$'>
|
||||
GDATA mg_xms ,db, <'Allocate'>
|
||||
GDATA mg_xmssize,db, <'00000 KB on XMS.',CR,LF,'$'>
|
||||
GDATA mg_verng, db, <'Illegal version.',CR,LF,'$'>
|
||||
|
||||
ENDIF
|
||||
GDATA mg_hardng,db, <'Illegal mode!',CR,LF,7,'$'>
|
||||
|
||||
GDATA mg_title, label, byte
|
||||
IFNDEF MSG_US
|
||||
db 'VZ Editor '
|
||||
ELSE
|
||||
db 'VZ Editor '
|
||||
ENDIF
|
||||
IFDEF J31
|
||||
db 'J-3100 '
|
||||
ENDIF
|
||||
IFDEF IBMAX
|
||||
db 'AX '
|
||||
ENDIF
|
||||
IFDEF DOSV
|
||||
IFDEF MSG_US
|
||||
db 'DOS/V '
|
||||
ELSE
|
||||
db 'DOS/V(JP) '
|
||||
ENDIF
|
||||
ENDIF
|
||||
IFDEF JBM
|
||||
db 'PS/55 '
|
||||
ENDIF
|
||||
IFDEF US
|
||||
db 'IBM PC '
|
||||
ENDIF
|
||||
IFDEF MINI
|
||||
db '(S) '
|
||||
ENDIF
|
||||
IFDEF SLIM
|
||||
db '(L) '
|
||||
ENDIF
|
||||
db 'Version 1.60 '
|
||||
db ' Copyright (C) 1989-93 by c.mos'
|
||||
GDATA mg_crlf, db, <CR,LF,'$'>
|
||||
|
||||
even
|
||||
GDATA code_end, label, near
|
||||
_tail ends
|
||||
|
||||
end
|
2137
SRC/open.asm
2137
SRC/open.asm
File diff suppressed because it is too large
Load Diff
@ -1,43 +0,0 @@
|
||||
;**************************** ; ##156.95
|
||||
; 'printf.asm'
|
||||
;****************************
|
||||
|
||||
include vz.inc
|
||||
|
||||
eseg
|
||||
|
||||
extrn puts :near
|
||||
extrn pfbufp :word
|
||||
|
||||
$ld_strseg macro
|
||||
movseg ds,ss
|
||||
endm
|
||||
|
||||
assume ds:nothing
|
||||
|
||||
public printf
|
||||
printf proc
|
||||
pushm <si,di,ds,es>
|
||||
movseg ds,cs
|
||||
movseg es,ss
|
||||
mov di,pfbufp
|
||||
push di
|
||||
call sprintf
|
||||
pop si
|
||||
movseg ds,ss
|
||||
call puts
|
||||
popm <es,ds,di,si>
|
||||
VZ_RET
|
||||
printf endp
|
||||
|
||||
public sprintf
|
||||
include sprintf.inc
|
||||
|
||||
endes
|
||||
|
||||
end
|
||||
|
||||
;****************************
|
||||
; End of 'printf.asm'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
422
SRC/scrn.asm
422
SRC/scrn.asm
@ -1,422 +0,0 @@
|
||||
;****************************
|
||||
; 'scrn.asm'
|
||||
;****************************
|
||||
|
||||
include vz.inc
|
||||
|
||||
;--- External symbols ---
|
||||
|
||||
wseg
|
||||
; extrn altsize :byte
|
||||
extrn atrtbl :byte
|
||||
extrn atrucsr :byte
|
||||
extrn atrflag :byte
|
||||
extrn csr_i :byte
|
||||
extrn csr_o :byte
|
||||
extrn dspsw :byte
|
||||
extrn fkeymode :byte
|
||||
extrn grctbl :byte
|
||||
extrn hardware :byte
|
||||
extrn hsplit :byte
|
||||
extrn vsplit :byte
|
||||
extrn linecnt :byte
|
||||
extrn syssw :byte
|
||||
extrn silent :byte
|
||||
extrn msgon :byte
|
||||
|
||||
extrn conbufsz :word
|
||||
extrn conseg :word
|
||||
IFNDEF NOFILER
|
||||
extrn curscrn :word
|
||||
ENDIF
|
||||
extrn dosscrn :word
|
||||
extrn farseg :word
|
||||
; extrn gvram :word
|
||||
extrn imgstack :word
|
||||
extrn refloc :word
|
||||
extrn tvsize :word
|
||||
extrn tmpbuf3 :word
|
||||
extrn paltblp :word
|
||||
endws
|
||||
|
||||
extrn do_tab :near
|
||||
extrn ems_loadmap :near
|
||||
extrn ems_map :near
|
||||
; extrn ems_nec :near
|
||||
extrn ems_savemap :near
|
||||
extrn iskanji :near
|
||||
extrn optputs :near
|
||||
extrn toupper :near
|
||||
extrn resetfp :near
|
||||
IFDEF PC98
|
||||
extrn sm_sensekey :near
|
||||
ENDIF
|
||||
|
||||
dseg
|
||||
|
||||
;--- Local work ---
|
||||
|
||||
GDATA scrnparm, label, byte
|
||||
dsp _farptr <>
|
||||
win _rect <>
|
||||
loc _point <>
|
||||
GDATA dosloc, dw, 0
|
||||
dspatr db 0
|
||||
locx0 db 0
|
||||
dosh db 0
|
||||
GDATA chkh, db, 0 ; ##156.123
|
||||
savef db 0
|
||||
GDATA ucsrpos, dw, 0
|
||||
ucsrlen db 0
|
||||
fnckey db 0
|
||||
GDATA defatr, db, INVALID
|
||||
imagep dw 0
|
||||
lineh db 0
|
||||
precsr db -1 ; ##153.41
|
||||
GDATA doswd, dw, WD ; ##156.123
|
||||
doswd2 dw WD*2
|
||||
hsplit0 db 0 ; ##16
|
||||
vsplit0 db 0 ;
|
||||
|
||||
;gvseg dw 0
|
||||
;extbank db 0
|
||||
rolc1 db 0
|
||||
lineh1 db 0
|
||||
waitc dw 1 ; ##153.50
|
||||
|
||||
paltbl db -1
|
||||
db 16 dup(0)
|
||||
dospaltbl db 0,1,2,3,4,5,20,7,56,57,58,59,60,61,62,63,0
|
||||
|
||||
endds
|
||||
|
||||
iseg
|
||||
assume ds:cgroup ; ##156
|
||||
|
||||
;--- Init screen param. ---
|
||||
|
||||
public initscrn
|
||||
initscrn proc
|
||||
mov al,linecnt
|
||||
mov chkh,al
|
||||
call doswindow
|
||||
shr cl,1
|
||||
shr ch,1
|
||||
mov vsplit,cl
|
||||
mov hsplit,ch
|
||||
call resetscrnh
|
||||
VZ_RET
|
||||
initscrn endp
|
||||
|
||||
endis
|
||||
|
||||
eseg
|
||||
assume ds:nothing
|
||||
|
||||
;--- Check "silent" ---
|
||||
|
||||
public issilent,is_dossilent
|
||||
issilent proc
|
||||
tstb silent
|
||||
_ifn z
|
||||
inc sp
|
||||
inc sp
|
||||
_endif
|
||||
VZ_RET
|
||||
issilent endp
|
||||
|
||||
is_dossilent proc
|
||||
test silent,2
|
||||
_ifn z
|
||||
inc sp
|
||||
inc sp
|
||||
_endif
|
||||
VZ_RET
|
||||
is_dossilent endp
|
||||
|
||||
;--- Get/set window ---
|
||||
; DL,DH :window top-left x,y
|
||||
; CL,CH :window size x,y
|
||||
|
||||
public getwindow
|
||||
getwindow proc
|
||||
mov dx,word ptr win.px
|
||||
mov cx,word ptr win.sx
|
||||
VZ_RET
|
||||
getwindow endp
|
||||
|
||||
public setwindow
|
||||
setwindow proc
|
||||
mov word ptr win.px,dx
|
||||
mov word ptr win.sx,cx
|
||||
VZ_RET
|
||||
setwindow endp
|
||||
|
||||
;--- Get dos window ---
|
||||
;<--
|
||||
; DL,DH :window top-left x,y
|
||||
; CL,CH :window size x,y
|
||||
|
||||
public doswindow
|
||||
doswindow proc
|
||||
call dosheight
|
||||
mov cl,byte ptr doswd
|
||||
clr dx
|
||||
VZ_RET
|
||||
doswindow endp
|
||||
|
||||
;--- Set dos window ---
|
||||
|
||||
public setdoswindow
|
||||
setdoswindow proc
|
||||
pushm <ax,cx,dx>
|
||||
call doswindow
|
||||
call setwindow
|
||||
popm <dx,cx,ax>
|
||||
VZ_RET
|
||||
setdoswindow endp
|
||||
|
||||
;--- Set command line window ---
|
||||
|
||||
public setcmdwindow
|
||||
setcmdwindow proc
|
||||
call dosloc1
|
||||
mov cl,byte ptr doswd
|
||||
sub cl,dl
|
||||
mov ch,1
|
||||
call setwindow
|
||||
call setrefloc
|
||||
VZ_RET
|
||||
setcmdwindow endp
|
||||
|
||||
dosloc1 proc
|
||||
mov dx,dosloc
|
||||
call dosheight
|
||||
sub ch,cl
|
||||
cmp dh,ch
|
||||
_if a
|
||||
mov dh,ch
|
||||
_endif
|
||||
VZ_RET
|
||||
dosloc1 endp
|
||||
|
||||
;--- Save window,location ---
|
||||
; keep registors except DI
|
||||
|
||||
public savewloc
|
||||
savewloc proc
|
||||
pop di
|
||||
push loc
|
||||
push word ptr win.px
|
||||
push word ptr win.sx
|
||||
push refloc
|
||||
jmp di
|
||||
savewloc endp
|
||||
|
||||
;--- Load window,location ---
|
||||
; keep registors except DX,DI
|
||||
|
||||
public loadwloc
|
||||
loadwloc proc
|
||||
pop di
|
||||
pop refloc
|
||||
pop word ptr win.sx
|
||||
pop word ptr win.px
|
||||
pop dx
|
||||
pushf
|
||||
call locate
|
||||
popf
|
||||
jmp di
|
||||
loadwloc endp
|
||||
|
||||
;--- Check screen size --- ; ##156.133
|
||||
|
||||
public chkscreen
|
||||
chkscreen proc
|
||||
call getdosloc2
|
||||
mov win.py,dh
|
||||
mov dosloc.py,dh
|
||||
mov byte ptr refloc+1,dh
|
||||
VZ_RET
|
||||
chkscreen endp
|
||||
|
||||
;--- Locate x,y ---
|
||||
; DL,DH :location x,y
|
||||
|
||||
public locate
|
||||
locate proc
|
||||
push di
|
||||
mov loc,dx
|
||||
call mkwindp
|
||||
mov dsp.@off,di
|
||||
pop di
|
||||
VZ_RET
|
||||
locate endp
|
||||
|
||||
;--- Get GVRAM work @seg ---
|
||||
;<-- AX :@seg
|
||||
|
||||
getgvseg proc
|
||||
; call setgbank
|
||||
call ems_savemap
|
||||
mov ax,farseg
|
||||
call ems_map
|
||||
VZ_RET
|
||||
getgvseg endp
|
||||
|
||||
;--- Get locate x,y ---
|
||||
;<-- DL,DH :location x,y
|
||||
|
||||
public getloc
|
||||
getloc proc
|
||||
mov dx,loc
|
||||
VZ_RET
|
||||
getloc endp
|
||||
|
||||
;--- Set dos location ---
|
||||
|
||||
public setdosloc
|
||||
setdosloc proc
|
||||
mov ax,loc
|
||||
add ax,word ptr win.px
|
||||
mov dosloc,ax
|
||||
VZ_RET
|
||||
setdosloc endp
|
||||
|
||||
;--- Set dos cursor ---
|
||||
|
||||
public setdoscsr
|
||||
setdoscsr proc
|
||||
call doswindow
|
||||
call setwindow
|
||||
call dosloc1
|
||||
call locate
|
||||
mov al,CSR_SYS
|
||||
call csron
|
||||
VZ_RET
|
||||
setdoscsr endp
|
||||
|
||||
;--- Get graphic char ---
|
||||
;--> AL :graf char type
|
||||
;<-- AL :graf char code
|
||||
|
||||
dummy label byte
|
||||
|
||||
public getgrafchr
|
||||
getgrafchr proc
|
||||
push bx
|
||||
call getgrctbl ; ##156.DOSV
|
||||
sub al,GRC
|
||||
xlat cs:dummy
|
||||
pop bx
|
||||
VZ_RET
|
||||
getgrafchr endp
|
||||
|
||||
;--- Init window parm. ---
|
||||
;-->
|
||||
; DL,DH,CL,CH :screen block
|
||||
;<--
|
||||
; SI=DI :screen offset
|
||||
; DS=ES :screen segment
|
||||
; CX : block size x
|
||||
; DX : block size y
|
||||
|
||||
initwind proc
|
||||
call mkscrnp
|
||||
mov si,di
|
||||
mov ds,dsp.@seg
|
||||
movseg es,ds
|
||||
mov dl,ch
|
||||
clr dh
|
||||
clr ch
|
||||
VZ_RET
|
||||
initwind endp
|
||||
|
||||
;--- Reset image ptr ---
|
||||
|
||||
public clrwstack
|
||||
clrwstack proc
|
||||
mov ax,imgstack
|
||||
mov imagep,ax
|
||||
VZ_RET
|
||||
clrwstack endp
|
||||
|
||||
;--- Set/Get cursor type ---
|
||||
; DL :insert mode (0-15)
|
||||
; DH :overwrite mode (0-15)
|
||||
|
||||
public setcsrtype
|
||||
setcsrtype proc
|
||||
mov csr_i,dl
|
||||
mov csr_o,dh
|
||||
VZ_RET
|
||||
setcsrtype endp
|
||||
|
||||
public getcsrtype
|
||||
getcsrtype proc
|
||||
mov dl,csr_i
|
||||
mov dh,csr_o
|
||||
VZ_RET
|
||||
getcsrtype endp
|
||||
|
||||
;--- Convert shift-JIS to JIS ---
|
||||
;--> DX :shift JIS code
|
||||
;<-- AX :JIS code
|
||||
|
||||
public cvtjis
|
||||
cvtjis proc
|
||||
mov ax,dx
|
||||
mstojis
|
||||
VZ_RET
|
||||
cvtjis endp
|
||||
|
||||
endes
|
||||
|
||||
IF 0
|
||||
bseg
|
||||
;--- Set/reset G-RAM bank ---
|
||||
|
||||
IO_GBANK equ 0A6h
|
||||
IO_8OR16 equ 06Ah
|
||||
|
||||
public setgbank,resetgbank
|
||||
setgbank proc
|
||||
push ax
|
||||
tstb extbank
|
||||
_ifn z
|
||||
outi IO_8OR16,1
|
||||
_endif
|
||||
mov al,1
|
||||
jmps gbank1
|
||||
resetgbank:
|
||||
push ax
|
||||
mov al,0
|
||||
gbank1: tstw gvseg
|
||||
_ifn z
|
||||
out IO_GBANK,al
|
||||
_else
|
||||
push bx
|
||||
mov bl,al
|
||||
xor bl,1
|
||||
call ems_nec
|
||||
pop bx
|
||||
_endif
|
||||
pop ax
|
||||
VZ_RET
|
||||
setgbank endp
|
||||
|
||||
endbs
|
||||
ENDIF
|
||||
|
||||
IFDEF PC98
|
||||
include scrn98.asm
|
||||
ELSE
|
||||
include scrnibm.asm
|
||||
ENDIF
|
||||
|
||||
end
|
||||
|
||||
;****************************
|
||||
; End of 'scrn.asm'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
1943
SRC/scrn98.asm
1943
SRC/scrn98.asm
File diff suppressed because it is too large
Load Diff
3348
SRC/scrnibm.asm
3348
SRC/scrnibm.asm
File diff suppressed because it is too large
Load Diff
323
SRC/smooth.asm
323
SRC/smooth.asm
@ -1,323 +0,0 @@
|
||||
;****************************
|
||||
; 'smooth.asm'
|
||||
;****************************
|
||||
|
||||
include vz.inc
|
||||
|
||||
;--- External symbols ---
|
||||
|
||||
wseg
|
||||
extrn defatr :byte
|
||||
|
||||
extrn dspsw :word
|
||||
extrn w_act :word
|
||||
extrn w_back :word
|
||||
endws
|
||||
|
||||
extrn clsatr :near
|
||||
extrn csroff :near
|
||||
extrn disppole :near
|
||||
extrn dispstat :near
|
||||
extrn doswindow :near
|
||||
extrn isend :near
|
||||
extrn istop :near
|
||||
extrn nxtfld :near
|
||||
extrn nxtfldl :near
|
||||
extrn prefld :near
|
||||
extrn prefldl :near
|
||||
extrn scrout_fx :near
|
||||
extrn setatr :near
|
||||
extrn setbtmnumb :near
|
||||
extrn sethomnumb :near
|
||||
extrn tout :near
|
||||
|
||||
extrn rolldwn :near
|
||||
extrn rollup :near
|
||||
extrn smootharea :near
|
||||
extrn smoothdown :near
|
||||
extrn smoothup1 :near
|
||||
extrn smoothup2 :near
|
||||
extrn sm_chkkey :near
|
||||
extrn sm_chksft :near
|
||||
extrn sm_gettrgkey :near
|
||||
extrn flush_key :near
|
||||
extrn isdnumb :near
|
||||
extrn undercsr :near
|
||||
|
||||
dseg
|
||||
|
||||
;--- Local work ---
|
||||
|
||||
btmy db 0
|
||||
|
||||
endds
|
||||
|
||||
cseg
|
||||
assume ds:nothing
|
||||
|
||||
;--- Smooth scroll Down ---
|
||||
|
||||
public se_smoothdn
|
||||
se_smoothdn proc
|
||||
call inisup
|
||||
je rlup9
|
||||
call bpback
|
||||
_ifn b
|
||||
call inisup
|
||||
call bpact
|
||||
je rlup9
|
||||
_endif
|
||||
call initrol
|
||||
_repeat
|
||||
call nxtsup
|
||||
call bpback
|
||||
_ifn b
|
||||
call nxtsup
|
||||
call bpact
|
||||
_endif
|
||||
call smoothdown
|
||||
mov dh,[bp].tw_py
|
||||
inc dh
|
||||
mov dl,btmy
|
||||
add dl,dh
|
||||
call rollup
|
||||
call dspsup
|
||||
call bpback
|
||||
_ifn b
|
||||
call dspsup
|
||||
call bpact
|
||||
_endif
|
||||
mov dh,btmy
|
||||
call dsppole
|
||||
mov si,[bp].tbtm
|
||||
call isend
|
||||
je rlup8
|
||||
call bpback
|
||||
_ifn b
|
||||
mov si,[bp].tbtm
|
||||
call isend
|
||||
call bpact
|
||||
je rlup8
|
||||
_endif
|
||||
call sm_chkkey
|
||||
_until c
|
||||
rlup8: call rlend
|
||||
rlup9: clc
|
||||
VZ_RET
|
||||
se_smoothdn endp
|
||||
|
||||
;--- Smooth scroll Up ---
|
||||
|
||||
public se_smoothup
|
||||
se_smoothup proc
|
||||
call inisdn
|
||||
je rldn91
|
||||
call bpback
|
||||
_ifn b
|
||||
call inisdn
|
||||
call bpact
|
||||
rldn91: je rldn9
|
||||
_endif
|
||||
call initrol
|
||||
rldn2:
|
||||
call nxtsdn
|
||||
call bpback
|
||||
_ifn b
|
||||
call nxtsdn
|
||||
call bpact
|
||||
_endif
|
||||
call smoothup1
|
||||
mov dh,[bp].tw_py
|
||||
mov dl,btmy
|
||||
add dl,dh
|
||||
call rolldwn
|
||||
call dspsdn
|
||||
call bpback
|
||||
_ifn b
|
||||
call dspsdn
|
||||
call bpact
|
||||
_endif
|
||||
clr dh
|
||||
call dsppole
|
||||
call smoothup2
|
||||
mov si,[bp].thom
|
||||
call istop
|
||||
je rldn8
|
||||
call bpback
|
||||
_ifn b
|
||||
mov si,[bp].thom
|
||||
call istop
|
||||
call bpact
|
||||
je rldn8
|
||||
_endif
|
||||
call sm_chkkey
|
||||
jnc rldn2
|
||||
rldn8: call rlend
|
||||
rldn9: clc
|
||||
VZ_RET
|
||||
se_smoothup endp
|
||||
|
||||
;--- Smooth scroll init ---
|
||||
|
||||
initrol proc
|
||||
call sm_gettrgkey
|
||||
mov bh,TRUE
|
||||
call sm_chksft
|
||||
mov al,ATR_TXT
|
||||
call setatr
|
||||
call doswindow
|
||||
call smootharea
|
||||
mov btmy,al
|
||||
call csroff
|
||||
call initrol1
|
||||
call bpback
|
||||
_ifn b
|
||||
call initrol1
|
||||
call bpact
|
||||
_endif
|
||||
tstb defatr
|
||||
_if s
|
||||
clr dx
|
||||
call undercsr
|
||||
_endif
|
||||
VZ_RET
|
||||
initrol endp
|
||||
|
||||
initrol1 proc
|
||||
mov si,[bp].tfld
|
||||
mov [bp].tnow,si
|
||||
tstb [bp].blkm
|
||||
jnz irol2
|
||||
test dspsw,DSP_SMOOTH
|
||||
_if z
|
||||
irol2: mov defatr,ATR_TXT
|
||||
mov dx,word ptr [bp].tw_px
|
||||
mov cx,word ptr [bp].tw_sx
|
||||
call clsatr
|
||||
_endif
|
||||
VZ_RET
|
||||
initrol1 endp
|
||||
|
||||
;--- Common sub ---
|
||||
|
||||
bpact proc
|
||||
mov bp,w_act
|
||||
mov ds,[bp].ttops
|
||||
VZ_RET
|
||||
bpact endp
|
||||
|
||||
bpback proc
|
||||
cmp [bp].wsplit,SPLIT_V
|
||||
_ifn b
|
||||
mov bp,w_back
|
||||
mov ds,[bp].ttops
|
||||
_endif
|
||||
VZ_RET
|
||||
bpback endp
|
||||
|
||||
rlend proc
|
||||
mov defatr,INVALID
|
||||
call bpback
|
||||
jb rlend2
|
||||
call rlend2
|
||||
call bpact
|
||||
mov dh,[bp].tw_cy
|
||||
call dsppole
|
||||
rlend2: mov si,[bp].tnow
|
||||
mov [bp].tcp,si
|
||||
disp4: mov al,[bp].wy ; ##101.23
|
||||
mov [bp].wys,al
|
||||
call scrout_fx
|
||||
call flush_key ; ##151.09
|
||||
VZ_RET
|
||||
rlend endp
|
||||
|
||||
dsppole proc
|
||||
cmp [bp].wsplit,SPLIT_V
|
||||
_if ae
|
||||
add dh,[bp].tw_py
|
||||
mov ch,1
|
||||
call disppole
|
||||
_endif
|
||||
VZ_RET
|
||||
dsppole endp
|
||||
|
||||
;--- Scroll up sub ---
|
||||
|
||||
inisup proc
|
||||
mov cx,[bp].tbtm
|
||||
tst cx
|
||||
jz isup9
|
||||
call setbtmnumb
|
||||
mov [bp].w3,dx
|
||||
clz
|
||||
isup9: VZ_RET
|
||||
inisup endp
|
||||
|
||||
nxtsup proc
|
||||
mov si,[bp].tnow
|
||||
call nxtfldl
|
||||
mov [bp].tnow,si
|
||||
mov [bp].tnxt,si
|
||||
mov [bp].tcp,si
|
||||
VZ_RET
|
||||
nxtsup endp
|
||||
|
||||
dspsup proc
|
||||
call dispstat
|
||||
mov cl,btmy
|
||||
mov dx,[bp].w3
|
||||
mov si,[bp].tbtm
|
||||
call tout
|
||||
mov [bp].tbtm,si
|
||||
mov [bp].w3,dx
|
||||
VZ_RET
|
||||
dspsup endp
|
||||
|
||||
;--- Scroll down sub ---
|
||||
|
||||
inisdn proc
|
||||
mov si,[bp].thom
|
||||
call istop
|
||||
je isdn9
|
||||
mov cx,si
|
||||
call sethomnumb
|
||||
mov [bp].w3,dx
|
||||
clz
|
||||
isdn9: VZ_RET
|
||||
inisdn endp
|
||||
|
||||
nxtsdn proc
|
||||
mov si,[bp].tnow
|
||||
call prefldl
|
||||
mov [bp].tnow,si
|
||||
mov [bp].tnxt,si
|
||||
mov [bp].tcp,si
|
||||
mov si,[bp].thom
|
||||
call isdnumb
|
||||
jnz nsdn1
|
||||
cmp byte ptr [si-1],LF
|
||||
_if e
|
||||
nsdn1: dec [bp].w3
|
||||
_endif
|
||||
call prefld
|
||||
mov [bp].thom,si
|
||||
VZ_RET
|
||||
nxtsdn endp
|
||||
|
||||
dspsdn proc
|
||||
call dispstat
|
||||
mov si,[bp].thom
|
||||
clr cl
|
||||
mov dx,[bp].w3
|
||||
jmp tout
|
||||
dspsdn endp
|
||||
|
||||
endcs
|
||||
end
|
||||
|
||||
;****************************
|
||||
; End of 'smooth.asm'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
||||
|
294
SRC/sprintf.inc
294
SRC/sprintf.inc
@ -1,294 +0,0 @@
|
||||
;------------------------------------------------
|
||||
; sprintf.inc
|
||||
;
|
||||
; Copyright (c) 1991 by c.mos
|
||||
;------------------------------------------------
|
||||
|
||||
;----- Equations -----
|
||||
|
||||
PF_LEFT equ 000001b
|
||||
PF_ZERO equ 000010b
|
||||
PF_LONG equ 000100b
|
||||
PF_MINUS equ 001000b
|
||||
PF_TRIPLE equ 010000b
|
||||
|
||||
;----- Local work -----
|
||||
|
||||
_printwk struc
|
||||
pmode db ?
|
||||
db ?
|
||||
pnum db ?
|
||||
knjh db ?
|
||||
_printwk ends
|
||||
|
||||
;------------------------------------------------
|
||||
; sprintf
|
||||
;------------------------------------------------
|
||||
;-->
|
||||
; DS:SI :format string ptr
|
||||
;*ES:DI :output buffer ptr
|
||||
; SS:BX :parameter top ptr
|
||||
; $ld_strseg :load %s str seg to DS
|
||||
; usage :" %[-][0][n][,][l]{d|u|x|c|s} "
|
||||
sprintf proc
|
||||
|
||||
$sprintf proc
|
||||
pushm <bx,cx,dx,si,bp,ds,es>
|
||||
sub sp,type _printwk
|
||||
mov bp,sp
|
||||
skip1 al
|
||||
prnt1:
|
||||
stosb
|
||||
prnt2: lodsb
|
||||
tst al
|
||||
jz prnt8
|
||||
cmp al,'%'
|
||||
jne prnt1
|
||||
lodsb
|
||||
cmp al,'%'
|
||||
je prnt1
|
||||
call prnt_form
|
||||
jmp prnt2
|
||||
prnt8:
|
||||
stosb
|
||||
add sp,type _printwk
|
||||
popm <es,ds,bp,si,dx,cx,bx>
|
||||
VZ_RET
|
||||
$sprintf endp
|
||||
|
||||
;----- Analyze format -----
|
||||
|
||||
prnt_form proc
|
||||
clr ah
|
||||
cmp al,'-'
|
||||
_if e
|
||||
or ah,PF_LEFT
|
||||
lodsb
|
||||
_endif
|
||||
cmp al,'0'
|
||||
_if e
|
||||
or ah,PF_ZERO
|
||||
lodsb
|
||||
_endif
|
||||
mov [bp].pmode,ah
|
||||
call scandeci
|
||||
mov [bp].pnum,dl
|
||||
cmp al,','
|
||||
_if e
|
||||
or [bp].pmode,PF_TRIPLE
|
||||
lodsb
|
||||
_endif
|
||||
cmp al,'l'
|
||||
_if e
|
||||
or [bp].pmode,PF_LONG
|
||||
lodsb
|
||||
_endif
|
||||
mov dl,al
|
||||
mov ax,ss:[bx]
|
||||
inc bx
|
||||
inc bx
|
||||
cmp dl,'d'
|
||||
je prnt_deci
|
||||
cmp dl,'u'
|
||||
je prnt_unsigned
|
||||
cmp dl,'x'
|
||||
je prnt_hexa
|
||||
cmp dl,'s'
|
||||
je prnt_str
|
||||
cmp dl,'c'
|
||||
je prnt_chr
|
||||
VZ_RET
|
||||
|
||||
;----- %c : character -----
|
||||
|
||||
prnt_chr:
|
||||
tst ax
|
||||
_ifn z
|
||||
tst ah
|
||||
_if z
|
||||
stosb
|
||||
_else
|
||||
xchg al,ah
|
||||
stosw
|
||||
_endif
|
||||
_endif
|
||||
VZ_RET
|
||||
|
||||
;----- %s : string -----
|
||||
|
||||
prnt_str:
|
||||
pushm <si,ds>
|
||||
$ld_strseg
|
||||
mov si,ax
|
||||
tst si
|
||||
jz pstr8
|
||||
clr ah
|
||||
clr cl
|
||||
mov ch,[bp].pnum
|
||||
_repeat
|
||||
lodsb
|
||||
tst al
|
||||
jz pstr1
|
||||
stosb
|
||||
inc cl
|
||||
tst ch
|
||||
_cont z
|
||||
cmp cl,ch
|
||||
_while b
|
||||
jmps pstr8
|
||||
pstr1:
|
||||
test [bp].pmode,PF_LEFT
|
||||
jz pstr8
|
||||
sub cl,ch
|
||||
jnc pstr8
|
||||
neg cl
|
||||
clr ch
|
||||
mov al,SPC
|
||||
rep stosb
|
||||
pstr8: popm <ds,si>
|
||||
VZ_RET
|
||||
|
||||
;----- %x,%u,%d : number -----
|
||||
;(special thanks to Oh!No! & moritan)
|
||||
|
||||
prnt_deci:
|
||||
movhl cx,TRUE,10
|
||||
cwd
|
||||
jmps pnum1
|
||||
prnt_hexa:
|
||||
mov cl,16
|
||||
skip2 dx
|
||||
prnt_unsigned:
|
||||
mov cl,10
|
||||
mov ch,FALSE
|
||||
clr dx
|
||||
pnum1:
|
||||
test [bp].pmode,PF_LONG
|
||||
_ifn z
|
||||
mov dx,ss:[bx]
|
||||
inc bx
|
||||
inc bx
|
||||
_endif
|
||||
tst ch
|
||||
_ifn z
|
||||
clr ch
|
||||
tst dx
|
||||
_if s
|
||||
neg ax
|
||||
adc dx,0
|
||||
neg dx
|
||||
or [bp].pmode,PF_MINUS
|
||||
_endif
|
||||
_endif
|
||||
pushm <bx,si>
|
||||
mov bx,cx
|
||||
clr cx
|
||||
_repeat
|
||||
inc cx
|
||||
test cl,3
|
||||
_if z
|
||||
test [bp].pmode,PF_TRIPLE
|
||||
_ifn z
|
||||
mov si,','
|
||||
push si
|
||||
inc cx
|
||||
_endif
|
||||
_endif
|
||||
push ax
|
||||
mov ax,dx
|
||||
clr dx
|
||||
div bx
|
||||
mov si,ax
|
||||
pop ax
|
||||
div bx
|
||||
xchg ax,dx
|
||||
cmp al,10 ;
|
||||
sbb al,69h ; Tricky !
|
||||
das ;
|
||||
push ax
|
||||
mov ax,dx
|
||||
mov dx,si
|
||||
or si,ax
|
||||
_until z
|
||||
test [bp].pmode,PF_MINUS
|
||||
_ifn z
|
||||
mov al,'-'
|
||||
push ax
|
||||
inc cx
|
||||
_endif
|
||||
sub [bp].pnum,cl
|
||||
_if b
|
||||
mov [bp].pnum,0
|
||||
_endif
|
||||
test [bp].pmode,PF_LEFT
|
||||
_if z
|
||||
call prnt_fill
|
||||
_endif
|
||||
_repeat
|
||||
pop ax
|
||||
stosb
|
||||
dec cx
|
||||
_until z
|
||||
test [bp].pmode,PF_LEFT
|
||||
_ifn z
|
||||
call prnt_fill
|
||||
_endif
|
||||
popm <si,bx>
|
||||
VZ_RET
|
||||
|
||||
;----- Fill space or '0' -----
|
||||
|
||||
prnt_fill proc
|
||||
push cx
|
||||
mov cl,[bp].pnum
|
||||
clr ch
|
||||
tst cx
|
||||
_if g
|
||||
mov al,' '
|
||||
test [bp].pmode, PF_ZERO
|
||||
_ifn z
|
||||
mov al,'0'
|
||||
_endif
|
||||
rep stosb
|
||||
_endif
|
||||
pop cx
|
||||
VZ_RET
|
||||
prnt_fill endp
|
||||
|
||||
prnt_form endp
|
||||
|
||||
;------------------------------------------------
|
||||
; Scan decimal
|
||||
;------------------------------------------------
|
||||
;-->
|
||||
; SI :pointer
|
||||
; AL :1st char
|
||||
;<--
|
||||
; DX :number
|
||||
; AL :next char
|
||||
|
||||
public scandeci
|
||||
scandeci proc
|
||||
clr dx
|
||||
_repeat
|
||||
cmp al,'0'
|
||||
_break b
|
||||
cmp al,'9'
|
||||
_break a
|
||||
sub al,'0'
|
||||
cbw
|
||||
push ax
|
||||
mov ax,10
|
||||
mul dx
|
||||
mov dx,ax
|
||||
pop ax
|
||||
add dx,ax
|
||||
lodsb
|
||||
_until
|
||||
VZ_RET
|
||||
scandeci endp
|
||||
|
||||
sprintf endp
|
||||
;------------------------------------------------
|
||||
; End of sprintf.inc
|
||||
;------------------------------------------------
|
525
SRC/std.inc
525
SRC/std.inc
@ -1,525 +0,0 @@
|
||||
.xlist
|
||||
page 66,132
|
||||
|
||||
;****************************
|
||||
; 'std.inc'
|
||||
;****************************
|
||||
|
||||
;NEWBLOCK equ TRUE
|
||||
|
||||
IFNDEF i8086
|
||||
IFDEF i186
|
||||
.186
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
;--- Equations ---
|
||||
|
||||
BELL equ 07h
|
||||
BS equ 08h
|
||||
TAB equ 09h
|
||||
LF equ 0Ah
|
||||
CR equ 0Dh
|
||||
EOF equ 1Ah
|
||||
ESCP equ 1Bh
|
||||
SPC equ 20h
|
||||
CRLF equ 0A0Dh
|
||||
TRUE equ 1
|
||||
FALSE equ 0
|
||||
ON equ 1
|
||||
OFF equ 0
|
||||
NULL equ 0
|
||||
INVALID equ -1
|
||||
|
||||
;--- Interrupt number ---
|
||||
|
||||
INT_EMS equ 67h
|
||||
INT_EZKEY equ 0E0h
|
||||
|
||||
;--- DOS functions ---
|
||||
|
||||
F_CONINE equ 01h ; Read Keyboard and Echo
|
||||
F_DSPCHR equ 02h ; Display Character
|
||||
F_CONIO equ 06h ; Direct Console I/O
|
||||
F_CONIN equ 07h ; Direct Console Input
|
||||
F_READKEY equ 08h ; Read Keyboard
|
||||
F_DSPSTR equ 09h ; Display String
|
||||
F_LINEIN equ 0Ah ; Bufferd Keyboard Input
|
||||
F_SELDRV equ 0Eh ; Select Disk
|
||||
F_CURDRV equ 19h ; Current Disk
|
||||
F_SETDTA equ 1Ah ; Set Disk Transfer Addr
|
||||
F_SETVCT equ 25h ; Set Vector
|
||||
F_GETDATE equ 2Ah ; Get Date
|
||||
F_GETDTA equ 2Fh ; Get Disk Transfer Addr
|
||||
F_VERSION equ 30h ; Get DOS Version Number
|
||||
F_KEEP equ 31h ; Keep Process
|
||||
F_GETDPB equ 32h ; Get DPB Addr
|
||||
F_CTRL_C equ 33h ; CONTROL-C Check
|
||||
F_GETVCT equ 35h ; Get Interrupt Vector
|
||||
F_GETDRV equ 36h ; Get Disk Free Space
|
||||
F_SWITCHAR equ 37h ; Set/Get switch char
|
||||
F_MKDIR equ 39h ; Create Sub-Directory
|
||||
F_RMDIR equ 3Ah ; Remove a Directory Entry
|
||||
F_CHDIR equ 3Bh ; Change Current Directory
|
||||
F_CREATE equ 3Ch ; Create a File
|
||||
F_OPEN equ 3Dh ; Open a File
|
||||
F_CLOSE equ 3Eh ; Close a File Handle
|
||||
F_READ equ 3Fh ; Read From File/Device
|
||||
F_WRITE equ 40h ; Write to File/Device
|
||||
F_DELETE equ 41h ; Delete a Directory Entry
|
||||
F_SEEK equ 42h ; Move a File Pointer
|
||||
F_ATTR equ 43h ; Change Attributes
|
||||
F_IOCTRL equ 44h ; I/O Control for Devices
|
||||
F_CURDIR equ 47h ; Get Current Drive Dir
|
||||
F_MALLOC equ 48h ; Allocate Memory
|
||||
F_FREE equ 49h ; Free Allocated Memory
|
||||
F_REALLOC equ 4Ah ; Modify Allocated Memory
|
||||
F_EXEC equ 4Bh ; Load/Execute a Program
|
||||
F_TERM equ 4Ch ; Terminate a Process
|
||||
F_GETCHILD equ 4Dh ; Get Child's Return Code
|
||||
F_FINDDIR equ 4Eh ; Find Match File
|
||||
F_NEXTDIR equ 4Fh ; Find Next Dir Entry
|
||||
F_SETPSP equ 50h ; Set PSP Address
|
||||
F_GETPSP equ 51h ; Get PSP Address
|
||||
F_PARMTBL equ 52h ;*Get System Parameter Address
|
||||
F_RENAME equ 56h ; Move a Dir Entry
|
||||
F_STAMP equ 57h ; Get/Set File Time & Date
|
||||
|
||||
;--- DOS error code ---
|
||||
|
||||
ENOFILE equ 2
|
||||
ENOPATH equ 3
|
||||
EMFILE equ 4
|
||||
EACCES equ 5
|
||||
ECONTR equ 7
|
||||
ENOMEM equ 8
|
||||
|
||||
;--- DOS file attribute ---
|
||||
|
||||
FA_RDONLY equ 00000001b
|
||||
FA_HIDDEN equ 00000010b
|
||||
FA_SYSTEM equ 00000100b
|
||||
FA_LABEL equ 00001000b
|
||||
FA_BINARY equ 00001000b
|
||||
FA_DIREC equ 00010000b
|
||||
FA_ARCH equ 00100000b
|
||||
FA_SEL equ 10000000b
|
||||
|
||||
;--- DOS open mode ---
|
||||
|
||||
O_READ equ 0
|
||||
O_WRITE equ 1
|
||||
O_UPDATE equ 2
|
||||
|
||||
;--- Macro definitions ---
|
||||
|
||||
IFDEF STDSEG
|
||||
cgroup group _TEXT,_DATA
|
||||
|
||||
_TEXT segment word public 'TEXT'
|
||||
_TEXT ends
|
||||
_DATA segment word public 'DATA'
|
||||
_DATA ends
|
||||
|
||||
cseg macro name
|
||||
_TEXT segment
|
||||
assume cs:cgroup, ds:cgroup
|
||||
endm
|
||||
|
||||
endcs macro
|
||||
_TEXT ends
|
||||
endm
|
||||
|
||||
dseg macro
|
||||
_DATA segment
|
||||
endm
|
||||
|
||||
endds macro
|
||||
_DATA ends
|
||||
endm
|
||||
ENDIF
|
||||
|
||||
tst macro reg
|
||||
or reg,reg
|
||||
endm
|
||||
|
||||
tstb macro label
|
||||
cmp byte ptr label,0
|
||||
endm
|
||||
|
||||
tstw macro label
|
||||
cmp word ptr label,0
|
||||
endm
|
||||
|
||||
clr macro reg
|
||||
xor reg,reg
|
||||
endm
|
||||
|
||||
stz macro
|
||||
xor al,al
|
||||
endm
|
||||
|
||||
clz macro
|
||||
or al,-1
|
||||
endm
|
||||
|
||||
outi macro port,imm
|
||||
mov al,imm
|
||||
out port,al
|
||||
endm
|
||||
|
||||
jmps macro label
|
||||
jmp short label
|
||||
endm
|
||||
|
||||
jmpl macro cc,label
|
||||
local next
|
||||
jn&cc next
|
||||
jmp label
|
||||
next:
|
||||
endm
|
||||
|
||||
jmpln macro cc,label
|
||||
local next
|
||||
j&cc next
|
||||
jmp label
|
||||
next:
|
||||
endm
|
||||
|
||||
jmpw macro
|
||||
local next
|
||||
jmps next
|
||||
next:
|
||||
endm
|
||||
|
||||
ldseg macro seg1,data
|
||||
mov ax,data
|
||||
mov seg1,ax
|
||||
endm
|
||||
|
||||
movseg macro seg1,seg2
|
||||
push seg2
|
||||
pop seg1
|
||||
endm
|
||||
|
||||
msdos macro cmd,prm
|
||||
ifb <prm>
|
||||
mov ah,cmd
|
||||
else
|
||||
movhl ax,cmd,prm
|
||||
endif
|
||||
int 21h
|
||||
endm
|
||||
|
||||
emm macro cmd,prm
|
||||
ifb <prm>
|
||||
mov ah,cmd
|
||||
else
|
||||
movhl ax,cmd,prm
|
||||
endif
|
||||
int INT_EMS
|
||||
endm
|
||||
|
||||
pushm macro regs
|
||||
irp reg,<regs>
|
||||
push reg
|
||||
endm
|
||||
endm
|
||||
|
||||
popm macro regs
|
||||
irp reg,<regs>
|
||||
pop reg
|
||||
endm
|
||||
endm
|
||||
|
||||
pushall macro regs
|
||||
IFDEF i186
|
||||
pusha
|
||||
ELSE
|
||||
pushm <ax,bx,cx,dx,si,di,bp>
|
||||
ENDIF
|
||||
ifnb <regs>
|
||||
pushm <regs>
|
||||
endif
|
||||
endm
|
||||
|
||||
popall macro regs
|
||||
ifnb <regs>
|
||||
popm <regs>
|
||||
endif
|
||||
IFDEF i186
|
||||
popa
|
||||
ELSE
|
||||
popm <bp,di,si,dx,cx,bx,ax>
|
||||
ENDIF
|
||||
endm
|
||||
|
||||
shiftm macro op,reg,imm
|
||||
IFDEF i186
|
||||
op reg,imm
|
||||
ELSE
|
||||
rept imm
|
||||
op reg,1
|
||||
endm
|
||||
ENDIF
|
||||
endm
|
||||
|
||||
shlm macro reg,imm
|
||||
shiftm shl,reg,imm
|
||||
endm
|
||||
|
||||
shrm macro reg,imm
|
||||
shiftm shr,reg,imm
|
||||
endm
|
||||
|
||||
sarm macro reg,imm
|
||||
shiftm sar,reg,imm
|
||||
endm
|
||||
|
||||
rolm macro reg,imm
|
||||
shiftm rol,reg,imm
|
||||
endm
|
||||
|
||||
rorm macro reg,imm
|
||||
shiftm ror,reg,imm
|
||||
endm
|
||||
|
||||
rclm macro reg,imm
|
||||
shiftm rcl,reg,imm
|
||||
endm
|
||||
|
||||
rcrm macro reg,imm
|
||||
shiftm rcr,reg,imm
|
||||
endm
|
||||
|
||||
echg macro reg
|
||||
ifidni <reg>, <ax>
|
||||
xchg ah, al
|
||||
endif
|
||||
ifidni <reg>, <bx>
|
||||
xchg bh, bl
|
||||
endif
|
||||
ifidni <reg>, <cx>
|
||||
xchg ch, cl
|
||||
endif
|
||||
ifidni <reg>, <dx>
|
||||
xchg dh, dl
|
||||
endif
|
||||
endm
|
||||
|
||||
movhl macro wreg,imm_h,imm_l
|
||||
mov wreg,((imm_h) shl 8)+((imm_l) and 0FFh)
|
||||
; xor wreg, wreg
|
||||
; or wreg, imm_h
|
||||
; echg wreg
|
||||
; or wreg, imm_l
|
||||
endm
|
||||
|
||||
bios macro cmd
|
||||
mov ah,cmd
|
||||
int 18h
|
||||
endm
|
||||
|
||||
eios macro cmd
|
||||
mov cl,cmd
|
||||
int 0DCh
|
||||
endm
|
||||
|
||||
bios_v macro cmd,prm
|
||||
ifb <prm>
|
||||
mov ah,cmd
|
||||
else
|
||||
movhl ax,cmd,prm
|
||||
endif
|
||||
int 10h
|
||||
endm
|
||||
|
||||
bios_k macro cmd,prm
|
||||
ifb <prm>
|
||||
mov ah,cmd
|
||||
else
|
||||
movhl ax,cmd,prm
|
||||
endif
|
||||
int 16h
|
||||
endm
|
||||
|
||||
peek macro sym
|
||||
IFDEF DEBUG
|
||||
public sym
|
||||
ENDIF
|
||||
endm
|
||||
|
||||
skip1 macro reg
|
||||
jmps $+3
|
||||
endm
|
||||
|
||||
skip2 macro reg
|
||||
jmps $+4
|
||||
endm
|
||||
|
||||
;--- Far pointer record ---
|
||||
|
||||
_farptr struc
|
||||
@off dw ?
|
||||
@seg dw ?
|
||||
_farptr ends
|
||||
|
||||
;----- wchar handle -----
|
||||
|
||||
IFDEF US
|
||||
ifkanji macro kjyes
|
||||
endm
|
||||
ELSE
|
||||
ifkanji macro kjyes
|
||||
local kjno
|
||||
cmp al,81h
|
||||
jb kjno
|
||||
cmp al,9Fh
|
||||
jbe kjyes
|
||||
cmp al,0E0h
|
||||
jb kjno
|
||||
cmp al,0FCh
|
||||
jbe kjyes
|
||||
kjno:
|
||||
endm
|
||||
ENDIF
|
||||
|
||||
mstojis macro
|
||||
IF 0
|
||||
cmp al, 80h
|
||||
adc al, 61h
|
||||
_ifn c
|
||||
sub al, 0A2h
|
||||
_endif
|
||||
rcl ah, 1
|
||||
add ax, 1F21h
|
||||
and ah, 7Fh
|
||||
ENDIF
|
||||
; 8140h...FCFCh
|
||||
and ah, 3fh
|
||||
shl ah, 1
|
||||
sub al, 9fh
|
||||
_ifn ae
|
||||
dec ah
|
||||
cmp al, 0e1h
|
||||
adc al, 5fh
|
||||
_endif
|
||||
sbb ax, 0dfdfh
|
||||
endm
|
||||
|
||||
;--- Block statement ---
|
||||
|
||||
IFDEF NEWBLOCK
|
||||
include block.inc
|
||||
ELSE
|
||||
|
||||
$base = 0
|
||||
$field = 1
|
||||
$add = 1
|
||||
$nest = 0
|
||||
|
||||
_if macro cc
|
||||
$begin
|
||||
$jcc n,cc,%$base,%$field
|
||||
endm
|
||||
|
||||
_ifn macro cc
|
||||
$begin
|
||||
$jcc <>,cc,%$base,%$field
|
||||
endm
|
||||
|
||||
_else macro
|
||||
$end
|
||||
$jmp %$base,%($field+1)
|
||||
$label %$base,%$field
|
||||
$field = $field+1
|
||||
endm
|
||||
|
||||
_endif macro
|
||||
$end
|
||||
$label %$base,%$field
|
||||
$end2
|
||||
endm
|
||||
|
||||
_repeat macro
|
||||
$begin
|
||||
$label %$base,%$field
|
||||
endm
|
||||
|
||||
_until macro cc
|
||||
$end
|
||||
$jcc n,cc,%$base,%$field
|
||||
$label %$base,%($field+1)
|
||||
$end2
|
||||
endm
|
||||
|
||||
_while macro cc
|
||||
$end
|
||||
$jcc <>,cc,%$base,%$field
|
||||
$label %$base,%($field+1)
|
||||
$end2
|
||||
endm
|
||||
|
||||
_loop macro
|
||||
$end
|
||||
$loop %$base,%$field
|
||||
$label %$base,%($field+1)
|
||||
$end2
|
||||
endm
|
||||
|
||||
_break macro cc
|
||||
$jcc <>,cc,%$base,%($field+1)
|
||||
endm
|
||||
|
||||
_cont macro cc
|
||||
$jcc <>,cc,%$base,%$field
|
||||
endm
|
||||
|
||||
$begin macro
|
||||
$field = $field shl 1
|
||||
$nest = $nest + 1
|
||||
endm
|
||||
|
||||
$end macro
|
||||
if ($nest le 1)
|
||||
$add = 1
|
||||
$base = $base mod 256
|
||||
else
|
||||
$add = 16 shl ($nest * 2)
|
||||
$base = $base mod ($add * 4)
|
||||
endif
|
||||
endm
|
||||
|
||||
$end2 macro
|
||||
$base = $base + $add
|
||||
$field = $field shr 1
|
||||
$nest = $nest - 1
|
||||
endm
|
||||
|
||||
$jmp macro l1,l2
|
||||
jmp short $L&l1&_&l2
|
||||
endm
|
||||
|
||||
$jcc macro n,cc,l1,l2
|
||||
ifnb <cc>
|
||||
j&n&cc $L&l1&_&l2
|
||||
else
|
||||
$jmp l1,l2
|
||||
endif
|
||||
endm
|
||||
|
||||
$loop macro l1,l2
|
||||
loop $L&l1&_&l2
|
||||
endm
|
||||
|
||||
$label macro l1,l2
|
||||
$L&l1&_&l2:
|
||||
endm
|
||||
|
||||
ENDIF
|
||||
|
||||
;****************************
|
||||
; End of 'std.inc'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
||||
.list
|
1322
SRC/string.asm
1322
SRC/string.asm
File diff suppressed because it is too large
Load Diff
514
SRC/swap.asm
514
SRC/swap.asm
@ -1,514 +0,0 @@
|
||||
;------------------------------------------------
|
||||
; swap.asm
|
||||
;
|
||||
; Copyright (c) 1989-93 by c.mos
|
||||
;------------------------------------------------
|
||||
|
||||
include vz.inc
|
||||
|
||||
IFNDEF NOSWAP
|
||||
|
||||
;----- Swap slot -----
|
||||
|
||||
_swapslot struc
|
||||
xs_handle dw 0
|
||||
xs_size dw 0
|
||||
_swapslot ends
|
||||
|
||||
;----- External symbols -----
|
||||
|
||||
wseg
|
||||
extrn doswapf :byte
|
||||
extrn invz :byte
|
||||
extrn swapmode :byte
|
||||
extrn usefar :byte
|
||||
extrn cmdlinef :byte
|
||||
|
||||
extrn code_seg :word
|
||||
extrn data_seg :word
|
||||
extrn gtops :word
|
||||
extrn loseg :word
|
||||
extrn nears :word
|
||||
extrn stack_seg :word
|
||||
extrn cz_val :word
|
||||
extrn swapss_end :word
|
||||
extrn syssw :word
|
||||
extrn ss_stack :word
|
||||
extrn save_ds :word
|
||||
extrn save_end :word
|
||||
|
||||
extrn tocs :dword
|
||||
endws
|
||||
|
||||
extrn cstop :near
|
||||
extrn cs_stack :near
|
||||
extrn parbuf :near
|
||||
|
||||
extrn allocTPA :near
|
||||
extrn clrstack :near
|
||||
extrn xmem_alloc :near
|
||||
extrn xmem_free :near
|
||||
extrn xmem_read :near
|
||||
extrn xmem_trunc :near
|
||||
extrn xmem_write :near
|
||||
extrn getsends :near
|
||||
extrn ofs2seg :near
|
||||
extrn seg2ofs :near
|
||||
extrn realloc_cs1 :near
|
||||
extrn code_end :near
|
||||
|
||||
wseg
|
||||
|
||||
;----- Local work -----
|
||||
|
||||
xslot_cs _swapslot <>
|
||||
xslot_ss _swapslot <>
|
||||
xslot_text _swapslot 16 dup (<>)
|
||||
textslots dw 0
|
||||
swapcsf db 0
|
||||
endws
|
||||
|
||||
eseg
|
||||
assume ds:cgroup,es:cgroup
|
||||
|
||||
;----- Swap out -----
|
||||
|
||||
public swapout
|
||||
swapout proc
|
||||
clr ax
|
||||
mov cs:invz,al
|
||||
mov swapcsf,al
|
||||
test syssw,SW_CLRSTACK
|
||||
_ifn z
|
||||
call clrstack
|
||||
_endif
|
||||
mov si,gtops
|
||||
tst si
|
||||
jz swapo_cs
|
||||
tstw textslots
|
||||
jnz free_gs
|
||||
tstb swapmode
|
||||
jz realloc_gs
|
||||
tstb doswapf
|
||||
jle realloc_gs
|
||||
call getsends
|
||||
mov di,ax
|
||||
push si
|
||||
call swapout_text
|
||||
pop si
|
||||
_if c
|
||||
realloc_gs:
|
||||
mov es,si
|
||||
mov bx,si
|
||||
call getsends
|
||||
xchg ax,bx
|
||||
sub bx,ax
|
||||
msdos F_REALLOC
|
||||
_else
|
||||
free_gs: mov es,si
|
||||
msdos F_FREE
|
||||
swapo_cs:
|
||||
mov al,swapmode
|
||||
tstb doswapf
|
||||
js swapo8
|
||||
_if z
|
||||
dec ax
|
||||
_endif
|
||||
cmp al,1
|
||||
jle swapo8
|
||||
call swapout_cs
|
||||
_ifn c
|
||||
call realloc_cs1
|
||||
_endif
|
||||
_endif
|
||||
swapo8:
|
||||
call xmem_trunc
|
||||
call stack_cs
|
||||
call allocTPA
|
||||
mov ax,loseg
|
||||
mov dx,cs
|
||||
cmp ax,dx
|
||||
_ifn e
|
||||
mov es,ax
|
||||
mov cs:save_ds,ax
|
||||
mov si,0120h
|
||||
mov di,si
|
||||
mov cx,offset cgroup:cstop
|
||||
sub cx,si
|
||||
call memcopy
|
||||
_endif
|
||||
VZ_RET
|
||||
swapout endp
|
||||
|
||||
;----- Swap out CS & SS -----
|
||||
;<--
|
||||
; CY :error
|
||||
; BX :end of loader seg.
|
||||
|
||||
public swapout_cs
|
||||
swapout_cs proc
|
||||
tstb usefar
|
||||
_ifn z
|
||||
stc
|
||||
VZ_RET
|
||||
_endif
|
||||
push es
|
||||
mov ax,offset cgroup:cstop
|
||||
call ofs2seg
|
||||
mov bx,cs
|
||||
add bx,ax
|
||||
push bx
|
||||
mov bx,offset cgroup:xslot_cs
|
||||
tstw [bx]
|
||||
_if z
|
||||
movseg es,cs
|
||||
mov di,offset cgroup:cstop
|
||||
mov ax,offset cgroup:code_end
|
||||
call swapout_blk
|
||||
_ifn c
|
||||
mov bx,offset cgroup:xslot_ss
|
||||
movseg es,ss
|
||||
clr di
|
||||
mov ax,swapss_end
|
||||
call swapout_blk
|
||||
_endif
|
||||
_else
|
||||
mov bx,offset cgroup:xslot_ss
|
||||
movseg es,ss
|
||||
clr di
|
||||
mov cx,save_end
|
||||
mov ax,[bx].xs_handle
|
||||
call xmem_write
|
||||
_endif
|
||||
_ifn c
|
||||
mov swapcsf,TRUE
|
||||
mov ax,cs
|
||||
cmp ax,loseg
|
||||
_ifn e
|
||||
pop bx
|
||||
push ax
|
||||
mov tocs.@seg,0 ;;
|
||||
_endif
|
||||
clc
|
||||
_endif
|
||||
pop bx
|
||||
pop es
|
||||
VZ_RET
|
||||
swapout_cs endp
|
||||
|
||||
;----- Swap out Text -----
|
||||
;-->
|
||||
; SI :top of seg.
|
||||
; DI :end of seg.
|
||||
;<--
|
||||
; CY :error
|
||||
|
||||
swapout_text proc
|
||||
mov bx,offset cgroup:xslot_text
|
||||
clr cx
|
||||
_repeat
|
||||
mov ax,di
|
||||
sub ax,si
|
||||
cmp ax,0800h
|
||||
_if a
|
||||
mov ax,0800h
|
||||
_endif
|
||||
pushm <ax,cx,si,di>
|
||||
call seg2ofs
|
||||
mov es,si
|
||||
clr di
|
||||
call swapout_blk
|
||||
popm <di,si,cx,ax>
|
||||
inc cx
|
||||
add bx,type _swapslot
|
||||
add si,ax
|
||||
cmp si,di
|
||||
_while b
|
||||
mov textslots,cx
|
||||
VZ_RET
|
||||
swapout_text endp
|
||||
|
||||
;----- Swap out block -----
|
||||
;-->
|
||||
; BX :swap slot ptr
|
||||
; ES:DI :start ptr
|
||||
; AX :end ptr
|
||||
;<--
|
||||
; CY :error
|
||||
|
||||
swapout_blk proc
|
||||
sub ax,di
|
||||
mov [bx].xs_size,ax
|
||||
mov cx,ax
|
||||
call xmem_alloc
|
||||
_ifn c
|
||||
mov [bx].xs_handle,ax
|
||||
call xmem_write
|
||||
_endif
|
||||
VZ_RET
|
||||
swapout_blk endp
|
||||
|
||||
endes
|
||||
|
||||
bseg
|
||||
|
||||
;----- Swap in block -----
|
||||
;-->
|
||||
; BX :swap slot ptr
|
||||
; ES:DI :start ptr
|
||||
; AX :end ptr
|
||||
;<--
|
||||
; CY :error
|
||||
|
||||
swapin_blk proc
|
||||
sub ax,di
|
||||
mov cx,ax
|
||||
mov ax,[bx].xs_handle
|
||||
call xmem_read
|
||||
VZ_RET
|
||||
swapin_blk endp
|
||||
|
||||
;----- Swap in CS & SS -----
|
||||
;<-- CY :Can't load CS
|
||||
|
||||
public swapin_es
|
||||
swapin_es proc
|
||||
tstb swapcsf
|
||||
jz swapin8
|
||||
mov bx,nears
|
||||
mov ax,cs
|
||||
mov es,ax
|
||||
sub bx,ax
|
||||
push bx
|
||||
msdos F_REALLOC
|
||||
pop bx
|
||||
_if c
|
||||
msdos F_MALLOC
|
||||
jc swapin9
|
||||
mov es,ax
|
||||
_endif
|
||||
mov bx,offset cgroup:xslot_cs
|
||||
mov di,offset cgroup:cstop
|
||||
mov ax,offset cgroup:code_end
|
||||
call swapin_blk
|
||||
jc swapin9
|
||||
mov cx,stack_seg
|
||||
sub cx,code_seg
|
||||
mov ax,es
|
||||
mov code_seg,ax
|
||||
mov tocs.@seg,ax
|
||||
mov dx,ax
|
||||
dec dx
|
||||
mov es,dx
|
||||
mov es:[mcb_psp],ax
|
||||
add ax,cx
|
||||
mov data_seg,ax
|
||||
mov stack_seg,ax
|
||||
mov cz_val,ax
|
||||
|
||||
mov bx,offset cgroup:xslot_ss
|
||||
mov es,ax
|
||||
clr di
|
||||
mov ax,swapss_end
|
||||
call swapin_blk
|
||||
jc swapin9
|
||||
mov swapcsf,FALSE
|
||||
swapin8:
|
||||
mov ax,code_seg
|
||||
mov dx,cs
|
||||
cmp ax,dx
|
||||
_ifn e
|
||||
mov es,ax
|
||||
clr si
|
||||
clr di
|
||||
mov cx,offset cgroup:cstop
|
||||
call memcopy
|
||||
_endif
|
||||
clc
|
||||
swapin9: VZ_RET
|
||||
swapin_es endp
|
||||
|
||||
endbs
|
||||
|
||||
eseg
|
||||
|
||||
;----- Close Swap file -----
|
||||
|
||||
public swapin_cs
|
||||
swapin_cs proc
|
||||
mov bx,offset cgroup:xslot_cs
|
||||
call swapclose
|
||||
mov bx,offset cgroup:xslot_ss
|
||||
call swapclose
|
||||
VZ_RET
|
||||
swapin_cs endp
|
||||
|
||||
;----- Swap in text -----
|
||||
|
||||
public swapin_text
|
||||
swapin_text proc
|
||||
tstw xslot_cs.xs_handle
|
||||
_ifn z
|
||||
call swapin_cs
|
||||
_endif
|
||||
mov bx,offset cgroup:xslot_text
|
||||
clr cx
|
||||
xchg cx,textslots
|
||||
mov es,gtops
|
||||
_repeat
|
||||
_break cxz
|
||||
tstw [bx].xs_handle
|
||||
_break z
|
||||
push cx
|
||||
push es
|
||||
clr di
|
||||
mov ax,[bx].xs_size
|
||||
push ax
|
||||
call swapin_blk
|
||||
call swapclose
|
||||
pop ax
|
||||
pop dx
|
||||
call ofs2seg
|
||||
add ax,dx
|
||||
mov es,ax
|
||||
pop cx
|
||||
add bx,type _swapslot
|
||||
_loop
|
||||
VZ_RET
|
||||
swapin_text endp
|
||||
|
||||
;--- Close Swap buffer ---
|
||||
|
||||
swapclose proc
|
||||
clr ax
|
||||
xchg ax,[bx].xs_handle
|
||||
call xmem_free
|
||||
VZ_RET
|
||||
swapclose endp
|
||||
|
||||
;--- Change Stack ---
|
||||
|
||||
public stack_cs, stack_ss
|
||||
stack_cs proc
|
||||
movseg es,cs
|
||||
call move_wseg
|
||||
|
||||
mov si,sp
|
||||
mov cx,ss_stack
|
||||
sub cx,si
|
||||
mov di,offset cgroup:cs_stack
|
||||
sub di,cx
|
||||
push di
|
||||
call memcopy
|
||||
pop di
|
||||
mov ax,cs
|
||||
jmps set_ss
|
||||
stack_cs endp
|
||||
|
||||
stack_ss proc
|
||||
movseg ds,cs
|
||||
mov es,stack_seg
|
||||
tstb invz
|
||||
_if z
|
||||
call move_wseg
|
||||
_endif
|
||||
mov invz,TRUE
|
||||
mov si,sp
|
||||
mov cx,offset cgroup:cs_stack
|
||||
sub cx,si
|
||||
mov di,ss_stack
|
||||
sub di,cx
|
||||
push di
|
||||
movseg ds,ss
|
||||
call memcopy
|
||||
pop di
|
||||
mov ax,es
|
||||
set_ss: mov ss,ax
|
||||
mov sp,di
|
||||
movseg ds,ss
|
||||
mov cs:save_ds,ds
|
||||
mov es,cs:loseg
|
||||
mov es:save_ds,ds
|
||||
VZ_RET
|
||||
stack_ss endp
|
||||
|
||||
move_wseg proc
|
||||
mov si,0100h
|
||||
mov di,si
|
||||
mov cx,offset cgroup:parbuf
|
||||
sub cx,si
|
||||
call memcopy
|
||||
VZ_RET
|
||||
move_wseg endp
|
||||
|
||||
endes
|
||||
|
||||
ELSE
|
||||
|
||||
eseg
|
||||
|
||||
;--- External symbols ---
|
||||
|
||||
extrn invz :byte
|
||||
extrn syssw :word
|
||||
extrn gtops :word
|
||||
|
||||
extrn allocTPA :near
|
||||
extrn clrstack :near
|
||||
extrn getsends :near
|
||||
|
||||
assume ds:cgroup
|
||||
|
||||
;--- Swap out ---
|
||||
|
||||
public swapout
|
||||
swapout proc
|
||||
clr ax
|
||||
mov cs:invz,al
|
||||
push es
|
||||
test syssw,SW_CLRSTACK
|
||||
_ifn z
|
||||
call clrstack
|
||||
_endif
|
||||
mov ax,gtops
|
||||
tst ax
|
||||
jz swapo8
|
||||
mov es,ax
|
||||
mov bx,ax
|
||||
call getsends
|
||||
xchg ax,bx
|
||||
sub bx,ax
|
||||
msdos F_REALLOC
|
||||
swapo8: call allocTPA
|
||||
pop es
|
||||
VZ_RET
|
||||
swapout endp
|
||||
|
||||
endes
|
||||
|
||||
ENDIF
|
||||
|
||||
bseg
|
||||
|
||||
;--- Memory copy ---
|
||||
|
||||
public memcopy
|
||||
memcopy proc
|
||||
shr cx,1
|
||||
cld
|
||||
rep movsw
|
||||
_if c
|
||||
movsb
|
||||
_endif
|
||||
VZ_RET
|
||||
memcopy endp
|
||||
|
||||
endbs
|
||||
|
||||
end
|
||||
|
||||
;****************************
|
||||
; End of 'swap.asm'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
||||
|
2117
SRC/text.asm
2117
SRC/text.asm
File diff suppressed because it is too large
Load Diff
1193
SRC/view.asm
1193
SRC/view.asm
File diff suppressed because it is too large
Load Diff
1353
SRC/vmap.asm
1353
SRC/vmap.asm
File diff suppressed because it is too large
Load Diff
907
SRC/vz.inc
907
SRC/vz.inc
@ -1,907 +0,0 @@
|
||||
.xlist
|
||||
;****************************
|
||||
; 'vz.inc'
|
||||
;****************************
|
||||
|
||||
;DEBUG equ TRUE
|
||||
;NOSWAP equ TRUE
|
||||
REXP equ TRUE ; VWX support by wing
|
||||
NEWEXPR equ TRUE ; new pointer handler by Sakakibara
|
||||
VZ_RET equ retn
|
||||
|
||||
|
||||
IFNDEF PC98
|
||||
IFNDEF J31
|
||||
IFNDEF IBMAX
|
||||
IFNDEF US
|
||||
;i186 equ TRUE
|
||||
ENDIF
|
||||
;NO2BYTEHAN equ TRUE
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
;IFDEF SLIM ; N/A from 1.6
|
||||
; IFNDEF J31
|
||||
; IFNDEF i186
|
||||
;i186 equ TRUE
|
||||
; ENDIF
|
||||
; ENDIF
|
||||
;ENDIF
|
||||
|
||||
;NEWBLOCK equ TRUE
|
||||
|
||||
include std.inc
|
||||
|
||||
.xlist
|
||||
|
||||
;****************************
|
||||
; Equations
|
||||
;****************************
|
||||
;
|
||||
;--- Assemble switches ---
|
||||
|
||||
IFDEF IBMV
|
||||
DOSV equ TRUE
|
||||
ENDIF
|
||||
IFDEF IBMJ
|
||||
DOSV equ TRUE
|
||||
ENDIF
|
||||
|
||||
IFNDEF PC98
|
||||
IFNDEF J31
|
||||
IFNDEF JBM
|
||||
IFNDEF IBM
|
||||
IBM equ TRUE
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IFNDEF PC98
|
||||
IFNDEF J31
|
||||
IFNDEF IBMJ
|
||||
IFNDEF JBM
|
||||
MSG_US equ TRUE
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IFNDEF PC98
|
||||
NO2BYTEHAN equ TRUE
|
||||
ENDIF
|
||||
|
||||
;--- Hardware ID ---
|
||||
|
||||
ID_PC98 equ 00h
|
||||
ID_PC98Hi equ 01h
|
||||
ID_J31 equ 10h
|
||||
ID_IBM equ 20h
|
||||
ID_EGA equ 21h
|
||||
ID_AX equ 02h
|
||||
ID_DOSV equ 04h
|
||||
ID_PS55 equ 28h
|
||||
IDN_PC98 equ 0F0h
|
||||
|
||||
;--- Command code ---
|
||||
|
||||
CM_MAC equ 02
|
||||
CM_ESC equ 03
|
||||
CM_CR equ 04
|
||||
CM_U equ 05
|
||||
CM_D equ 06
|
||||
CM_LEDIT equ 07
|
||||
CM_L equ 07
|
||||
CM_R equ 08
|
||||
CM_COMMON equ 09
|
||||
CM_WL equ 09
|
||||
CM_WR equ 10
|
||||
CM_TOUCH equ 14
|
||||
CM_TAB equ 21
|
||||
CM_CTRL equ 22
|
||||
CM_SCOPY equ 24
|
||||
CM_PUTLINE equ 29
|
||||
CM_SEDIT equ 30
|
||||
CM_FILER1 equ 43
|
||||
CM_SFTCR equ 53
|
||||
CM_CANCEL equ 54
|
||||
CM_CHGTEXT equ 63
|
||||
CM_OPENFILE equ 70
|
||||
CM_READFILE equ 71
|
||||
CM_NEWFILE equ 72
|
||||
CM_APPEND equ 76
|
||||
CM_RENAME equ 82
|
||||
CM_SEDITMAX equ 85
|
||||
CM_FILER equ 88
|
||||
CM_DOS equ 95
|
||||
CM_CONS equ 95
|
||||
CM_ALIAS equ 96
|
||||
CM_SPREAD equ 97
|
||||
CM_TOFILER equ 98
|
||||
CMCNT equ 100
|
||||
CM_FILER3 equ 101
|
||||
CM_FILER4 equ 122
|
||||
|
||||
;----- Event types -----
|
||||
|
||||
EV_ABORT equ 1
|
||||
EV_START equ 2
|
||||
EV_OPEN equ 3
|
||||
EV_CLOSE equ 4
|
||||
EV_EDIT equ 5
|
||||
EV_VIEW equ 6
|
||||
EV_TIMER equ 7
|
||||
EV_FILER equ 8
|
||||
EVENTCNT equ 8
|
||||
|
||||
;--- Messages ---
|
||||
|
||||
E_PATH equ 1
|
||||
E_READ equ 2
|
||||
E_WRITE equ 3
|
||||
E_TEMP equ 4
|
||||
E_NOLINE equ 5
|
||||
E_OPEN equ 6
|
||||
E_NODISK equ 7
|
||||
E_NOTEXT equ 8
|
||||
E_NOSTACK equ 9
|
||||
E_NOMEM equ 10
|
||||
E_NOBUFFER equ 11
|
||||
E_EXEC equ 12
|
||||
E_RECUST equ 13
|
||||
|
||||
M_QSAVE equ 14
|
||||
M_SAVING equ 15
|
||||
M_QSAVEM equ 16
|
||||
M_QCLRSTK equ 17
|
||||
M_QQUIT equ 18
|
||||
M_XFOUND equ 19
|
||||
M_QCHGALL equ 20
|
||||
M_QRPLONE equ 21
|
||||
M_RPLTOTAL equ 22
|
||||
M_MOVE equ 23
|
||||
M_COMPOK equ 24
|
||||
M_COMPNG equ 25
|
||||
M_XKAKO equ 26
|
||||
M_OPENED equ 27
|
||||
M_MARK equ 28
|
||||
M_RECUST equ 29
|
||||
M_EXIST equ 30
|
||||
M_PATHERR equ 31
|
||||
M_RDONLY equ 32
|
||||
M_NEW equ 33
|
||||
M_XSAVE equ 34
|
||||
M_XAPPEND equ 35
|
||||
M_NOTCHG equ 36
|
||||
M_ABANDON equ 37
|
||||
M_DELETE equ 38
|
||||
|
||||
;--- Text windows ---
|
||||
|
||||
W_READ equ 1
|
||||
W_WRITE equ 2
|
||||
W_NEW equ 3
|
||||
W_APPEND equ 4
|
||||
W_PATH equ 5
|
||||
W_FIND equ 6
|
||||
W_REPLACE equ 7
|
||||
W_COPY equ 8
|
||||
W_LINE equ 9
|
||||
W_RENAME equ 10
|
||||
W_FINDTTL equ 11
|
||||
W_RENFILE equ 12
|
||||
W_MKDIR equ 13
|
||||
W_DOSBOX equ 14
|
||||
W_CMDBOX equ 15
|
||||
W_DSTBOX equ 16
|
||||
|
||||
;--- System mode ---
|
||||
|
||||
SYS_SEDIT equ 0
|
||||
SYS_GETS equ 1
|
||||
SYS_DOS equ 2
|
||||
SYS_FILER equ 3
|
||||
SYS_GETC equ 4
|
||||
|
||||
;--- Parse path result ---
|
||||
|
||||
VZ_PRS_WILD equ 00000001b
|
||||
VZ_PRS_EXT equ 00000010b
|
||||
VZ_PRS_NAME equ 00000100b
|
||||
VZ_PRS_DIR equ 00001000b
|
||||
VZ_PRS_DRV equ 00010000b
|
||||
VZ_PRS_ROOT equ 00100000b
|
||||
VZ_PRS_ENDDIR equ 10000000b
|
||||
|
||||
;--- Char attribute ---
|
||||
|
||||
ATR_TXT equ 0
|
||||
ATR_CTR equ 1
|
||||
ATR_NUM equ 2
|
||||
ATR_BLK equ 3
|
||||
ATR_STT equ 4
|
||||
ATR_STT2 equ 5
|
||||
ATR_STTR equ 6
|
||||
ATR_MSG equ 7
|
||||
ATR_WFRM equ 8
|
||||
ATR_WTTL equ 9
|
||||
ATR_WTXT equ 10
|
||||
ATR_W1ST equ 11
|
||||
ATR_WSEL equ 12
|
||||
ATR_HELP equ 13
|
||||
ATR_KEY equ 14
|
||||
ATR_GRD equ 15
|
||||
ATR_BCSR equ 16
|
||||
ATR_FKEY equ 17
|
||||
ATR_DOS equ 18
|
||||
ATR_CTR2 equ 19
|
||||
ATR_PATH equ 20
|
||||
|
||||
;--- Graphic char type ---
|
||||
|
||||
GRC equ 0F0h
|
||||
GRC_H equ GRC+0
|
||||
GRC_V equ GRC+1
|
||||
GRC_TL equ GRC+2
|
||||
GRC_TR equ GRC+3
|
||||
GRC_BL equ GRC+4
|
||||
GRC_BR equ GRC+5
|
||||
GRC_VL equ GRC+6
|
||||
GRC_VR equ GRC+7
|
||||
GRC_TAB equ GRC+8
|
||||
GRC_CR equ GRC+9
|
||||
GRC_EOF equ GRC+10
|
||||
|
||||
;----- Control char attribute -----
|
||||
|
||||
CA_CTRL equ 00000001b
|
||||
CA_CR equ 00000010b
|
||||
CA_TAB equ 00000100b
|
||||
CA_EOF equ 00001000b
|
||||
CA_RMGN equ 00010000b
|
||||
CA_ZENSPC equ 00100000b
|
||||
CA_XZEN equ 01000000b
|
||||
|
||||
;--- Display switch ---
|
||||
|
||||
DSP_LINE equ 00000001b
|
||||
DSP_CR equ 00000010b
|
||||
DSP_TAB equ 00000100b
|
||||
DSP_EOF equ 00001000b
|
||||
DSP_RMGN equ 00010000b ; ##16
|
||||
DSP_ZENSPC equ 00100000b ; ##16
|
||||
DSP_NUM equ 01000000b
|
||||
DSP_SYS equ 10000000b
|
||||
DSP_BSLASH equ 0000000100000000b
|
||||
DSP_UNDER equ 0000001000000000b
|
||||
DSP_FULPATH equ 0000010000000000b
|
||||
DSP_PATHCASE equ 0000100000000000b
|
||||
DSP_IBMGRPH equ 0001000000000000b
|
||||
DSP_98JIS83 equ 0001000000000000b ; ##156.106
|
||||
DSP_DOSVFLICK equ 0001000000000000b ; ##156.131
|
||||
DSP_STLHEAD equ 0010000000000000b ; ##156.99
|
||||
DSP_SMOOTH equ 0100000000000000b ; ##16
|
||||
|
||||
;--- Edit switch ---
|
||||
|
||||
EDT_INDENT equ 00000001b
|
||||
EDT_SCROLL equ 00000010b
|
||||
EDT_EOF equ 00000100b
|
||||
EDT_BACKUP equ 00001000b
|
||||
EDT_UNTAB equ 00010000b
|
||||
EDT_PASTE equ 00100000b
|
||||
EDT_PGTTL equ 01000000b
|
||||
EDT_PGHALF equ 10000000b
|
||||
EDT_WRDSCH equ 0000000100000000b
|
||||
EDT_ICASE equ 0000001000000000b
|
||||
EDT_NOSTK equ 0000010000000000b
|
||||
EDT_LOGMOVE equ 0000100000000000b
|
||||
EDT_VIEW equ 0001000000000000b
|
||||
EDT_AUTOWD equ 0010000000000000b
|
||||
EDT_CUTSPC equ 0100000000000000b
|
||||
EDT_INDENTZEN equ 1000000000000000b ; ##153.33
|
||||
|
||||
;--- System switch ---
|
||||
|
||||
SW_CON equ 00000010b
|
||||
SW_SKIPESC equ 00000100b
|
||||
SW_REDRAW equ 00001000b
|
||||
SW_CLRSTACK equ 00010000b
|
||||
SW_CLMOVW equ 00100000b ; Eo ##16
|
||||
SW_YES equ 01000000b
|
||||
SW_REVYN equ 10000000b ; YN ##16
|
||||
SW_ASKNEW equ 0000000100000000b
|
||||
SW_QUIT equ 0000001000000000b
|
||||
SW_FP equ 0000010000000000b
|
||||
SW_BEEP equ 0000100000000000b
|
||||
SW_RO equ 0001000000000000b
|
||||
SW_INIOPT equ 0010000000000000b ; Sz ##16
|
||||
;SW_VIEWRET equ 0100000000000000b ; Sv ##16
|
||||
|
||||
;--- Extended switch ---
|
||||
|
||||
ESW_ESCKEY equ 00000001b
|
||||
ESW_EZKEY equ 00000010b ; ##153.30
|
||||
ESW_FPQUIT equ 00000100b ; ##156.109
|
||||
ESW_TRUSH equ 00001000b ; ux
|
||||
ESW_MAC equ 00010000b ; mx
|
||||
ESW_VWX equ 00100000b ; +
|
||||
ESW_IZENHAN equ 01000000b ; + VWX
|
||||
ESW_REXP equ 10000000b ; +
|
||||
ESW_FKEY equ 0000000100000000b
|
||||
ESW_DEFTTL equ 0000001000000000b
|
||||
|
||||
;--- Command flag ---
|
||||
|
||||
CMF_TCH equ 00000001b
|
||||
CMF_VMOVE equ 00000010b
|
||||
CMF_VPOS equ 00000100b
|
||||
CMF_REMAP equ 00001000b
|
||||
CMF_VAL equ 10000000b
|
||||
|
||||
;----- DOS Command exec switch -----
|
||||
|
||||
VZ_DOS_TBOX equ 0001b
|
||||
VZ_DOS_GO equ 0010b
|
||||
VZ_DOS_RETURN equ 0100b
|
||||
VZ_DOS_BOXTTL equ 1000b
|
||||
|
||||
;--- Macro extra char ---
|
||||
|
||||
MCHR_MENU equ 1
|
||||
MCHR_CMD equ 2
|
||||
MCHR_VAR equ 3
|
||||
MCHR_CALL equ 4
|
||||
MCHR_REM equ 5
|
||||
MCHR_LABEL equ 6
|
||||
MCHR_JUMP equ 7
|
||||
MCHR_IF equ 8
|
||||
MCHR_RET equ 9
|
||||
MCHR_END equ 10
|
||||
MCHR_CHR equ 11
|
||||
MCHR_STR equ 12
|
||||
|
||||
;--- Block mode ---
|
||||
|
||||
BLK_LINE equ 1
|
||||
BLK_CHAR equ 2
|
||||
BLK_RECT equ 4
|
||||
|
||||
;----- Paging mode -----
|
||||
|
||||
PG_SCRN equ 0
|
||||
PG_TTLSCH equ 1
|
||||
PG_STRSCH equ 2
|
||||
|
||||
;--- Cursor type ---
|
||||
|
||||
CSR_INS equ 0
|
||||
CSR_OVR equ 1
|
||||
CSR_SYS equ 4
|
||||
CSR_OFF equ -1
|
||||
|
||||
;--- Get string mode ---
|
||||
|
||||
GETS_INIT equ 0
|
||||
GETS_COPY equ 1
|
||||
GETS_DOS equ 4
|
||||
GETS_DOSC equ 5
|
||||
GETS_DOSBOX equ 8
|
||||
|
||||
;--- System menu ---
|
||||
|
||||
MNU_HELP equ 0
|
||||
MNU_MACRO equ 1
|
||||
MNU_ALIAS equ 2
|
||||
MNU_TEXT equ 3
|
||||
MNU_RPLMODE equ 4
|
||||
MNU_FMASK equ 5
|
||||
MNU_FSORT equ 6
|
||||
MNU_FCOMP equ 7
|
||||
MNU_FEXEC equ 8
|
||||
MNU_FQUICK equ 9
|
||||
MNU_MODULE equ 10
|
||||
MNU_VZPATH equ 11
|
||||
MNU_FATTR equ 12
|
||||
MNU_FFILE equ 13
|
||||
MENU_MODULE equ 97
|
||||
MENU_MDLMAC equ 98
|
||||
MENU_MACRO equ 99
|
||||
MENUMASK equ 11100000b
|
||||
|
||||
IFDEF NEWEXPR
|
||||
MENU_VAR equ 10000000b
|
||||
ENDIF
|
||||
|
||||
;--- Split mode ---
|
||||
|
||||
SPLIT_A equ 0
|
||||
SPLIT_H equ 2
|
||||
SPLIT_U equ SPLIT_H
|
||||
SPLIT_D equ SPLIT_H+1
|
||||
SPLIT_V equ 4
|
||||
SPLIT_L equ SPLIT_V
|
||||
SPLIT_R equ SPLIT_V+1
|
||||
|
||||
;--- FEP controle code ---
|
||||
|
||||
FEP_ON equ 0
|
||||
FEP_OFF equ 1
|
||||
FEP_ACT equ 2
|
||||
FEP_MASK equ 3
|
||||
|
||||
;--- Text modify mode ---
|
||||
|
||||
TCH_MOD equ 1
|
||||
TCH_RO equ -1
|
||||
TCH_VIEW equ 80h
|
||||
|
||||
;--- Large file mode --- ; ##16
|
||||
|
||||
FL_HEAD equ 00000001b
|
||||
FL_TAIL equ 00000010b
|
||||
FL_HEADX equ 00000100b
|
||||
FL_TAILX equ 00001000b
|
||||
FL_READEND equ 00010000b
|
||||
FL_RENAME equ 00100000b
|
||||
FL_LOG equ 01000000b
|
||||
FL_BINARY equ 10000000b
|
||||
|
||||
;----- Module macro -----
|
||||
|
||||
MDL_SLEEP equ 00000001b
|
||||
MDL_REMOVE equ 00000010b
|
||||
MDL_EXT equ 00000100b
|
||||
MDL_KEYMAC equ 10000000b
|
||||
MDL_HEADER equ 0FFh
|
||||
|
||||
;----- Profile option -----
|
||||
|
||||
PRO_WRITE equ 0000001b
|
||||
PRO_CREATE equ 0000010b
|
||||
PRO_CLOSE equ 0000100b
|
||||
PRO_AUTO equ 0001000b
|
||||
PRO_LOGCLOSE equ 0010000b
|
||||
PRO_CMDHIST equ 0100000b
|
||||
PRO_NOHIST equ 1000000b
|
||||
|
||||
;--- Miscellaneous ---
|
||||
|
||||
NULLCODE equ 0FFh
|
||||
WD equ 80
|
||||
HIGHT equ 25
|
||||
STRSZ equ 128
|
||||
TTLSTRSZ equ 64
|
||||
TMPSZ equ 256
|
||||
PATHSZ equ 64
|
||||
MASKSZ equ 32
|
||||
VZ_BACKSLASH equ 0FCh
|
||||
SYMCHR equ 27h
|
||||
MARKCNT equ 4
|
||||
ONEMS equ 0FFFh
|
||||
MIN_TBSIZE equ 0400h
|
||||
PACKSZ equ 13
|
||||
TEXTTOP equ 2
|
||||
TMPSLOTCNT equ 512
|
||||
BMPSIZE equ 128
|
||||
VZ_DOSLEN equ 128
|
||||
PAGEMAX equ BMPSIZE*8
|
||||
EMSMASK equ 0F0h
|
||||
EMSMASKW equ 0F000h
|
||||
TMAXMGN equ 0FFFDh
|
||||
|
||||
;****************************
|
||||
; Segment definitions
|
||||
;****************************
|
||||
|
||||
_work segment word public 'WORK'
|
||||
_work ends
|
||||
|
||||
_data segment word public 'DATA'
|
||||
_data ends
|
||||
|
||||
_base segment word public 'BASE'
|
||||
_base ends
|
||||
|
||||
_code segment byte public 'CODE'
|
||||
_code ends
|
||||
|
||||
_exec segment byte public 'EXEC'
|
||||
_exec ends
|
||||
|
||||
_hard segment byte public 'HARD'
|
||||
_hard ends
|
||||
|
||||
_init segment word public 'INIT'
|
||||
_init ends
|
||||
|
||||
_tail segment word public 'TAIL'
|
||||
_tail ends
|
||||
|
||||
cgroup group _work,_data,_base,_code,_exec,_hard,_init,_tail
|
||||
|
||||
wseg macro
|
||||
_work segment
|
||||
endm
|
||||
|
||||
endws macro
|
||||
_work ends
|
||||
endm
|
||||
|
||||
dseg macro
|
||||
_data segment
|
||||
endm
|
||||
|
||||
endds macro
|
||||
_data ends
|
||||
endm
|
||||
|
||||
bseg macro
|
||||
_base segment
|
||||
endm
|
||||
|
||||
endbs macro
|
||||
_base ends
|
||||
endm
|
||||
|
||||
cseg macro
|
||||
_code segment
|
||||
endm
|
||||
|
||||
endcs macro
|
||||
_code ends
|
||||
endm
|
||||
|
||||
eseg macro
|
||||
_exec segment
|
||||
endm
|
||||
|
||||
endes macro
|
||||
_exec ends
|
||||
endm
|
||||
|
||||
hseg macro
|
||||
_hard segment
|
||||
endm
|
||||
|
||||
endhs macro
|
||||
_hard ends
|
||||
endm
|
||||
|
||||
iseg macro
|
||||
_init segment
|
||||
endm
|
||||
|
||||
endis macro
|
||||
_init ends
|
||||
endm
|
||||
|
||||
;****************************
|
||||
; Macro definitions
|
||||
;****************************
|
||||
|
||||
GDATA macro sym,def,val1
|
||||
public sym
|
||||
sym def val1
|
||||
endm
|
||||
|
||||
tstl macro var
|
||||
mov ax,word ptr var
|
||||
or ax,word ptr var+2
|
||||
endm
|
||||
|
||||
clrl macro var
|
||||
mov word ptr var,0
|
||||
mov word ptr var+2,0
|
||||
endm
|
||||
|
||||
ldl macro var
|
||||
mov ax,word ptr var
|
||||
mov dx,word ptr var+2
|
||||
endm
|
||||
|
||||
stl macro var
|
||||
mov word ptr var,ax
|
||||
mov word ptr var+2,dx
|
||||
endm
|
||||
|
||||
addl macro var
|
||||
add ax,word ptr var
|
||||
adc dx,word ptr var+2
|
||||
endm
|
||||
|
||||
subl macro var
|
||||
sub ax,word ptr var
|
||||
sbb dx,word ptr var+2
|
||||
endm
|
||||
|
||||
cmpl macro var
|
||||
local cmpl1
|
||||
cmp dx,word ptr var+2
|
||||
jne cmpl1
|
||||
cmp ax,word ptr var
|
||||
cmpl1:
|
||||
endm
|
||||
|
||||
cmphl macro reg_h,reg_l
|
||||
local cmphl1
|
||||
cmp dx,reg_h
|
||||
jne cmphl1
|
||||
cmp ax,reg_l
|
||||
cmphl1:
|
||||
endm
|
||||
|
||||
addlw macro var,reg
|
||||
add word ptr var,reg
|
||||
adc word ptr var+2,0
|
||||
endm
|
||||
|
||||
sublw macro var,reg
|
||||
sub word ptr var,reg
|
||||
sbb word ptr var+2,0
|
||||
endm
|
||||
|
||||
IFDEF DEBUG
|
||||
IFDEF PC98
|
||||
beep macro
|
||||
pushf
|
||||
pushm <ax,cx>
|
||||
outi 37h,06h
|
||||
mov cx,1000h
|
||||
loop $
|
||||
outi 37h,07h
|
||||
popm <cx,ax>
|
||||
popf
|
||||
endm
|
||||
|
||||
beepon macro
|
||||
push ax
|
||||
outi 37h,6
|
||||
pop ax
|
||||
endm
|
||||
|
||||
beepoff macro
|
||||
push ax
|
||||
outi 37h,7
|
||||
pop ax
|
||||
endm
|
||||
ELSE
|
||||
beep macro
|
||||
push ax
|
||||
mov ax,0E07h
|
||||
int 10h
|
||||
pop ax
|
||||
endm
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
ofs macro label
|
||||
dw offset cgroup:label
|
||||
endm
|
||||
|
||||
;****************************
|
||||
; Structure definitions
|
||||
;****************************
|
||||
|
||||
;--- Memory control block ---
|
||||
|
||||
_mcb struc
|
||||
mcb_id db ?
|
||||
mcb_psp dw ?
|
||||
mcb_size dw ?
|
||||
_mcb ends
|
||||
|
||||
;--- Screen record ---
|
||||
|
||||
_point struc
|
||||
x db ?
|
||||
y db ?
|
||||
_point ends
|
||||
|
||||
_rect struc
|
||||
px db ?
|
||||
py db ?
|
||||
sx db ?
|
||||
sy db ?
|
||||
_rect ends
|
||||
|
||||
;--- Menu record ---
|
||||
|
||||
_menu struc
|
||||
mn_wd db ?
|
||||
mn_c db ?
|
||||
mn_valwd db ?
|
||||
mn_sel db ? ; if -1, no cursor
|
||||
mn_ext dw ? ; extern function ptr
|
||||
_menu ends
|
||||
|
||||
;--- Menu bar record ---
|
||||
|
||||
_mbar struc
|
||||
mb_px db ?
|
||||
mb_py db ?
|
||||
mb_sx db ?
|
||||
mb_c db ?
|
||||
mb_ttl dw ?
|
||||
_mbar ends
|
||||
|
||||
;--- Directoy record ---
|
||||
|
||||
_dir struc
|
||||
dr_attr db ?
|
||||
dr_time dw ?
|
||||
dr_date dw ?
|
||||
dr_size dd ?
|
||||
dr_pack db 13 dup(?)
|
||||
_dir ends
|
||||
|
||||
;--- DTA record ---
|
||||
|
||||
_dta struc
|
||||
db 15h dup(?)
|
||||
dta_attr db ?
|
||||
dta_time dw ?
|
||||
dta_date dw ?
|
||||
dta_size dd ?
|
||||
dta_pack db PACKSZ dup(?)
|
||||
_dta ends
|
||||
|
||||
;--- Filer window record ---
|
||||
|
||||
_filer struc
|
||||
fl_back dw ?
|
||||
fl_pooltop dw ?
|
||||
fl_seg dw ?
|
||||
fl_poolend dw ?
|
||||
fl_poolp dw ?
|
||||
fl_selcnt dw ?
|
||||
fl_bcsr dw ?
|
||||
fl_files dw ?
|
||||
fl_home dw ?
|
||||
fl_wpx db ?
|
||||
fl_wpy db ?
|
||||
fl_wsx db ?
|
||||
fl_wsy db ?
|
||||
fl_tsy dw ?
|
||||
fl_ttlsx db ?
|
||||
fl_which db ?
|
||||
fl_free dd ?
|
||||
fl_clust dw ?
|
||||
fl_overflow db ?
|
||||
fl_curf db ?
|
||||
fl_path db PATHSZ dup(?)
|
||||
fl_mask db MASKSZ dup(?)
|
||||
fl_lastpath db PATHSZ dup(?)
|
||||
_filer ends
|
||||
|
||||
;--- FEP descriptor ---
|
||||
|
||||
_fep struc
|
||||
fp_int db ? ; INT No.
|
||||
fp_idoff dw ? ; check offset
|
||||
fp_absoff db ? ; 0=vector rel, 1=absolute
|
||||
fp_id dw ? ; check word
|
||||
_fep ends
|
||||
|
||||
;----- Log file table -----
|
||||
|
||||
_logtbl struc
|
||||
lg_lnumb dw ?
|
||||
lg_nowp dd ?
|
||||
lg_eofp dd ?
|
||||
lg_lf db ?
|
||||
_logtbl ends
|
||||
|
||||
;----- Module Header -----
|
||||
|
||||
_mdlhead struc
|
||||
mh_num db 0FFh ; Dummy No.(=Menu #31)
|
||||
mh_size dw ? ; Header size
|
||||
mh_flag db ? ;
|
||||
mh_nextmdl dw ? ; Next module header ptr
|
||||
mh_namelen dw ? ; module name length
|
||||
_mdlhead ends
|
||||
|
||||
;--- Text record ---
|
||||
|
||||
_text struc
|
||||
w_next dw ? ; next record link ptr
|
||||
wnum db ? ; window number
|
||||
tchf db ? ; touch flag (0=nop,1=modified,-1=RO)
|
||||
wsplit db ? ; window split mode
|
||||
blkm db ? ; block mode (1=line,2=char)
|
||||
wy db ? ; y loc. in screen
|
||||
wnxt db ? ; next line y loc. in screen
|
||||
wys db ? ; wy keeper
|
||||
|
||||
nodnumb db ? ; disp number flag
|
||||
lnumb dw ? ; line number
|
||||
dnumb dw ? ; disp number
|
||||
lnumb0 dw ? ; line number offset
|
||||
dnumb0 dw ? ; disp number offset
|
||||
|
||||
ttops dw ? ; text area top seg
|
||||
tends dw ? ; text area end seg or EMS entry
|
||||
ttop dw ? ; text top ptr
|
||||
tend dw ? ; text end ptr
|
||||
tmax dw ? ; text buffer end ptr
|
||||
thom dw ? ; screen home ptr
|
||||
tbtm dw ? ; screen bottom ptr
|
||||
tnow dw ? ; current line ptr
|
||||
tnxt dw ? ; next line ptr
|
||||
|
||||
btop dw ? ; line buffer top ptr
|
||||
bend dw ? ; line end ptr
|
||||
tcp dw ? ; current ptr (common)
|
||||
tfld dw ? ; field start ptr (common)
|
||||
bmax dw ? ; line buffer end ptr
|
||||
bhom dw ? ; screen home ptr (in buffer)
|
||||
bbtm dw ? ; screen bottom ptr (in buffer)
|
||||
lbseg dw ? ; line buffer seg
|
||||
inbuf db ? ;
|
||||
tw_px db ? ;+ text window
|
||||
tw_py db ? ;+
|
||||
tw_sx db ? ;+
|
||||
tw_sy db ? ;+
|
||||
tw_cy db ? ;+
|
||||
fsiz db ? ; field size
|
||||
fskp db ? ; display skip x
|
||||
fofs db ? ; H-scroll offset x
|
||||
lxs db ? ; lx keeper
|
||||
lx db ? ; x loc. in field
|
||||
ly db ? ; y loc. in line
|
||||
tabr db ? ; Tab size
|
||||
exttyp db ? ; file ext type
|
||||
ctype db ? ; current char type
|
||||
ckanj db ? ; 1=kanji
|
||||
ccode dw ? ; current char code
|
||||
namep dw ? ; file name ptr
|
||||
|
||||
largf db ? ; large text flag
|
||||
temp db ? ; temporary file flag
|
||||
readp dd ? ; text read long ptr
|
||||
eofp dd ? ; EOF lptr
|
||||
headp dd ? ; head lptr
|
||||
headsz dw ? ; head size
|
||||
tailp dd ? ; tail lptr
|
||||
tailsz dw ? ; tail size
|
||||
textid dw ? ; text ID No.
|
||||
w1 dw ? ; work 1
|
||||
w2 dw ? ; work 2
|
||||
w3 dw ? ; work 3
|
||||
bofs dw ? ; block mark offset in line
|
||||
blkx db ? ; block mark x loc.
|
||||
fsiz0 db ? ; save of fsiz
|
||||
|
||||
tbmax dw ? ; size of text buffer ##1.5
|
||||
tbalt dw ? ; size of temp. block ##1.5
|
||||
|
||||
tblkp dd ? ; block lptr
|
||||
tnowp dd ? ; current lptr
|
||||
trgtp dd ? ; target lptr
|
||||
toldp dd ? ; old current lptr
|
||||
tretp dd ? ; return lptr
|
||||
tmark dd MARKCNT dup(?) ; mark lptr
|
||||
|
||||
path db PATHSZ dup (?) ; path name area
|
||||
tsstr dw ? ; title search string ptr
|
||||
blktgt dw ? ; block target flag
|
||||
inpcnt dw ? ; input counter
|
||||
ektbl dw ? ; event key table ptr
|
||||
extword dw ? ; file ext word
|
||||
labelp dw ? ; label name ptr
|
||||
lnumb9 dw ? ; last line number
|
||||
dspsw1 db ? ; alternate dspsw
|
||||
atrtxt1 db ?
|
||||
atrstt1 db ?
|
||||
atrpath1 db ?
|
||||
_text ends
|
||||
|
||||
;****************************
|
||||
; End of 'vz.inc'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
||||
|
||||
.list
|
||||
assume cs:cgroup, ss:cgroup
|
122
SRC/vzsel.asm
122
SRC/vzsel.asm
@ -1,122 +0,0 @@
|
||||
;****************************
|
||||
; 'vzsel.asm'
|
||||
;****************************
|
||||
|
||||
STDSEG equ TRUE
|
||||
|
||||
include std.inc
|
||||
|
||||
;--- Equations ---
|
||||
|
||||
ID_UNKNOWN equ 0
|
||||
ID_PC98 equ 1
|
||||
ID_J31 equ 2
|
||||
ID_IBM equ 3
|
||||
ID_IBM_MONO equ 4
|
||||
ID_AX equ 5
|
||||
ID_DOSV equ 6
|
||||
ID_PS55 equ 7
|
||||
ID_PS55_MONO equ 8
|
||||
|
||||
cseg
|
||||
; assume ds:code
|
||||
|
||||
;--- VZSEL Main ---
|
||||
|
||||
org 100h
|
||||
entry:
|
||||
IF 0
|
||||
mov dl,ID_PC98 ; PC-9801
|
||||
ldseg ds,0C000h
|
||||
clr bx
|
||||
mov ax,[bx]
|
||||
cmp ax,0AA55h
|
||||
_ifn e
|
||||
clr ax
|
||||
mov es,ax
|
||||
mov ax,es:[0DCh*4]
|
||||
cmp ax,es:[0DCh*4+4]
|
||||
jne exit
|
||||
_endif
|
||||
ENDIF
|
||||
mov al,-1
|
||||
bios_v 0Fh
|
||||
mov dl,ID_PC98 ; PC-9801
|
||||
cmp al,-1
|
||||
je exit
|
||||
|
||||
mov dl,ID_J31 ; J-3100
|
||||
cmp al,74h
|
||||
je exit
|
||||
cmp al,64h
|
||||
je exit
|
||||
|
||||
mov dl,ID_PS55_MONO ; PS/55
|
||||
cmp al,08h
|
||||
je exit
|
||||
mov dl,ID_PS55
|
||||
cmp al,0Eh
|
||||
je exit
|
||||
mov dl,ID_IBM_MONO
|
||||
cmp al,07h
|
||||
je exit
|
||||
|
||||
clr si
|
||||
msdos 63h,0
|
||||
mov dl,ID_IBM
|
||||
tst si
|
||||
jz exit
|
||||
tstw [si]
|
||||
jz exit
|
||||
|
||||
mov bx,0B800h ; DOS/V
|
||||
mov es,bx
|
||||
clr di
|
||||
bios_v 0FEh
|
||||
mov ax,es
|
||||
cmp ax,bx
|
||||
mov dl,ID_DOSV
|
||||
jne exit
|
||||
|
||||
bios_v 50h,1 ; AX
|
||||
mov dl,ID_AX
|
||||
tst al
|
||||
_if z
|
||||
cmp bx,51h
|
||||
je exit
|
||||
mov dl,ID_IBM
|
||||
cmp bx,01h ; AX/US
|
||||
je exit
|
||||
_endif
|
||||
_endif
|
||||
mov dl,ID_UNKNOWN
|
||||
exit: clr dh
|
||||
push dx
|
||||
shlm dx,3
|
||||
add dx,offset mg_hardware
|
||||
movseg ds,cs
|
||||
msdos F_DSPSTR
|
||||
mov dx,offset mg_crlf
|
||||
msdos F_DSPSTR
|
||||
pop ax
|
||||
msdos F_TERM
|
||||
|
||||
mg_hardware db "unknown$"
|
||||
db "PC-9801$"
|
||||
db "J-3100$ "
|
||||
db "IBM PC$ "
|
||||
db "IBM(BW)$"
|
||||
db "AX$ "
|
||||
db "DOS/V$ "
|
||||
db "PS/55$ "
|
||||
db "PS/55(BW)$"
|
||||
mg_crlf db 0Dh,0Ah,'$'
|
||||
|
||||
endcs
|
||||
end entry
|
||||
|
||||
;****************************
|
||||
; End of 'vzsel.asm'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
||||
|
743
SRC/wind.asm
743
SRC/wind.asm
@ -1,743 +0,0 @@
|
||||
;****************************
|
||||
; 'wind.asm'
|
||||
;****************************
|
||||
|
||||
include vz.inc
|
||||
|
||||
;--- Equations ---
|
||||
|
||||
H_MIN equ 3
|
||||
V_MIN equ 10
|
||||
|
||||
wform0 equ tw_px
|
||||
wform9 equ fsiz
|
||||
|
||||
;--- External symbols ---
|
||||
|
||||
wseg
|
||||
extrn hsplit :byte
|
||||
extrn vsplit :byte
|
||||
extrn wndc :byte
|
||||
extrn wsplit0 :byte
|
||||
|
||||
extrn conbufsz :word
|
||||
extrn textc :word
|
||||
extrn w_act :word
|
||||
extrn w_back :word
|
||||
extrn w_busy :word
|
||||
extrn w_free :word
|
||||
extrn w_act0 :word
|
||||
extrn w_back0 :word
|
||||
extrn windrec :word
|
||||
endws
|
||||
|
||||
extrn chgline :near
|
||||
extrn closeall :near
|
||||
extrn displabel :near
|
||||
extrn dispmsg :near
|
||||
extrn dispstat :near
|
||||
extrn doswindow :near
|
||||
extrn dspscr :near
|
||||
extrn getkey :near
|
||||
extrn newline :near
|
||||
extrn popupmenu :near
|
||||
extrn printf :near
|
||||
extrn resetscrnh :near
|
||||
extrn setdoswindow :near
|
||||
extrn schsysmenu :near
|
||||
extrn textsize :near
|
||||
extrn memclear :near
|
||||
|
||||
dseg
|
||||
|
||||
;--- Local work ---
|
||||
|
||||
dspc dw 0
|
||||
w_save dw 0
|
||||
endds
|
||||
|
||||
eseg
|
||||
assume ds:cgroup
|
||||
|
||||
public ld_wact
|
||||
ld_wact proc
|
||||
mov bp,ss:w_act
|
||||
tst bp
|
||||
VZ_RET
|
||||
ld_wact endp
|
||||
|
||||
endes
|
||||
|
||||
cseg
|
||||
|
||||
;--- Init text record ---
|
||||
;--> di :buffer top
|
||||
|
||||
public winit
|
||||
winit proc
|
||||
movseg es,ss
|
||||
call windcount
|
||||
push di
|
||||
_repeat
|
||||
mov bp,di
|
||||
push cx
|
||||
mov cx,type _text
|
||||
call memclear
|
||||
pop cx
|
||||
clr ax
|
||||
cmp cx,2
|
||||
_if a
|
||||
mov ax,di
|
||||
_endif
|
||||
mov [bp].w_next,ax
|
||||
_loop
|
||||
mov di,offset cgroup:w_free
|
||||
; movseg es,ss
|
||||
pop ax
|
||||
stosw ; w_free
|
||||
clr ax
|
||||
stosw ; w_act
|
||||
stosw ; w_back
|
||||
stosw ; w_busy
|
||||
mov ax,bp
|
||||
stosw ; w_ext
|
||||
VZ_RET
|
||||
winit endp
|
||||
|
||||
public windcount
|
||||
windcount proc
|
||||
mov cl,wndc
|
||||
clr ch
|
||||
tst cx
|
||||
_if z
|
||||
inc cx
|
||||
_endif
|
||||
tstw conbufsz
|
||||
_ifn z
|
||||
inc cx
|
||||
_endif
|
||||
inc cx ; ##16
|
||||
VZ_RET
|
||||
windcount endp
|
||||
|
||||
;--- Window open ---
|
||||
|
||||
public wndopn
|
||||
wndopn proc
|
||||
mov ax,[bp].w_next
|
||||
mov w_free,ax
|
||||
mov bx,bp
|
||||
clr ax
|
||||
call wlast
|
||||
_ifn c
|
||||
mov [bp].w_next,bx
|
||||
_else
|
||||
mov w_busy,bx
|
||||
_endif
|
||||
mov bp,bx
|
||||
mov [bp].w_next,0
|
||||
mov bx,w_act
|
||||
tst bx
|
||||
jz wopn1
|
||||
tstb [bx].wsplit
|
||||
_if z
|
||||
mov w_back,bx
|
||||
wopn1: call inifmt
|
||||
_else
|
||||
call cpyfmt
|
||||
_endif
|
||||
mov w_act,bp
|
||||
VZ_RET
|
||||
wndopn endp
|
||||
|
||||
;--- Window close ---
|
||||
|
||||
public wndcls
|
||||
wndcls proc
|
||||
call wndrmv
|
||||
mov ax,w_free
|
||||
mov bp,w_act
|
||||
mov [bp].w_next,ax
|
||||
mov w_free,bp
|
||||
wndcls1:
|
||||
mov bp,w_busy
|
||||
clr ax
|
||||
_repeat
|
||||
tst bp
|
||||
_break z
|
||||
tstb [bp].wnum
|
||||
jz wcls2
|
||||
cmp bp,w_back
|
||||
je wcls2
|
||||
mov ax,bp
|
||||
wcls2: mov bp,[bp].w_next
|
||||
_until
|
||||
mov bx,w_back
|
||||
tst bx
|
||||
_if z
|
||||
clr bp
|
||||
jmps wcls8
|
||||
_endif
|
||||
tst ax
|
||||
jz wcls4
|
||||
mov bp,w_act
|
||||
tstb [bp].wsplit
|
||||
_if z
|
||||
mov bp,ax
|
||||
call inifmt
|
||||
mov ax,bp
|
||||
wcls4: mov w_back,ax
|
||||
mov bp,bx
|
||||
call inifmt
|
||||
_else
|
||||
mov bx,bp
|
||||
mov bp,ax
|
||||
call cpyfmt
|
||||
_endif
|
||||
wcls8: mov w_act,bp
|
||||
VZ_RET
|
||||
wndcls endp
|
||||
|
||||
;--- Window change ---
|
||||
|
||||
public wndchg
|
||||
wndchg proc
|
||||
call wndrmv
|
||||
clr ax
|
||||
call wlast
|
||||
mov ax,w_act
|
||||
_ifn c
|
||||
mov [bp].w_next,ax
|
||||
_else
|
||||
mov w_busy,ax
|
||||
_endif
|
||||
mov bp,ax
|
||||
mov [bp].w_next,0
|
||||
VZ_RET
|
||||
wndrmv:
|
||||
mov ax,w_act
|
||||
mov bp,ax
|
||||
mov bx,[bp].w_next
|
||||
call wlast
|
||||
_ifn c
|
||||
mov [bp].w_next,bx
|
||||
VZ_RET
|
||||
_endif
|
||||
mov w_busy,bx
|
||||
VZ_RET
|
||||
wndchg endp
|
||||
|
||||
;--- Set window number ---
|
||||
|
||||
public setwnum
|
||||
setwnum proc
|
||||
push bp
|
||||
mov bp,w_busy
|
||||
clr ax
|
||||
tstw conbufsz
|
||||
jz snum1
|
||||
dec ax
|
||||
snum1:
|
||||
_repeat
|
||||
tst bp
|
||||
_break z
|
||||
inc ax
|
||||
mov [bp].wnum,al
|
||||
mov bp,[bp].w_next
|
||||
_until
|
||||
mov textc,ax
|
||||
pop bp
|
||||
VZ_RET
|
||||
setwnum endp
|
||||
|
||||
;--- Set w_record pointer ---
|
||||
;--> AX :target pointer
|
||||
;<-- CY :BP=AX
|
||||
|
||||
wlast proc
|
||||
mov bp,w_busy
|
||||
cmp bp,ax
|
||||
je wlast3
|
||||
_repeat
|
||||
cmp [bp].w_next,ax
|
||||
_break e
|
||||
mov bp,[bp].w_next
|
||||
_until
|
||||
clc
|
||||
VZ_RET
|
||||
wlast3: stc
|
||||
VZ_RET
|
||||
wlast endp
|
||||
|
||||
;--- Set window format ---
|
||||
|
||||
settextw proc
|
||||
mov word ptr [bp].tw_px,dx
|
||||
mov word ptr [bp].tw_sx,cx
|
||||
dec ch
|
||||
mov [bp].tw_cy,ch
|
||||
inc ch
|
||||
mov [bp].wsplit,al
|
||||
check_wy:
|
||||
mov al,[bp].tw_cy
|
||||
dec al
|
||||
cmp al,[bp].wy
|
||||
_if b
|
||||
mov [bp].wy,al
|
||||
_endif
|
||||
cmp al,[bp].wys ; ##154.67
|
||||
_if b
|
||||
mov [bp].wys,al
|
||||
_endif
|
||||
VZ_RET
|
||||
settextw endp
|
||||
|
||||
public inifmt
|
||||
inifmt proc
|
||||
call doswindow
|
||||
inc dh
|
||||
dec ch
|
||||
mov al,SPLIT_A
|
||||
call settextw
|
||||
mov [bp].fofs,0
|
||||
VZ_RET
|
||||
inifmt endp
|
||||
|
||||
cpyfmt proc
|
||||
pushm <ds,es>
|
||||
movseg ds,ss
|
||||
movseg es,ss
|
||||
mov al,[bx].wsplit
|
||||
mov [bp].wsplit,al
|
||||
lea si,[bx].wform0
|
||||
lea di,[bp].wform0
|
||||
mov cx,wform9-wform0
|
||||
rep movsb
|
||||
popm <es,ds>
|
||||
call check_wy
|
||||
VZ_RET
|
||||
cpyfmt endp
|
||||
|
||||
assume ds:nothing
|
||||
|
||||
;--- Change window ---
|
||||
|
||||
public se_chgwind
|
||||
se_chgwind proc
|
||||
mov ax,w_back
|
||||
tst ax
|
||||
_ifn z
|
||||
mov bp,ax
|
||||
xchg ax,w_act
|
||||
mov w_back,ax
|
||||
tstb [bp].wsplit
|
||||
_if z
|
||||
call dspscr
|
||||
; _else ; ##153.57
|
||||
; call maptexts
|
||||
_endif
|
||||
_endif
|
||||
clc
|
||||
VZ_RET
|
||||
se_chgwind endp
|
||||
|
||||
assume ds:cgroup
|
||||
|
||||
;--- Split mode ---
|
||||
|
||||
public se_splitmode,mc_splitmode
|
||||
se_splitmode proc
|
||||
mov al,-1
|
||||
mc_splitmode:
|
||||
movseg ds,ss
|
||||
mov bx,w_back
|
||||
tst bx
|
||||
_ifn z
|
||||
call splitmode
|
||||
call dspscr
|
||||
_endif
|
||||
clc
|
||||
VZ_RET
|
||||
splitmode:
|
||||
tst al
|
||||
jns splitwd1
|
||||
mov al,[bp].wsplit
|
||||
tst al
|
||||
jz yokowd
|
||||
cmp al,SPLIT_V
|
||||
jb tatewd
|
||||
fullwd:
|
||||
call inifmt
|
||||
tst bx
|
||||
_ifn z
|
||||
xchg bp,bx
|
||||
call inifmt
|
||||
_endif
|
||||
VZ_RET
|
||||
|
||||
splitwd:
|
||||
mov al,[bp].wsplit
|
||||
splitwd1:
|
||||
tst al
|
||||
jz fullwd
|
||||
cmp al,SPLIT_V
|
||||
jae tatewd
|
||||
yokowd:
|
||||
call doswindow
|
||||
inc dh
|
||||
mov ch,hsplit
|
||||
dec ch
|
||||
mov al,SPLIT_U
|
||||
call settextw
|
||||
xchg bp,bx
|
||||
call doswindow
|
||||
mov dh,hsplit
|
||||
inc dh
|
||||
sub ch,dh
|
||||
mov al,SPLIT_D
|
||||
call settextw
|
||||
VZ_RET
|
||||
tatewd:
|
||||
call doswindow
|
||||
add dh,2
|
||||
sub ch,2
|
||||
mov cl,vsplit
|
||||
mov al,SPLIT_L
|
||||
call settextw
|
||||
xchg bp,bx
|
||||
call doswindow
|
||||
add dh,2
|
||||
sub ch,2
|
||||
mov dl,vsplit
|
||||
inc dl
|
||||
sub cl,dl
|
||||
mov al,SPLIT_R
|
||||
call settextw
|
||||
VZ_RET
|
||||
se_splitmode endp
|
||||
|
||||
;--- Split position ---
|
||||
|
||||
public se_splitpos
|
||||
se_splitpos proc
|
||||
tstb [bp].wsplit
|
||||
jz wpos9
|
||||
mov dl,M_MOVE
|
||||
call dispmsg
|
||||
wpos1: mov al,CSR_OFF
|
||||
mov dl,SYS_GETC
|
||||
call getkey
|
||||
jz wpos1
|
||||
cmp al,CM_CR
|
||||
jnz wpos2
|
||||
call newline
|
||||
wpos9: clc
|
||||
VZ_RET
|
||||
wpos2:
|
||||
movseg ds,ss
|
||||
push ax
|
||||
call doswindow
|
||||
pop ax
|
||||
cmp [bp].wsplit,SPLIT_V
|
||||
jae wposv
|
||||
wposh: mov ah,ch
|
||||
sub ah,H_MIN
|
||||
mov cl,hsplit
|
||||
cmp al,CM_U
|
||||
_if e
|
||||
cmp cl,H_MIN
|
||||
je wpos1
|
||||
dec cx
|
||||
_else
|
||||
cmp al,CM_D
|
||||
jne wpos1
|
||||
cmp cl,ah
|
||||
je wpos1
|
||||
inc cx
|
||||
_endif
|
||||
clr ch
|
||||
mov word ptr hsplit,cx ; hsplit2 = 0
|
||||
mov bx,w_back
|
||||
push bp
|
||||
cmp [bp].wsplit,SPLIT_U
|
||||
_ifn e
|
||||
xchg bp,bx
|
||||
_endif
|
||||
call yokowd
|
||||
jmps wpos3
|
||||
wposv:
|
||||
mov ah,cl
|
||||
sub ah,V_MIN
|
||||
mov cl,vsplit
|
||||
cmp al,CM_R
|
||||
_if e
|
||||
cmp cl,ah
|
||||
je wpos1
|
||||
inc cx
|
||||
inc cx
|
||||
_else
|
||||
cmp al,CM_L
|
||||
jne wpos1
|
||||
cmp cl,V_MIN
|
||||
je wpos1
|
||||
dec cx
|
||||
dec cx
|
||||
_endif
|
||||
mov vsplit,cl
|
||||
mov bx,w_back
|
||||
push bp
|
||||
cmp [bp].wsplit,SPLIT_L
|
||||
_ifn e
|
||||
xchg bp,bx
|
||||
_endif
|
||||
call tatewd
|
||||
wpos3: call dspscr
|
||||
pop bp
|
||||
jmp wpos1
|
||||
se_splitpos endp
|
||||
|
||||
;--- Change 20/25 line ---
|
||||
|
||||
public se_xline,resetscr,resetwind
|
||||
se_xline proc
|
||||
call chgline
|
||||
resetscr:
|
||||
pushm <ds,es>
|
||||
call resetwind
|
||||
call dspscr
|
||||
popm <es,ds>
|
||||
clc
|
||||
VZ_RET
|
||||
resetwind:
|
||||
push bp
|
||||
movseg ds,ss
|
||||
call resetscrnh
|
||||
mov bx,w_back
|
||||
test [bp].wsplit,1 ; ##156.115
|
||||
_ifn z
|
||||
xchg bp,bx
|
||||
_endif
|
||||
call splitwd
|
||||
pop bp
|
||||
VZ_RET
|
||||
se_xline endp
|
||||
|
||||
;--- Change active text --- ; ##153.37
|
||||
|
||||
public se_chgtext,mc_chgtext,wndsel
|
||||
se_chgtext proc
|
||||
movseg ds,ss
|
||||
mov dl,MNU_TEXT
|
||||
call schsysmenu
|
||||
jc chgt9
|
||||
mov bx,si
|
||||
mov ax,textc
|
||||
mov [bx].mn_c,al
|
||||
mov [bx].mn_ext,offset cgroup:dumptext
|
||||
mov al,[bp].wnum
|
||||
tst al
|
||||
_ifn z
|
||||
dec al
|
||||
_endif
|
||||
mov [bx].mn_sel,al
|
||||
clr dx
|
||||
mov si,bx
|
||||
add si,type _menu
|
||||
call popupmenu
|
||||
_if c
|
||||
cmp al,CM_CHGTEXT
|
||||
jne chgt9
|
||||
mov al,[bp].wnum
|
||||
_endif
|
||||
chgtext:
|
||||
call seekbp
|
||||
chgt1: call wndsel
|
||||
call dspscr
|
||||
chgt9: VZ_RET
|
||||
|
||||
mc_chgtext:
|
||||
movseg ds,ss
|
||||
tst ax
|
||||
js seekid
|
||||
jz chgt_cons ; ##156.135
|
||||
dec ax
|
||||
jmp chgtext
|
||||
seekid:
|
||||
neg ax
|
||||
mov bp,w_busy
|
||||
_repeat
|
||||
tst bp
|
||||
_break z
|
||||
cmp ax,[bp].textid
|
||||
je chgt1
|
||||
mov bp,[bp].w_next
|
||||
_until
|
||||
stc
|
||||
VZ_RET
|
||||
|
||||
wndsel:
|
||||
mov bx,w_act
|
||||
cmp bp,w_back
|
||||
je chgt7
|
||||
cmp bp,bx
|
||||
je chgt9
|
||||
mov w_act,bp
|
||||
tst bx
|
||||
jz chgt9
|
||||
jmp cpyfmt
|
||||
chgt7:
|
||||
mov w_act,bp
|
||||
mov w_back,bx
|
||||
test [bx].wsplit,1
|
||||
_ifn z
|
||||
xchg bp,bx
|
||||
_endif
|
||||
jmp splitwd
|
||||
se_chgtext endp
|
||||
|
||||
;--- Open/close console window ---
|
||||
|
||||
public se_console
|
||||
se_console proc
|
||||
movseg ds,ss
|
||||
tstb [bp].wnum
|
||||
jnz chgt_cons
|
||||
mov bx,[bp].w_next ; ##152.19
|
||||
tst bx
|
||||
jmpl z,closeall
|
||||
mov ax,w_save
|
||||
tst ax
|
||||
_if z
|
||||
mov ax,w_back
|
||||
_endif
|
||||
_repeat
|
||||
cmp bx,ax
|
||||
je wcons2 ; ##153.28
|
||||
mov bx,[bx].w_next
|
||||
tst bx
|
||||
_until z
|
||||
mov bx,w_back
|
||||
wcons2:
|
||||
mov bp,bx
|
||||
cmp bp,w_back
|
||||
jne chgcon1
|
||||
call wndcls1
|
||||
call dspscr
|
||||
VZ_RET
|
||||
se_console endp
|
||||
|
||||
public chgt_cons
|
||||
chgt_cons proc
|
||||
mov bp,w_busy
|
||||
tstb [bp].wnum
|
||||
jnz chgcon_x
|
||||
mov ax,w_act
|
||||
cmp ax,bp
|
||||
je chgcon1
|
||||
mov w_save,ax
|
||||
tstw w_back
|
||||
jnz chgcon1
|
||||
mov w_back,ax
|
||||
chgcon1:call wndsel
|
||||
call dspscr
|
||||
VZ_RET
|
||||
chgcon_x:
|
||||
stc
|
||||
VZ_RET
|
||||
chgt_cons endp
|
||||
|
||||
;--- Dump text name ---
|
||||
;--> CX :cursor
|
||||
|
||||
pf_size db "%8ld",0
|
||||
|
||||
public sel_number
|
||||
dumptext proc
|
||||
tst ah
|
||||
_ifn z
|
||||
sel_number:
|
||||
cmp al,'0'
|
||||
jbe seltx_x
|
||||
cmp al,'9'
|
||||
jbe seltx1
|
||||
cmp al,'A'
|
||||
jb seltx_x
|
||||
sub al,'A'-'1'-9
|
||||
seltx1: sub al,'1'
|
||||
clc
|
||||
VZ_RET
|
||||
seltx_x:stc
|
||||
VZ_RET
|
||||
_endif
|
||||
push bp
|
||||
call seekbp
|
||||
call displabel
|
||||
call textsize
|
||||
pushm <dx,ax>
|
||||
mov bx,sp
|
||||
mov si,offset cgroup:pf_size
|
||||
call printf
|
||||
popm <ax,ax>
|
||||
pop bp
|
||||
VZ_RET
|
||||
dumptext endp
|
||||
|
||||
seekbp proc
|
||||
skbp1: mov bp,w_busy
|
||||
tstb [bp].wnum
|
||||
_if z
|
||||
mov bp,[bp].w_next
|
||||
_endif
|
||||
_repeat
|
||||
tst al
|
||||
_break z
|
||||
mov bp,[bp].w_next
|
||||
dec al
|
||||
tst bp
|
||||
jz skbp1
|
||||
_until
|
||||
VZ_RET
|
||||
seekbp endp
|
||||
|
||||
;----- Reset active/back window -----
|
||||
|
||||
public wnd_reset
|
||||
wnd_reset proc
|
||||
pushm <bx,bp,ds>
|
||||
movseg ds,ss
|
||||
mov bp,w_act0
|
||||
tst bp
|
||||
_ifn z
|
||||
mov bx,w_back0
|
||||
tst bx
|
||||
_ifn z
|
||||
mov w_act,bp
|
||||
mov w_back,bx
|
||||
mov al,wsplit0
|
||||
tst al
|
||||
_ifn z
|
||||
test al,1
|
||||
_ifn z
|
||||
xchg bx,bp
|
||||
_endif
|
||||
cmp al,SPLIT_V
|
||||
_if b
|
||||
call yokowd
|
||||
_else
|
||||
call tatewd
|
||||
_endif
|
||||
_endif
|
||||
call dspscr
|
||||
_endif
|
||||
_endif
|
||||
popm <ds,bp,bx>
|
||||
VZ_RET
|
||||
wnd_reset endp
|
||||
|
||||
endcs
|
||||
end
|
||||
|
||||
;****************************
|
||||
; End of 'wind.asm'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
503
SRC/xscr.asm
503
SRC/xscr.asm
@ -1,503 +0,0 @@
|
||||
;****************************
|
||||
; 'xscr.asm'
|
||||
;****************************
|
||||
|
||||
include vz.inc
|
||||
|
||||
IFNDEF NOXSCR
|
||||
|
||||
;--- Equations ---
|
||||
|
||||
grafflag equ 0600h+008Ah
|
||||
TEXTTOP equ 2
|
||||
CONTMPEND equ 0100h
|
||||
MAXLINELEN equ 512
|
||||
|
||||
;--- External symbols ---
|
||||
|
||||
wseg
|
||||
extrn cmdln :byte
|
||||
extrn hardware :byte
|
||||
extrn silent :byte
|
||||
extrn invz :byte
|
||||
|
||||
extrn conbufsz :word
|
||||
extrn conseg :word
|
||||
extrn dspsw :word
|
||||
extrn loseg :word
|
||||
extrn nm_confile :word
|
||||
extrn ntab :word
|
||||
extrn syssw :word
|
||||
extrn w_act :word
|
||||
extrn w_busy :word
|
||||
extrn w_free :word
|
||||
extrn save_ds :word
|
||||
endws
|
||||
|
||||
extrn addeof1 :near
|
||||
extrn ems_map :near
|
||||
extrn ems_restore :near
|
||||
extrn ems_save :near
|
||||
extrn iniopn2 :near
|
||||
extrn iniscr :near
|
||||
extrn initlnumb :near
|
||||
extrn isalpha :near
|
||||
extrn istop :near
|
||||
extrn memcopy :near
|
||||
extrn ofs2seg :near
|
||||
extrn prefld :near
|
||||
extrn ptradj2 :near
|
||||
; extrn resetgbank :near
|
||||
extrn resetint :near
|
||||
extrn setabsp :near
|
||||
; extrn setgbank :near
|
||||
extrn setint :near
|
||||
extrn setnum :near
|
||||
extrn sgmove2 :near
|
||||
extrn strcpy :near
|
||||
extrn toplin :near
|
||||
extrn txtmov :near
|
||||
extrn wndopn :near
|
||||
extrn allocfar :near
|
||||
|
||||
;--- Local work ---
|
||||
|
||||
wseg
|
||||
prechar db 0
|
||||
GDATA skipescf, db, 0
|
||||
putp dw 0
|
||||
puttop dw 0
|
||||
conend dw 0
|
||||
conmax dw 0
|
||||
concp dw 0
|
||||
conwy db 0
|
||||
xpause db 0
|
||||
tretp0 dd 0
|
||||
endws
|
||||
|
||||
bseg
|
||||
vct29 dd 0
|
||||
conshift dw 0
|
||||
endbs
|
||||
|
||||
iseg
|
||||
assume ds:cgroup
|
||||
|
||||
dummy label byte
|
||||
|
||||
;--- Init console file ---
|
||||
|
||||
public initcon
|
||||
initcon proc
|
||||
mov conend,TEXTTOP
|
||||
mov ax,conbufsz
|
||||
tst ax
|
||||
_ifn z
|
||||
and ax,not 1
|
||||
mov conmax,ax
|
||||
call allocfar
|
||||
mov conseg,ax
|
||||
mov si,offset cgroup:cmdln
|
||||
lods cs:dummy
|
||||
cbw
|
||||
add si,ax
|
||||
inc si
|
||||
mov puttop,si
|
||||
mov putp,si
|
||||
_endif
|
||||
VZ_RET
|
||||
initcon endp
|
||||
|
||||
endis
|
||||
|
||||
cseg
|
||||
|
||||
;--- Open console file ---
|
||||
|
||||
public opencon
|
||||
opencon proc
|
||||
tstw conbufsz
|
||||
_ifn z
|
||||
mov bp,w_free
|
||||
call wndopn
|
||||
mov w_act,NULL
|
||||
lea di,[bp].path
|
||||
mov [bp].namep,di
|
||||
mov [bp].labelp,di
|
||||
mov si,offset cgroup:nm_confile
|
||||
; movseg es,ss
|
||||
call strcpy
|
||||
; movseg es,cs
|
||||
mov [bp].tchf,TCH_RO
|
||||
call initlnumb
|
||||
mov al,byte ptr ntab
|
||||
mov [bp].tabr,al
|
||||
mov ax,conseg
|
||||
mov [bp].tends,ax
|
||||
mov dx,ax
|
||||
call ems_map
|
||||
mov ds,ax
|
||||
mov [bp].ttops,ax
|
||||
mov ax,ss:conmax
|
||||
call iniopn2
|
||||
call iniscr
|
||||
ldl ss:tretp0
|
||||
stl [bp].tretp
|
||||
mov si,ss:conend
|
||||
tst si
|
||||
_ifn z
|
||||
call addeof1
|
||||
_endif
|
||||
movseg ds,ss
|
||||
_endif
|
||||
VZ_RET
|
||||
opencon endp
|
||||
|
||||
;--- Pre/Post DOS ---
|
||||
|
||||
preconfile proc
|
||||
tstw conend
|
||||
_if z
|
||||
push bp
|
||||
mov bp,w_busy
|
||||
mov ax,[bp].tcp
|
||||
mov concp,ax
|
||||
mov al,[bp].wy
|
||||
mov conwy,al
|
||||
mov ax,[bp].tend
|
||||
dec ax
|
||||
mov conend,ax
|
||||
call setabsp
|
||||
stl [bp].tretp
|
||||
stl tretp0
|
||||
clr ax
|
||||
mov cs:conshift,ax
|
||||
mov xpause,al ; ##152.17
|
||||
pop bp
|
||||
_endif
|
||||
VZ_RET
|
||||
preconfile endp
|
||||
|
||||
public postconfile
|
||||
postconfile proc
|
||||
tstw conbufsz
|
||||
_ifn z
|
||||
test syssw,SW_CON
|
||||
_ifn z
|
||||
tstw conend
|
||||
jnz pstcon1
|
||||
_endif
|
||||
_endif
|
||||
VZ_RET
|
||||
pstcon1:
|
||||
mov di,putp
|
||||
call flushcontmp
|
||||
mov putp,di
|
||||
pushm <bp,ds>
|
||||
mov ds,loseg
|
||||
mov putp,di
|
||||
movseg ds,ss
|
||||
mov bp,w_busy
|
||||
clr di
|
||||
xchg di,conend
|
||||
mov ax,conseg
|
||||
call ems_map
|
||||
mov ds,ax
|
||||
mov si,[bp].ttop
|
||||
mov ax,CRLF
|
||||
cmp [si-2],ax
|
||||
_ifn e
|
||||
mov [si-2],ax
|
||||
; mov cs:conshift,-1
|
||||
mov di,si
|
||||
_endif
|
||||
mov byte ptr [di],LF
|
||||
inc di
|
||||
mov [bp].tend,di
|
||||
mov al,ss:conwy
|
||||
mov si,ss:concp
|
||||
tst si
|
||||
_if z
|
||||
mov si,di
|
||||
dec si
|
||||
mov cl,[bp].tw_sy
|
||||
clr ch
|
||||
_repeat
|
||||
call istop
|
||||
_break e
|
||||
push cx
|
||||
call prefld
|
||||
pop cx
|
||||
_loop
|
||||
clr al
|
||||
_endif
|
||||
mov [bp].wy,al
|
||||
mov [bp].wys,al
|
||||
mov [bp].tcp,si
|
||||
call toplin
|
||||
mov [bp].tnow,si
|
||||
mov [bp].bhom,si
|
||||
push si
|
||||
mov ax,di
|
||||
mov si,cs:conshift
|
||||
mov di,TEXTTOP
|
||||
tst si
|
||||
_ifn z
|
||||
cmp si,-1
|
||||
_if e
|
||||
mov si,ax
|
||||
_else
|
||||
add si,di
|
||||
_endif
|
||||
call ptradj2
|
||||
_endif
|
||||
mov ax,[bp].ttop
|
||||
pop cx
|
||||
call setnum
|
||||
inc dx
|
||||
mov [bp].lnumb,dx
|
||||
popm <ds,bp>
|
||||
VZ_RET
|
||||
postconfile endp
|
||||
|
||||
endcs
|
||||
|
||||
bseg
|
||||
|
||||
;--- INT29h handler ---
|
||||
|
||||
int29in proc
|
||||
cld
|
||||
sti
|
||||
push ds
|
||||
pushm <ax,di,es>
|
||||
mov ds,cs:save_ds
|
||||
movseg es,cs
|
||||
call putcontmp
|
||||
popm <es,di,ax>
|
||||
test silent,2
|
||||
jnz xscr9
|
||||
cli
|
||||
cmp al,'\'
|
||||
je slash1
|
||||
xscr8:
|
||||
mov prechar,al
|
||||
pop ds
|
||||
jmp cs:vct29
|
||||
|
||||
slash1:
|
||||
test dspsw,DSP_BSLASH
|
||||
jz xscr8
|
||||
test hardware,IDN_PC98
|
||||
jnz xscr8
|
||||
tstb prechar
|
||||
js xscr8
|
||||
tstb skipescf
|
||||
jnz xscr8
|
||||
mov prechar,al
|
||||
pushm <ax,es>
|
||||
clr ax
|
||||
mov es,ax
|
||||
mov byte ptr es:[grafflag],0
|
||||
mov al,VZ_BACKSLASH
|
||||
pushf
|
||||
call cs:vct29
|
||||
mov byte ptr es:[grafflag],1
|
||||
popm <es,ax>
|
||||
xscr9: pop ds
|
||||
iret
|
||||
int29in endp
|
||||
|
||||
;--- Put char to console tmp buffer ---
|
||||
;--> AL :output char
|
||||
|
||||
putcontmp proc
|
||||
tstb skipescf
|
||||
_ifn z
|
||||
cmp prechar,ESCP ; ##152.17
|
||||
_if e
|
||||
cmp al,'0'
|
||||
je pausectrl
|
||||
cmp al,'1'
|
||||
je pausectrl
|
||||
_endif
|
||||
call isalpha
|
||||
jc skipesc9
|
||||
VZ_RET
|
||||
pausectrl:
|
||||
xor al,'1'
|
||||
mov xpause,al
|
||||
skipesc9:
|
||||
mov skipescf,FALSE
|
||||
VZ_RET
|
||||
_endif
|
||||
cmp al,ESCP
|
||||
jne puttmp2
|
||||
test syssw,SW_SKIPESC
|
||||
jz puttmp2
|
||||
mov skipescf,TRUE
|
||||
VZ_RET
|
||||
puttmp2:
|
||||
tst al
|
||||
jz puttmp9
|
||||
cmp al,CR
|
||||
je puttmp9
|
||||
tstb xpause
|
||||
jnz puttmp9
|
||||
|
||||
mov di,putp
|
||||
cmp al,BS
|
||||
_if e
|
||||
cmp di,puttop
|
||||
je puttmp9
|
||||
dec di
|
||||
jmps puttmp8
|
||||
_endif
|
||||
cmp al,LF
|
||||
_if e
|
||||
mov ax,CRLF
|
||||
stosw
|
||||
_else
|
||||
cmp prechar,CR
|
||||
_if e
|
||||
mov di,puttop
|
||||
_endif
|
||||
stosb
|
||||
cmp di,CONTMPEND
|
||||
jb puttmp8
|
||||
_endif
|
||||
pushm <bx,cx,dx,si>
|
||||
tstb cs:invz
|
||||
_ifn z
|
||||
cmp di,CONTMPEND
|
||||
jb puttmp7
|
||||
_else
|
||||
call ems_save
|
||||
call flushcontmp
|
||||
call ems_restore
|
||||
_endif
|
||||
mov di,puttop
|
||||
puttmp7:popm <si,dx,cx,bx>
|
||||
puttmp8:mov putp,di
|
||||
puttmp9:VZ_RET
|
||||
putcontmp endp
|
||||
|
||||
;--- Flush console tmp buffer ---
|
||||
;<--> DI :putp
|
||||
|
||||
flushcontmp proc
|
||||
push es
|
||||
push di
|
||||
mov ax,conseg
|
||||
call ems_map
|
||||
mov es,ax
|
||||
mov cx,di
|
||||
sub cx,puttop
|
||||
jz flcon9
|
||||
mov concp,0
|
||||
mov di,conend
|
||||
mov ax,conmax
|
||||
sub ax,di
|
||||
cmp ax,cx
|
||||
_if be
|
||||
push ds
|
||||
movseg ds,es
|
||||
push di
|
||||
shr di,1
|
||||
shr di,1
|
||||
mov cx,MAXLINELEN
|
||||
mov al,LF
|
||||
repne scasb
|
||||
mov si,di
|
||||
mov di,TEXTTOP
|
||||
mov ax,si
|
||||
sub ax,di
|
||||
add ax,cs:conshift
|
||||
_if c
|
||||
mov ax,-1
|
||||
_endif
|
||||
mov cs:conshift,ax
|
||||
pop cx
|
||||
sub cx,si
|
||||
call memcopy
|
||||
pop ds
|
||||
_endif
|
||||
pop cx
|
||||
mov si,puttop
|
||||
push si
|
||||
sub cx,si
|
||||
_ifn cxz
|
||||
push ds
|
||||
movseg ds,cs
|
||||
rep movsb
|
||||
pop ds
|
||||
mov conend,di
|
||||
_endif
|
||||
flcon9: pop di
|
||||
pop es
|
||||
VZ_RET
|
||||
flushcontmp endp
|
||||
|
||||
endbs
|
||||
|
||||
eseg
|
||||
|
||||
;--- Copy ptrs to loader ---
|
||||
|
||||
public copyxptrs
|
||||
copyxptrs proc
|
||||
push es
|
||||
mov es,loseg
|
||||
mov ax,es:putp
|
||||
mov putp,ax
|
||||
mov ax,es:conend
|
||||
mov conend,ax
|
||||
pop es
|
||||
VZ_RET
|
||||
copyxptrs endp
|
||||
|
||||
;--- Set/reset INT29h ---
|
||||
|
||||
setint29 proc
|
||||
mov bx,offset cgroup:vct29
|
||||
mov di,29h*4
|
||||
mov ax,offset cgroup:int29in
|
||||
call setint
|
||||
VZ_RET
|
||||
setint29 endp
|
||||
|
||||
public resetint29
|
||||
resetint29 proc
|
||||
mov bx,offset cgroup:vct29
|
||||
mov di,29h*4
|
||||
call resetint
|
||||
VZ_RET
|
||||
resetint29 endp
|
||||
|
||||
endes
|
||||
|
||||
cseg
|
||||
|
||||
;--- Check INT29h ---
|
||||
|
||||
public chkint29
|
||||
chkint29 proc
|
||||
tstw conbufsz
|
||||
jz chkcon9
|
||||
test syssw,SW_CON
|
||||
jz chkcon1
|
||||
call preconfile
|
||||
call setint29
|
||||
jmps chkcon9
|
||||
chkcon1:call resetint29
|
||||
chkcon9:VZ_RET
|
||||
chkint29 endp
|
||||
|
||||
endcs
|
||||
ENDIF
|
||||
end
|
||||
|
||||
;****************************
|
||||
; End of 'xscr.asm'
|
||||
; Copyright (C) 1989 by c.mos
|
||||
;****************************
|
3422
SRC/zcopy.asm
3422
SRC/zcopy.asm
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user