Skip to content

Commit c07e1d0

Browse files
committed
1.08
1 parent 87fa613 commit c07e1d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+4582
-0
lines changed

typeset/codex.htm

+4,230
Large diffs are not rendered by default.

typeset/codex.txt

349 KB
Binary file not shown.

typeset/img/page_01.jpg

196 KB

typeset/img/page_02.jpg

242 KB

typeset/img/page_03.jpg

212 KB

typeset/img/page_04.jpg

229 KB

typeset/img/page_05.jpg

192 KB

typeset/img/page_06.jpg

227 KB

typeset/img/page_07.jpg

373 KB

typeset/img/page_08.jpg

220 KB

typeset/img/page_09.jpg

206 KB

typeset/img/page_10.jpg

245 KB

typeset/img/page_11.jpg

221 KB

typeset/img/page_12.jpg

248 KB

typeset/img/page_13.jpg

215 KB

typeset/img/page_14.jpg

267 KB

typeset/img/page_15.jpg

225 KB

typeset/img/page_16.jpg

239 KB

typeset/img/page_17.jpg

230 KB

typeset/img/page_18.jpg

292 KB

typeset/img/page_19.jpg

248 KB

typeset/img/page_20.jpg

256 KB

typeset/img/page_21.jpg

230 KB

typeset/img/page_22.jpg

261 KB

typeset/img/page_23.jpg

226 KB

typeset/img/page_24.jpg

255 KB

typeset/img/page_25.jpg

240 KB

typeset/img/page_26.jpg

230 KB

typeset/img/page_27.jpg

240 KB

typeset/img/page_28.jpg

250 KB

typeset/img/page_29.jpg

239 KB

typeset/img/page_30.jpg

262 KB

typeset/img/page_31.jpg

236 KB

typeset/img/page_32.jpg

265 KB

typeset/img/page_33.jpg

179 KB

typeset/img/page_34.jpg

247 KB

typeset/img/page_35.jpg

222 KB

typeset/img/page_36.jpg

259 KB

typeset/img/page_37.jpg

227 KB

typeset/img/page_38.jpg

234 KB

typeset/img/page_39.jpg

216 KB

typeset/img/page_40.jpg

268 KB

typeset/img/page_41.jpg

225 KB

typeset/img/page_42.jpg

254 KB

typeset/img/page_43.jpg

238 KB

typeset/img/page_44.jpg

259 KB

typeset/img/page_45.jpg

240 KB

typeset/img/page_46.jpg

268 KB

typeset/img/page_47.jpg

233 KB

typeset/img/page_48.jpg

231 KB

typeset/img/page_49.jpg

226 KB

typeset/img/page_50.jpg

290 KB

typeset/img/page_51.jpg

228 KB

typeset/img/page_52.jpg

283 KB

typeset/img/page_53.jpg

250 KB

typeset/img/page_54.jpg

281 KB

typeset/img/page_55.jpg

235 KB

typeset/img/page_56.jpg

257 KB

typeset/img/page_57.jpg

215 KB

typeset/img/page_58.jpg

268 KB

typeset/img/page_59.jpg

248 KB

typeset/img/page_60.jpg

277 KB

typeset/img/page_61.jpg

312 KB

typeset/img/page_62.jpg

255 KB

typeset/img/page_63.jpg

239 KB

typeset/img/page_64.jpg

255 KB

typeset/img/page_65.jpg

226 KB

typeset/img/page_66.jpg

246 KB

typeset/img/page_67.jpg

249 KB

typeset/img/page_68.jpg

268 KB

typeset/img/page_69.jpg

220 KB

typeset/img/page_70.jpg

254 KB

typeset/img/page_71.jpg

230 KB

typeset/img/page_72.jpg

258 KB

typeset/img/page_73.jpg

244 KB

typeset/img/page_74.jpg

254 KB

typeset/img/page_75.jpg

235 KB

typeset/img/page_76.jpg

256 KB

typeset/img/page_77.jpg

243 KB

typeset/img/page_78.jpg

264 KB

typeset/img/page_79.jpg

233 KB

typeset/img/page_80.jpg

269 KB

typeset/img/page_81.jpg

209 KB

typeset/img/page_82.jpg

263 KB

typeset/img/page_83.jpg

213 KB

typeset/img/page_84.jpg

266 KB

typeset/img/page_85.jpg

214 KB

typeset/img/page_86.jpg

275 KB

typeset/img/page_87.jpg

242 KB

typeset/img/page_88.jpg

232 KB

typeset/img/page_89.jpg

225 KB

typeset/img/page_90.jpg

232 KB

typeset/src/makefile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
static = 0
2+
3+
utohtm.exe:
4+
!if $(static)
5+
asmc -win64 utohtm.asm
6+
linkw system con_64 file utohtm.obj
7+
asmc -win64 urange.asm
8+
linkw system con_64 file urange.obj
9+
asmc -win64 uxchg.asm
10+
linkw system con_64 file uxchg.obj
11+
!else
12+
asmc -win64 -pe utohtm.asm
13+
asmc -win64 -pe urange.asm
14+
asmc -win64 -pe uxchg.asm
15+
!endif

