======== cmos.def (v1.6) ========

* Command keys

00	^K ^O [ESC]	;Prefix Keys
01	^@		:Repeat Command
02	^M		:Kbd Macro
03	[ESC] @X	:Escape
04	[CR]		:Enter
05	[UP]		:Up
06	[DOWN]		:Down
07	[<--]		:Left
08	[-->]		:Right

09	\[<--]		:Word Left
10	\[-->]		:Word Right
11	^[<--]		:Top of Line
12	^[-->]		:End of Line
13	[INS]		:Insert Mode
14	[BS]		:Backspace
15	[DEL]		:Cut char
16	\[BS]		:Cut Word Left
17	\[DEL]		:Cut Word Right
18	^[BS]		:Cut BOL
19	^E ^[DEL]	:Cut EOL
20	^U \[INS]	:Char/Str Undo
21	[TAB]		:Tab
22	^P		:Control Char
23	^KU		:Word Case
24	^V   [F04]	:Put Word
25	^KN		:Put File Name

30	^Q		:Paging Mode
31	\[RLDN]		:Roll Up
32	\[RLUP]		:Roll Down
33			:Roll Up 2
34			:Roll Down 2
35	[RLDN]		:Page Up
36	[RLUP]		:Page Down
37	\[UP]		:Smooth Up
38	\[DOWN]		:Smooth Down
39	^[UP]		:Top of Window
40	^[DOWN]		:End of Window
41	^T ^[RLDN]	:Top of File
42	^B ^[RLUP]	:End of File
43	^R		:Last Position
44	^KM		:Set Marker
45	^L		:Jump to Line

46	^X		:Mark Block
47	^D		:Cut Line/Block
48	^A		:Paste (Pop)
49	^S		:Copy Line/Block
50	^C		:Paste (Copy)
51	^KY		:Clear Stack
52	^J		:Block Top/End
53	\[CR]		:Insert Line
54	^KL		:Restore Line

55	^F   [F02]	:Set Find String
56	^KA  [F03]	:Replace String
57	    \[F03]	:Replace Next
58	    \[CLR]	:Match ()[]{}<>
59	^G   [F01]	:Get Word
60	^KG		:Read Tag
61	^KC \[F04]	:Put Buffer

62	^W		:Change Window
63	^Z		:Pick Text
64	^Y		:Split Window
65	^H		:Border
66	^OL ^[F06]	:Screen Lines ($lc)
67	^OR  [F09]	:Read Only
68	^KI		:Indent L/R
69	^KX \[F09]	:Compare Texts

70	[ESC]O	@O	:Open Files
71	[ESC]R	@R	:Read Files
72	[ESC]N	@N	:New Files
73	[ESC]C	@C	:Close
74	[ESC]L	@L	:Load a File
75	[ESC]S		:Save as
76	[ESC]A	@A	:Append to
77	[ESC]Q		:Quit
78	[ESC]E 	@E	:Exec Dos
79	\[ESC]		:Peek Console

80	^K^ @^		:Install Macro
81	^K_		:Print Kbd Macros
82	[ESC]P	@P	:Path Rename
83	[ESC]W	@W	:Write profile
84	^KT		:Set title search string	; ##1.6

88	    \[<--]	:Select Left		; Filer
89	    \[-->]	:Select Right		;
90	    \[UP]	:Select Up		;
91	    \[DOWN]	:Select Down		;
92	     [CLR]	:Top/End		;
93	     [TAB]	:Change Window		;
94	     [BS]	:Parent Dir		;

95	\[ESC]		:Peek Console		; DOS
96	^W		:Alias List		;
97	^J ^[CR]	:Spread			;
98	\[CR]		:To Filer		;

* Function key labels

"Gets","Find" ,"Chng" ,"Puts","Mult", " Cr","Tab","Stat","RO"," Do!"
"mode","grep","chng2","puts2","EMS", "","","opt","comp"," do!"

* Text windows

"Open File: <$pd>",40
"Save As: <$pd>",40
"New File: <$pd>",40
"Append to: <$pd>",40
"Path/mask:",40
"Search: <OPT:$po>",40
"Replace:",40
"Put String:",40
"Line:",1
"Rename:",40
"Title String:",30

* System menus

1	"Macro Menu",42,0,24
2	"Alias List",40,0,10,-1
3	"Pick Text",37,0
4	"Range",10,3 "All" "Forward" "Backward"

10	"Macro Menu <$BM/free>",40,0

* Macros

