[Date Prev][Date Next][Subject Prev][Subject Next][Date Index][Subject Index]
Re: XYWRITE 4.018 Source Code | request for resources
- Subject: Re: XYWRITE 4.018 Source Code | request for resources
- From: Harry Binswanger <dmarc-noreply@xxxxxxxxxxxxx>
- Date: Mon, 06 Apr 2026 12:52:49 -0400
At 08:58 AM 4/3/2026, you wrote:
Harry, were you able to find the
NB version of XYWrite that you mentioned earlier? Can you send it my way?
Thanks.
Best,
XYGHOST
No, to my great disappointment.
Regards,
Harry
Some of the notes from my current project.
#### Reconstruction Priority Table
| Priority | Seg | Size | XY4% | Language | Strategy |
|----------|-----|------|------|----------|----------|
| 1 | 2,10,26,27,28,59,61,66,67,68 | 1B each | N/A | Stub | `db 0CCh`
|
| 2 | 31 | 25B | - | ASM | Disassemble 3 tiny functions |
| 3 | 60 | 24B | - | ASM | Disassemble 1 FAR CALL thunk |
| 4 | 38, 39 | 3,884B | 55% | ASM/Data | `db` tables from XY4 seg021
reference |
| 5 | 36 | 2,149B | 88% | ASM | Bootstrap from XY4 seg021, adapt for
Win16 |
| 6 | 64 | 4,303B | 29% | ASM | XY3+XY4 character encoding reference
|
| 7 | 58 | 1,435B | 18% | ASM | Small ASM segment with XY4 overlap |
| 8 | 35 | 5,084B | 18% | ASM | XY4 code reference |
| 9 | 3 | 5,543B | 20% | ASM | XY3+XY4 cursor/screen code |
| 10 | All remaining | various | 0-13% | Mixed | Ghidra decompile + fresh
disassembly |
### 32. Phase 4 Infrastructure Plan
Three deliverables needed before segment reconstruction can begin:
1. **Stub ASM source files** -- 10 stubs (1 byte each) + seg 31
(25B) + seg 60 (24B)
2. **BUILD_XW.BAT** -- Master build script (assemble all ASM,
compile all C, link)
3. **VRFXW.PS1** -- NE-aware segment comparison tool (parse both
NE headers, compare per-segment)
### 33. Phase 4 Infrastructure -- CREATED (April 2, 2026)
All three infrastructure deliverables completed:
**Stub ASM source files** (12 files in `BUILD\CORE\`):
- `SEG02.ASM`, `SEG10.ASM`, `SEG26.ASM`, `SEG27.ASM`, `SEG28.ASM` --
1-byte stubs (LOADONCALL)
- `SEG59.ASM`, `SEG61.ASM` -- 1-byte stubs (LOADONCALL)
- `SEG66.ASM`, `SEG67.ASM`, `SEG68.ASM` -- 1-byte stubs (PRELOAD)
- `SEG31.ASM` -- 25 bytes: CC pad + 4 tiny FAR procs (nullsub, RETF, XOR
AX,AX/RETF, STC/RETF)
- `SEG60.ASM` -- 24 bytes: CC pad + FAR CALL to seg42:037Eh + 3x
RETF
**Segment naming convention:** `SEGnn_TEXT SEGMENT PARA PUBLIC
'CODE'` for CODE segments.
IDA names them `cseg01`..`cseg72` (CODE) and `dseg73`..`dseg81`
(DATA).
**BUILD_XW.BAT**: Master DOSBox build script. Currently assembles
stub + small segments.
Link step deferred until more segments are ready. Uses SETENV.BAT for
paths.
**VRFXW.PS1**: NE-aware comparison tool. Parses both NE headers,
extracts each segment,
compares byte-by-byte. Reports per-segment match/mismatch with offset of
first diff.
### 34. Deep Analysis: Seg 36, 38, 39
**Seg 38 & 39** (3,884 bytes each, 0 relocs):
- Structure: ~48-byte header/index, then 2-letter ASCII command codes
packed consecutively
- Commands found:
CN,SN,SU,UW,US,ET,VL,SZ,FY,OR,WD,FO,PS,PR,LE,PE,PG,HM,CP,FB,FE,UO,GD,PZ,
YP,XP,XS,GB,GE,B1,B2,BE,AT,EA,EF,PT,PC,VS,?X,FA,FP,NA,GR,PU,F1,F0,DF,CS,JU,DM,DA,SF,SC,
KH,AC,SE,UC,DL,HY,PP,XB,CO,AO,CR,BX,RD,DI,HV,VU,FU,SK,KS...
- **Seg 38 and 39 are byte-identical** (confirmed). Possible
upper/lowercase lookup variants.
- No relocations = pure data, no segment references. Easy reconstruction:
raw `db` dump.
**Seg 36** (2,149 bytes, 1 reloc):
- **1 function:** `sub_45A60` (IDA) -- buffer lookup + memory copy
routine
- Entry: PUSH BX/CX/DI/SI/BP, MOV AX,CS / MOV DS,AX (set DS=CS for
local data)
- Searches table at CS:008Bh-00AFh (6-byte entries) for BX
match
- On match: copies 128 bytes with REP MOVSB to SS:3099h (stack
segment buffer)
- Adjusts buffer sizes, calls `sub_542F4` (in another seg) if
negative delta
- Ends: MOV ES, [word_97BD9] (restores ES from global), POP regs,
RETF
- Called from cseg47+AC (`sub_6CAD0`)
- **Data tables** follow the function:
- 6-byte entries (lookup table at +8Bh to +AFh)
- Byte sequence 80h-BFh (character mapping table)
- Sparse data extending to end of segment
- **1 relocation:** The `MOV ES, word_97BD9` at the end references
dseg81 (auto data segment)
### 35. First Assembly Build -- SUCCESSFUL (April 2, 2026)
`BUILD_XW.BAT` ran in DOSBox-X. All 12 ASM files assembled with MASM
6.11d:
| File | OBJ Size | Segment | Content |
|------|----------|---------|---------|
| SEG02.OBJ | 73B | SEG02_TEXT 'CODE' | 1-byte stub (0xCC) |
| SEG10.OBJ | 73B | SEG10_TEXT 'CODE' | 1-byte stub (0xCC) |
| SEG26.OBJ | 73B | SEG26_TEXT 'CODE' | 1-byte stub (0xCC) |
| SEG27.OBJ | 73B | SEG27_TEXT 'CODE' | 1-byte stub (0xCC) |
| SEG28.OBJ | 73B | SEG28_TEXT 'CODE' | 1-byte stub (0xCC) |
| SEG59.OBJ | 73B | SEG59_TEXT 'CODE' | 1-byte stub (0xCC) |
| SEG61.OBJ | 73B | SEG61_TEXT 'CODE' | 1-byte stub (0xCC) |
| SEG66.OBJ | 73B | SEG66_TEXT 'CODE' | 1-byte stub (0xCC) |
| SEG67.OBJ | 73B | SEG67_TEXT 'CODE' | 1-byte stub (0xCC) |
| SEG68.OBJ | 73B | SEG68_TEXT 'CODE' | 1-byte stub (0xCC) |
| SEG31.OBJ | 102B | SEG31_TEXT 'CODE' | 25B: 4 tiny FAR procs |
| SEG60.OBJ | 101B | SEG60_TEXT 'CODE' | 24B: FAR CALL thunk |
**OBJ verification:** Hex dump confirms segment names
(`SEG02_TEXT`, class `CODE`) and
correct data bytes (e.g., SEG31.OBJ contains `CB CC CB CC 33 C0 CB F9
CB`).
**Bug fixed:** Original `BUILD_XW.BAT` used `for %%F in (...) do
(...)` with `%%~nF`
modifiers -- these are Windows CMD features, not available in DOSBox's
COMMAND.COM.
Fixed by replacing FOR loops with individual ML commands.
### Phase 4 -- Way Forward
**Segment reconstruction order (81 total segments to build):**
| Priority | Segments | Count | Size | Strategy |
|----------|----------|-------|------|----------|
| **P1 DONE** | 2,10,26,27,28,31,59,60,61,66,67,68 | 12 | 86B |
Stub ASM files assembled |
| **P2 NEXT** | 38, 39 | 2 | 7,768B | db dump command tables (0
relocs, pure data) |
| **P3** | 36 | 1 | 2,149B | Bootstrap from XY4 seg021 (88% match,
1 reloc) |
| **P4** | 73-81 | 9 | 206,202B | DATA segments -- db/dw/dd dumps
from original |
| **P5** | 63, 57, 41, 23, 33, 58, 56, 40, 43 | 9 | ~20KB | Small
ASM/CODE segs (<4KB) |
| **P6** | 35, 64, 3, 5, 8, 21, 30, 48 | 8 | ~36KB | Medium ASM
segs with XY4 matches |
| **P7** | 11, 13, 14, 19, 37, 44, 47, 49, 53, 54 | 10 | ~105KB |
Larger ASM segs |
| **P8** | 7, 9, 15, 16, 17, 20, 24, 42, 50, 51, 62 | 11 | ~108KB
| Mixed C+ASM segs |
| **P9** | 1, 4, 6, 12, 18, 22, 25, 29, 32, 33, 34, 45, 46, 52, 55
| 15 | ~230KB | C compiler-generated segs |
| **P10** | 69, 70, 71, 72 | 4 | 74KB | PRELOAD C segs (entry
point, CRT, app init) |