typeset/src/urange.asm

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
; URANGE.ASM--
2+
;
3+
; Creates a range list (range.txt) of glyphs used in codex.txt
4+
;
5+
6+
include stdio.inc
7+
include stdlib.inc
8+
include tchar.inc
9+
10+
.data
11+
table wchar_t 1000 dup(0)
12+
count int_t 0
13+
14+
.code
15+
16+
addwc proc wc:int_t
17+
18+
ldr eax,wc
19+
lea rdx,table
20+
21+
.for ( ecx = 0 : ecx < count : ecx++ )
22+
23+
.return .if ( ax == [rdx+rcx*2] )
24+
.endf
25+
.if ( ecx < 1000 )
26+
27+
mov [rdx+rcx*2],ax
28+
inc count
29+
.endif
30+
ret
31+
32+
addwc endp
33+
34+
compare proc a:ptr, b:ptr
35+
36+
ldr rcx,a
37+
ldr rdx,b
38+
xor eax,eax
39+
mov ax,[rcx]
40+
cmp ax,[rdx]
41+
mov eax,0
42+
mov ecx,-1
43+
seta al
44+
cmovb eax,ecx
45+
ret
46+
47+
compare endp
48+
49+
_tmain proc
50+
51+
.if ( fopen("..\\codex.txt", "rt, ccs=UTF-16LE") == NULL )
52+
53+
perror("..\\codex.txt")
54+
.return 1
55+
.endif
56+
.new fp:ptr FILE = rax
57+
.while 1
58+
59+
fgetwc(fp)
60+
.break .if ( ax == 0xFFFF )
61+
62+
addwc(eax)
63+
.endw
64+
65+
fclose(fp)
66+
qsort(&table, count, 2, &compare)
67+
68+
.if ( fopen("range.txt", "wt, ccs=UTF-16LE") == NULL )
69+
70+
perror("range.txt")
71+
.return 1
72+
.endif
73+
.for ( ebx = 0 : ebx < count : ebx++ )
74+
75+
lea rdx,table
76+
movzx eax,wchar_t ptr [rdx+rbx*2]
77+
fwprintf(fp, L"%04X %c\n", eax, eax)
78+
.endf
79+
80+
fclose(fp)
81+
ret
82+
83+
_tmain endp
84+
85+
end _tstart

typeset/src/utohtm.asm

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
; UTOHTM.ASM--
2+
;
3+
; Converts a Unicode text file (codex.txt) to codex.htm
4+
;
5+
include io.inc
6+
include stdio.inc
7+
include stdlib.inc
8+
include tchar.inc
9+
10+
.code
11+
12+
main proc
13+
14+
.new buf[256]:wchar_t
15+
.new htm:ptr FILE = 0
16+
.new txt:ptr FILE = 0
17+
.new c:uint_t
18+
.new page:int_t = 0
19+
.new line:int_t = 1
20+
.new xl:int_t = 0
21+
22+
.if ( fopen("../codex.txt", "rt, ccs=UTF-16LE") == NULL )
23+
24+
perror("../codex.txt")
25+
.return 1
26+
.endif
27+
mov txt,rax
28+
29+
.if ( fopen("../codex.htm", "wt+") == NULL )
30+
31+
perror("../codex.htm")
32+
fclose(txt)
33+
.return 1
34+
.endif
35+
mov htm,rax
36+
37+
;
38+
;
39+
; "<title>GKS 2365 4to</title>\n"
40+
; "<link href='http://fonts.googleapis.com/css?family=Caudex' rel='stylesheet' type='text/css'>\n"
41+
;
42+
fprintf(htm,
43+
"<html>\n"
44+
"<head>\n"
45+
"<title>GKS 2365 4to</title>\n"
46+
"<link href='https://github.com/nidud/caudex/raw/main/css/style.css' rel='stylesheet' type='text/css'>\n"
47+
"<style>\n"
48+
" body { font-family: 'Caudex', serif; font-size: 48px; }\n"
49+
" table { font-size: 38px; }\n"
50+
" a { text-decoration:none; }\n"
51+
"</style>\n"
52+
"</head>\n"
53+
"<body>\n"
54+
"GKS 2365 4to\n"
55+
"<blockquote>\n"
56+
)
57+
58+
.while ( fgetws(&buf, lengthof(buf), txt) )
59+
60+
lea rsi,buf
61+
62+
.continue .if buf == 10
63+
64+
.while ( wchar_t ptr [rsi] )
65+
66+
movzx eax,wchar_t ptr [rsi]
67+
add rsi,wchar_t
68+
69+
.switch eax
70+
.case 0x0D
71+
.endc
72+
.case 0x0A
73+
inc xl
74+
fprintf(htm, "<br>\n")
75+
.endc
76+
.case 0x09
77+
fprintf(htm, "&#x2003;")
78+
.endc
79+
.case '{'
80+
mov xl,0
81+
mov line,1
82+
.if ( page )
83+
fprintf(htm, "</table>\n<br>\n")
84+
.endif
85+
inc page
86+
fprintf(htm,
87+
"<table border=0 cellspacing=0 cellpadding=5>\n"
88+
"<tr valign=top>\n"
89+
"<td align=right><a href=\"https://github.com/nidud/caudex/raw/main/typeset/img/page_%02d.jpg\">%d</a></td>\n"
90+
"<td align=left>&#x2003;\n"
91+
"<br><br><br><br>&#xF735;<br>\n"
92+
"<br><br><br><br>&#xF731;&#xF730;<br>\n"
93+
"<br><br><br><br>&#xF731;&#xF735;<br>\n"
94+
"<br><br><br><br>&#xF732;&#xF730;<br>\n",
95+
page, page)
96+
.if ( page != 90 )
97+
fprintf(htm,
98+
"<br><br><br><br>&#xF732;&#xF735;<br>\n"
99+
"<br><br><br><br>&#xF733;&#xF730;<br>\n")
100+
.endif
101+
fprintf(htm, "<td nowrap>\n<a name=\"R%02d01\"></a>", page)
102+
.break
103+
.default
104+
mov c,eax
105+
.if ( xl )
106+
mov xl,0
107+
inc line
108+
fprintf(htm, "<a name=\"R%02d%02d\"></a>", page, line)
109+
.endif
110+
.if ( c < 128 )
111+
fputc(c, htm)
112+
.else
113+
fprintf(htm, "&#x%04X;", c)
114+
.endif
115+
.endsw
116+
.endw
117+
.endw
118+
119+
fprintf(htm, "</table>\n</body>\n</html>\n")
120+
fclose(htm)
121+
fclose(txt)
122+
ret
123+
124+
main endp
125+
126+
end _tstart
127+