1 "!Open"
	(ne=='DE')? ts="*=",
	(ne=='NI')? ts="\x ^\0/\0",
;	(ne=='TX')?{ we=40, td=1, }
;	(ne=='C'||ne=='H'||ne=='CP')?{ ts="/", qk="{}", }
;	(ks&1)? &#_(0)

1 "!Edit"
	(ct>1)?{ &o(ic). }
	(ic=='{')?{ '{' #m &o(9). }
	(ic=='}')?{ #s (cd==9)?{ '}' #g #m }?{ #d '}' }

1 "!View"
	(ic)?{ (ic!=' '&&ic!='丂')? >E (ks&1)? #r ? #c .}
	(cm==4)?{ (mb)? >E #C . }
	(cm==53)?{ #67 . }
:E	' '

1 "!Timer"
	?. (mr!=1)?. (qn<=Qc)?. (mb)?.
	(Qw){
	  &m("Auto save?")
	  (Qw){ &w(1) &k (r)?{ &m("Cancel") qn-, . } }
	}
	#S #m #83
;	sq[-, #Q 'N'(s)?{ #[ #Q "YN"} sq], #83

3 \[F01] "Mode Menu"
	??{ !02 .} (s==1)?{ (vw)? !05 ? !04 }

4 \[F02] "Grep"
	(s)?? #E "grep -r- -w " #I "*.*" #m

5  [ESC]M \[HELP] "Macro menu"
	!97 (r>=0)?{ !98 (r>=0)? >* >^ }
	(r&$FF==15)?{ r=r>>8&$7F, &Zd(r) >^ }
	(r&$FF==13)? >88

6  [ESC]D @D "Duplicate"
	?. (wt)? >A
	(wn==0 || wc==tc)?{ &m(6). }
	&s sn[, sn-,
	&#Y(0) l=ln, ly[,
	#R #P #m mr=$80,
	ky], ev[-, &#J(l) ev], #W
	sn], &d #Y .
:A	(mr<=1)?{ #W (mr<=1)?{ #W . }}
	#C (wt)?{ #W &#Y(0) }

7  [ESC]U @U "Undo Edit"
	?. #] (mr==1)?{ &a(37) (r<=0)?. }
	&s #L (s==4)?'n' #P #m &d

8  [ESC]I @I "Insert File"
	?. (mr==$80)?{ &m(36) . }
	&m("Insert file at cursor position")
	n=wn, c=wc,
	#R
:A	(s)?{ &c >A }
	(wc==c)? >Z
	mr=-1,
	&s
	#W &#T(n)
:B	#W &#T(c+1)
	#b #_ (ct)?{ #> #m #x }
:C	#y (mb)?{ #W #< #i (ek)?? #B #W >C }
	#C &#T(n)
	#< #i (ek)?? #B
	(wc>c)? >B
 	&d
:Z	&m("")

9  [ESC]X "X:close all"
	?.
:A	#C
:B	(s)>?{ >A . . . }
	i=wc, &c (wc==i)?. >B

11 [ESC]@ @@ "Instant Macro"
	?. &g("Statement:")
	(r==-1)?.
	&e(pw)
	&m("Result: %d %u $%x '%c' $"%16s$"",r,r,r,r,r)
	&d

12 @[<--] "Left of Window"
	?. &x(0)

13 @[-->] "Right of Window"
	?. &x(we-2) #?

14 [CLR]  "View Point"
	?. y=wy-1,y/=2,
	(ly==y)?{ ky=wy-2, >A }
	(ly==1)?{ ky=y, >A }
	ky=1,
:A	&d #]

15 ^OT "change Tab    ($ht)"
	?. ht=12-ht, &d

16 ^K0 "Set Marker(1..4)"
	?. i=r, &#M(r) (r)?. &m("Mark #%d",i)

17 [ESC]0 "Jump to Marker"
	?. &#U(r)

19 ^KD "Duplicate Line"
	?. #k #i

;20 ^KJ "Undo Paste"
;	?. mb=r, #y

21 [F05] "Multi File"
	?. i=wc,
	(cm==56)? >R
:S	(mp<2)?.
	#c (r)??.
	#T #T (i--)??.
	#^ ky=wy/2, >S
:R	#57 #T #T (i--)? >R

22 [NFER] "Fix Word"
	?. (lx)??.
	&s mp[,
	(cm)?{ x=lx, i=2, }?{ &x(x) #t i++, }
	#a #G #61 ' ' #h (i){ #e } #m #t
	mp], #? cm=0, 

23 ^KP "PRT++"
        ?. #] (mb)? >A
        (mr==1)?{ #S #m }
        #E "prt " #P #m #[ .
:A	p="temp.tmp",
	#S &?(p) #m
	#E "prt " &?(p) #m
	"del " &?(p) #m #[

24 ^G [F01] "Get Right Words"
	?.
	(cm||mb)?{ #G xx=r, cm=0, . }
	&s
	#b
	cp+=xx, #? &s
:A	(ct<2)? >B
	a=ct, #d
	(ct>=a)? >A
:B	&d
	xx=cp,  #B
	xx-=cp, #G
	cm=0,

25 ^] "ZENKAKU KAKKO"
        (s==3)?.
	p="乵乶乽乿乲乴亀亁亂亃乻乼",
	&f(cd,p)
	mi-,
	(r>=0)?{
		(r&1)? #s
                 &Sf(p,cd)
                ((r+=4).0)? p=r,
		mi+,
	}
	&?("%4s",p) mi-, #s

26 ^OO "View mode"
	am[,
	(ro!)?{ am=5, &m("View mode") }
	     ?{ &m("Edit mode") }
	am],

27 ^KO "reset Options"
	&^ &d #]

28 [ESC]0 ""

#ifn 98
30 \[UP] "Fast Roll Up"
	(-1){ #e (ks&1)??. }

31 \[DOWN] "Fast Roll Down"
	(-1){ #x (ks&1)??. }
#endif

32 @[UP] "Roll Up"
	(wt)?{ #W (ks&1)? #r ? #w #W .} #37

33 @[DOWN] "Roll Down"
	(wt)?{ #W (ks&1)? #c ? #z #W .} #38

34 [F06] "CR" dc=dc!, &d

35 [F07] "TAB" dt=dt!, &d

36 [F08] "STAT" ds=ds!, &d

37 \[F05] "EMS status"
	?.
	&m("EMS %d/%d",ef,em)

38 @S "嫮惂僙乕僽"
	?. #S #m #83

40  [F10] "Do!"
	&01 " " #m (r)?{ #95 #U #< }	; 僄儔乕側傜console傪僆乕僾儞

41 \[F10] "Do!+"
	&01 " "
	(pu.0)?{ &?(pu) #m . }
	"g" #m				; 僨僼僅儖僩僆僾僔儑儞

1:	(s)? >Z				; 儘乕僇儖儅儖儘
	(wn)?{
		#S #m (fe<1||fe>2)?/	; 僙乕僽
		#E "acc " #P .		; 奼挘巕偑 .c .asm 側傜 "acc <抬操柤>"
	}
:A	#60 (r)?{ #x (r)? >Z >A }	; 僐儞僜乕儖僼傽僀儖側傜僞僌僕儍儞僾
	#x #O #e #m
	(s)?{ #[ #[ >A }
:Z	&q				; 侾僱僗僩僗僉僢僾

42 \[F08] "Set option"
	?.
	&g("Option:")
	(r<0)?.
	p=pw,q=pu,			; pu乮儅僋儘攝楍椞堟乯傊僐僺乕
:A	(q.0=p.0)?{ p++, q++, >A }
	&m(pu)				; 僆僾僔儑儞偺昞帵

#if 98
1 [HELP] "Help" &z("helpe") >*
#else
1 [F12] "Help" &z("helpe") >*
#endif

41 ^K^ "Install Macro"
	&#80(0)

42 ^KZ "toggle ZEN/HAN" &z("zenhan") >*
43 ^KB "Column Block" &z("block") >*

* Pop up menu

2	"",22,14,5
	"CR  Display",	Dc
	"TAB Display",	Dt
	"EOF Display",	De
	"Line Numbers",	Dl
	"ZEN space",Dj
	"Number Mode	Line scrn",Dn
	"System Info.",	Ds
	"Underline Csr",Du
	"Auto Indent",	Ei
	"Half Paging	Full Half",Eh
	"Backup File",	Eb
	"Right Margin",	WE
	"Page Length",	PG
	"Overwrite mode	char scrn",Eo

4	"Seach Option",22,2,4
	"Word Search",	Ew
	"ignore Case",	Ec

5	"Seach Option",22,4,4
	"Word Search",	Ew
	"ignore Case",	Ec
	"ignore ZEN/HAN",ZH
	"regular eXpr.",RX

======== help.def (v1.6) ========
(R)

* Macro key

#if 98
1 [HELP] "Help"
#elseif J31
1 [F10] "Help"
#else
1 [F12] "Help"
#endif
	(s>1)? >A
	(cd=='%')? >D
	(cd=='#')?? >A
	#d c=cd,
	(c>='<' && c<='z')?{ #s i=c-'<', r=pv.i, >C }
	&n r[, #s r], (r>=0)? >C
:A	(s)>? { !01 !02 !03 !04 }
:B	(r>=0 || r==-1 || r==-256)?.
:C	(r==1~)?.		; 1 = macro No. of me
	!00 (r&$FF)? >B >A
:D	mp[, ec[-, ly[,
	&s
	#b #d #d #G
	#c (r)? { ky[, #^ ky], #c }
	ly],ec],mp],
	&d #]

* Pop up menu

0	"It's ...",36,1,18,-1 #00

1	"Screen Edit",12,8
	"Cursor Move",!11
	"Roll/Jump",!12
	"Line Edit",!13
	"Block",!14
	"String",!15
	"File/Window",!16
	"Macro",!17
	"Else",!18

2	"Text Window",12,2
	"Cursor Move",!19
	"Line Edit",!13

3	"Command Line",12,3
	"Cursor Move",!19
	"Line Edit",!13
	"Else",!20

4	"Filer",36,11,18,-1
	#05 #06 #07 #08	#88 #89 #90 #91 #92 #93 #94

11	"",36,13,18,-1
	#05 #06 #07 #08 #09 #10 #11 #12 &12 &13 #39 #40 &14

12	"",36,17,18,-1
	#30 #31 #32 #33 #34 #35 #36 #37 #38 #41 #42 #43 #44 #45 &16 &17 &18

13	"",36,14,18,-1
	#13 #14 #15 #16 #17 #18 #19 #20 #21 #22 #23 #24 #25 &42

14	"",36,10,18,-1
	#46 #47 #48 #49 #50 &19 &20 #51 #52 &43

15	"",36,9,18,-1
	#55 #56 #57 #58 #59 #60 #61 &21 &22

16	"",36,17,18,-1
	#70 #71 #72 #73 #74 #75 #76 #77 &06 &07 &08 &09 #82 #62 #63 #64 #65

17	"",36,6,18,-1
	#02 #81 &05 &10 &11 &88

18	"",36,12,18,-1
	#01 #04 #53 #54 &15 #66 #67 #68 #69 #78 #79 #80

19	"",36,8,18,-1
	"History Up",#05
	"History Down",#06
	#07 #08 #09 #10 #11 #12

20	"",36,6,18,-1
	"Edit",#03
	"DOS Command",#04
	#95 #96 #97 #98

;======== End of helpe.def ========

======== moremac2.def (v1.6) ========

* Macros

88 @M "External Macro"
	?.
	!01 (r<0)?. (r)?? >>
	&Sf(pm,9) (r)??. &Ss(r) (r.0)??.
	p=r, &Zs(p) (r)?? &z(p) >*

10 [ESC]^ "Load Macro file"
	?. p=pr, &Sp(p,"%s*.def",pi)
:F	&Fl(p) &Cr fg.1=1,
	(r)?{ &g("Macro file:",40) (r==-2)? >F (r<0)?. p=pw, (0)}
	   ? &Fg(p)
	&z(p) >*

1 "!Abort"
	&m(r) &b(5) /

* Pop up menus

1	"",20,6
	"Filer select"
	"1 TOOL			tool"
	"2 Column Block		block"
	"3 KEISEN		keisen"
	"4 toggle ZEN/HAN	zenhan"
	"5 GAME			game"
;*
;======== End of moremac2.def ========

* Option

Bt64			;size of text buffer (16..64KB)
Bf64			;size of dos reserve (KB)
Bo32			;size of console buffer (0..32KB)
EM			;allocate EMS pages (EM1:all)
XM			;allocate XMS KB (XM1:all)		##1.6
SW4			;swap mode
			;(0=OFF, 1=text, 2=text&code, 3=TSR 3.8KB)
RM0			;Mask EMS/XMS Realloc (+1:EMS, +2:XMS)	##1.6

Bm1024*8		;macro buffer free
Ba0			;alias buffer free
Hs512			;string history free
Hf512			;file history free
Hx256			;DOS command history free
Bl4096			;size of line buffer (256..(Bt*1024/8))
Bc1024			;size of delete char buffer
Bu64			;size of user work area
Bv1024			;size of Log info. table		##1.6

TC20			;max open files
WD80			;field width (2..250, 0=screen width)
PG0			;page length
RS3			;smooth scroll speed (0..4)
Ta8			;TAB columns
Tb4			;.C .H TAB columns
Ci4			;cursor type (insert) (0..15)
Co7			;cursor type (overwrite)
WL0			;pop-up window location (0..15)
#if 98
LC-			;line mode
#else
LC			;Line count in editor
VM0			;Video Mode in editor
#endif

#if 98
An7			;text attr
Ac5			;control char #1
Al5			;line numbers
Ah13			;block
As15			;status bar
Ao14			;status bar(console)
Ar13			;status bar(RO)
Am6			;message
Ab5			;menu border
At5			;menu title
Aw7			;menu text
Af6			;first letter
Ai15			;selection bar
Aj6			;help menu
Ak6			;2-stroke key
Ag1			;filer background
Au6			;filer cursor
Ae1			;control char #2			##1.6
Ay0			;path name				##1.6

#else
An$1F
Ac$13
Al$1A
Ah$B0
As$70
Ao$E0
Ar$30
Am$0E
Ab$70
At$70
Aw$70
Af$74
Ai$0F
Aj$74
Ak$0E
Au$4F
Ap$70
Ad$07
Av$80
Ae$12
Ay0
#endif

CA4+32			;control attr table			##1.6

Dl-			;disp line number
Dc-			;disp CR
Dt-			;disp TAB
De+ 			;disp EOF
Ds-			;disp system info.
Db-			;back slash char
Dn-			;line number mode
Du-			;under line
Df-			;full path
Dp+			;path name lower
Dh-			;path name left
Dg+			;disp JIS83 KEI(98)
Dr+			;disp Right Margin			##1.6
Dj-			;disp ZEN space				##1.6
Dv+			;smooth scroll attr			##1.6

Ei+			;auto indent
Es+			;smooth scroll by ^QE,^QX
Ez+			;add EOF
Eb-			;make backup
Eu-			;convert TAB to SPC
Et+			;title search
Eh-			;half paging
Ew+			;word search
Ec-			;ignore upr/lwr case
Ex-			;warn text stack full
En-			;cursor left of EOL
Ev-			;V-center after jump
Ek+			;jump to pasted block
Ea+			;auto right margin by .nnn
RO-			;open in view mode
Ej-			;indent 2byte space
El+			;cut right space/tab
Eo-			;overwrite mode				##1.6
RX-			;regular eXpression			##1.6
ZH-			;ignore ZEN/HAN				##1.6

Sx+			;keep console output
Se+			;skip ESC sequence
Sd+			;expand command line alias
Sk-			;clear text stack before exec
Sy+			;Y/N by [Enter]/[Space]
Sn+			;ask new file
Sq-			;quick exit
Sz-			;reset options before exit		##1.6

FP+			;control FEP
FR-			;raise FEP
FK+			;function key mode(98)/keyboard type(IBM)

Sr31			;profile mode				##1.6
Qt0			;auto save delay time			##1.6
Qc40			;auto save char count			##1.6
Qw100			;auto save ack. wait time		##1.6

* Alias

sd	symdeb
rene	ren %1 %<.%2
fca	fc %1 %2%\%>
fcb	fc /b %1 %2%\%>
sete	set %1=%%1%
acc	ac %& %*2
la	lha a
le	lha e
ll	lha l
lai	lha a %1 %*2 ; ish %1.lzh /sn
test1	echo %: ; echo %& ; echo %.
test2	echo %wd% %%a %1 %%1% %%a%
move	zcopy /m

* History

:string
	assume public extrn label "offset cgroup:"
:file
	\config.sys \autoexec.bat

* Else

1	vzfle
2	editfile
3	.asm .inc .C .H .doc .bat .def .txt .mix .nif
#if 98
5	0仠,仢.仜1乻2伀3乼4仼5仭6仺7亀8仾9亁=乂+仸*仛-亂/亃
6	0劋,劏.劊1劌2劑3劎4労5劰6劶7劇8劍9劉=劆+劒*劅
#endif
7	*/;=(仭
8	$pd>
9	.com .exe .obj .lib .lzh .bdf
;	   劅 劆 劇 劉 劋 劊 |   | 仺 伀 仼
#if 98
10	"$(95,96,9C,9D,9E,9F,88,97,1C,1F,1D)"
#else
10	"$(06,05,01,02,03,04,05,05,1E,1B,1F)"
#endif

#ifn 98 J31
12	"$(00,08,02,0B,04,05,06,07,38,09,3A,3B,3C,3D,3E,3F)"
#endif

;======== End of cmos.def ========