typeset/src/uxchg.asm

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
; UXCHG.ASM--
2+
;
3+
; Change glyps in codex.txt
4+
;
5+
; Example: UXCHG EFE7 A739+0301
6+
;
7+
8+
include io.inc
9+
include stdio.inc
10+
include stdlib.inc
11+
include string.inc
12+
include tchar.inc
13+
14+
define WEOF 0xFFFF
15+
16+
.code
17+
18+
_xtol proc string:LPSTR
19+
20+
ldr rdx,string
21+
xor eax,eax
22+
xor ecx,ecx
23+
24+
.while 1
25+
26+
mov cl,[rdx]
27+
and cl,0xDF
28+
29+
.break .if cl < 0x10
30+
.break .if cl > 'F'
31+
32+
.if cl > 0x19
33+
34+
.break .if cl < 'A'
35+
sub cl,'A' - 0x1A
36+
.endif
37+
sub cl,0x10
38+
shl eax,4
39+
add eax,ecx
40+
add rdx,1
41+
.endw
42+
ret
43+
44+
_xtol endp
45+
46+
_tmain proc argc:int_t, argv:array_t
47+
48+
.new fp:ptr FILE
49+
.new ft:ptr FILE
50+
.new file:string_t = "..\\codex.txt"
51+
.new bak[256]:char_t
52+
.new tmp[256]:char_t
53+
.new wc[6]:wchar_t
54+
.new count:int_t = 1
55+
.new numc:int_t = 0
56+
57+
.if ( argc != 3 )
58+
59+
printf("UXCHG UTF16 UTF16[+UTF16..]\n")
60+
.return( 1 )
61+
.endif
62+
ldr rsi,argv
63+
.if ( strrchr(strcpy(&bak, file), '.') )
64+
mov byte ptr [rax],0
65+
.endif
66+
strcpy(&tmp, &bak)
67+
strcat(&tmp, ".tmp")
68+
strcat(&bak, ".bak")
69+
_xtol([rsi+size_t])
70+
lea rdi,wc
71+
stosw
72+
_xtol([rsi+size_t*2])
73+
stosw
74+
.while ( byte ptr [rdx] == '+' )
75+
76+
inc rdx
77+
_xtol(rdx)
78+
stosw
79+
inc count
80+
.endw
81+
82+
.if ( fopen(file, "rb, ccs=UTF-16LE") == NULL )
83+
84+
perror(file)
85+
.return 1
86+
.endif
87+
mov fp,rax
88+
89+
.if ( fopen(&tmp, "wb, ccs=UTF-16LE") == NULL )
90+
91+
perror(&tmp)
92+
fclose(fp)
93+
.return 1
94+
.endif
95+
mov ft,rax
96+
97+
.while 1
98+
99+
fgetwc(fp)
100+
.break .if ( ax == WEOF )
101+
.if ( ax == wc )
102+
.for ( rsi = &wc[2], ebx = 0 : ebx < count : ebx++ )
103+
104+
movzx eax,word ptr [rsi]
105+
add rsi,2
106+
fputwc(ax, ft)
107+
inc numc
108+
.endf
109+
.else
110+
fputwc(ax, ft)
111+
.endif
112+
.endw
113+
114+
fclose(ft)
115+
fclose(fp)
116+
remove(&bak)
117+
rename(file, &bak)
118+
rename(&tmp, file)
119+
printf("%d changed\n", numc)
120+
xor eax,eax
121+
ret
122+
123+
_tmain endp
124+
125+
end _tstart

0 commit comments

Comments
 (0)