VOGONS


DOS Notepad v1.1.0 [UPDATE]

Topic actions

Reply 20 of 40, by cookertron

User metadata
Rank Member
Rank
Member

New release available - V1.0.1

Features:

  • Tabs supported.

Fixed:

  • Menu shortcuts CTRL+O, CTRL+N etc
  • After adding Tab support, binary file exceeded 64kb limit. File size reduced to 24k

To do:

  • CTRL+SHFT+Z to redo, silently preserving CTRL+Y
  • ALT release to activate menu
  • Large file support
  • Multi-file support
Last edited by cookertron on 2026-02-26, 00:27. Edited 1 time in total.

Asus P5A v1.06, Gigabyte GA-6BXDS, Soyo SY-5EMA (faulty), Viglen 486, Asus SP97-V

Reply 21 of 40, by pan069

User metadata
Rank Oldbie
Rank
Oldbie
cookertron wrote on 2026-02-25, 09:47:
VERSIONS! I've always hated version numbers, they remind me of line numbers in really old micro BASIC: […]
Show full quote

VERSIONS! I've always hated version numbers, they remind me of line numbers in really old micro BASIC:

10 Print "Hello world!"
11 LET $A = $B
20 goto 10

Oh crap now I need to add something between 10 and 11. Perhaps I've over thinking 😁

That's why we used have the RENUM command back in the day 😀

Reply 22 of 40, by cookertron

User metadata
Rank Member
Rank
Member
aVd wrote on 2026-02-25, 10:27:

BTW I tried the disassembly function of agent86.exe on the latest notepad.com just for the experiment, but it just started to generate some JSON-like file for too much time, so I canceled the process before it finish the job (after more than 10 minutes). This is not the thing, that I was expected and I'm still curious how the disassembled code looks.

Sorry I missed this. Agent86 is specifically designed for Agentic AI as a tool for assembling, disassembling 16-bit 8086 assembly code, it also has a built-in emulator so the AI can test its work with virtually no human interaction. The JSON output is designed to give agentic AI the information it needs in a way that it understands best. This really isn't a tool for humans. Agent86 is a tool built by AI for AI!

This is just a snippet of what Claude Opus does to implement a feature in the Notepad we're (yes that includes you) developing:

agent86.exe --run notepad.com --input \"\\\\x00\\\\x23a\" --mouse 0,0 --max-cycles 5000000 --screen --screenshot assets/notepad.bmp --font 8x8 --output-file assets/result.json
agent86.exe --run notepad.com --input \"\\\\x00\\\\x23a\" --mouse 0,0 --max-cycles 5000000 --screenshot assets/notepad.bmp --font 8x16
agent86.exe --run notepad.com --input \"\\\\x00\\\\x23a\" --mouse 0,0 --max-cycles 5000000 --screenshot assets/notepad.bmp --font 8x8 --output-file /tmp/screenshot_result.json
agent86.exe --run-source notepad.asm --max-cycles 2000000 --input \"Hello World\" --screen --output-file p3_type.json
agent86.exe --run-source notepad.asm --max-cycles 2000000 --input \"Hello World\\\\x1b\" --output-file p3_exit.json
agent86.exe --run-source notepad.asm --max-cycles 500000 --screen --output-file p3_build.json
agent86.exe --run-source notepad.asm --max-cycles 5000000 --input \"ABCDE\\\\x00\\\\x4b\\\\x00\\\\x4b\\\\x00\\\\x4bXX\" --screen --output-file p3_arrows.json
agent86.exe --run-source notepad.asm --max-cycles 5000000 --input \"ABCDE\\\\x08\\\\x08XY\" --screen --output-file p3_backspace.json
agent86.exe --run-source notepad.asm --max-cycles 5000000 --input \"HELLO\\\\x00\\\\x47\\\\x00\\\\x53\\\\x00\\\\x53\" --screen --output-file p3_home_del.json
agent86.exe --run-source notepad.asm --max-cycles 5000000 --input \"Line 1\\\\x0dLine 2\\\\x0dLine 3\\\\x00\\\\x48\\\\x00\\\\x48\\\\x00\\\\x48\" --screen --output-file p3_multiline.json
agent86.exe --run-source test_gap.asm --output-file test_gap_result.json
agent86.exe notepad.asm
agent86.exe notepad.asm --agent
agent86.exe notepad.asm --run --max-cycles 20000000 --screen --events '[{\"on\":\"read:1\",\"keys\":\"\\\\\\\\x0f\"},{\"on\":\"read:5\",\"keys\":\"\\\\\\\\x1b\"},{\"on\":\"read:8\",\"keys\":\"\\\\\\\\x00\\\\\\\\x2d\"}]'
Last edited by cookertron on 2026-02-25, 23:56. Edited 2 times in total.

Asus P5A v1.06, Gigabyte GA-6BXDS, Soyo SY-5EMA (faulty), Viglen 486, Asus SP97-V

Reply 23 of 40, by cookertron

User metadata
Rank Member
Rank
Member
pan069 wrote on 2026-02-25, 19:03:
cookertron wrote on 2026-02-25, 09:47:
VERSIONS! I've always hated version numbers, they remind me of line numbers in really old micro BASIC: […]
Show full quote

VERSIONS! I've always hated version numbers, they remind me of line numbers in really old micro BASIC:

10 Print "Hello world!"
11 LET $A = $B
20 goto 10

Oh crap now I need to add something between 10 and 11. Perhaps I've over thinking 😁

That's why we used have the RENUM command back in the day 😀

Sorry whaaaaaaat! This was a thing? I've just died a little bit.

Asus P5A v1.06, Gigabyte GA-6BXDS, Soyo SY-5EMA (faulty), Viglen 486, Asus SP97-V

Reply 24 of 40, by cookertron

User metadata
Rank Member
Rank
Member

New release available - V1.1.0

Features:

  • Set tab size via a command-line flag /T2 /T4 or /T8 supported. Flag is not case sensitive /t2 /t4 /t8 are valid. Flag can appear anywhere in the arguments.
  • Alt key release toggles the menu bar (same as F10), matching standard Windows behaviour. Alt+letter shortcuts (Alt+F, Alt+E, etc.) still open dropdowns directly.

To do:

  • Large file support
  • Multi-file support

Trying to build up to the last two things on the to-do list as I think they're going to be massive!

Asus P5A v1.06, Gigabyte GA-6BXDS, Soyo SY-5EMA (faulty), Viglen 486, Asus SP97-V

Reply 25 of 40, by igully

User metadata
Rank Member
Rank
Member

@cookertron

I can only find up to 104 files/dirs on my networked MS-DOS 6.22 drive when opening a file from the menu (I currently have 248 files and 24 directories on the root dir) . It should ideally support 512 entries (FAT16 limit). But I am guessing it is a memory consumption issue which prevents NOTEPAD from showing more. A warning message, or better a workaround should ideally be available, if viable.

A request: an ordinary "Shell to DOS" option would be great, located near the menu File->Exit .

Thank you very much for your work.

Last edited by igully on 2026-02-26, 04:15. Edited 1 time in total.

Reply 26 of 40, by aVd

User metadata
Rank Newbie
Rank
Newbie

Hi, @cookertron,
Just tested the latest version 1.1.0. Now <Alt> key works as expected. But there's another related bug: <Alt>+<F>, <Alt>+<E>, <Alt>+<S> and <Alt>+<H> activates drop down menus, but then another key for menu command can not be used, and if <Alt> key is released, the drop-down menu disappears. For example <Alt>+<F> combo and then <N> key press don't work.

Also, the file version in notepad.com and source notepad.asm files is still 1.0.1 (I manually corrected them to 1.1.0 by text and hex-editor).

The rest of the functions seem to work OK.

Thanks for explanation on this "ai programing". Now I see why these modern era tools take away the jobs for millions of "code monkeys", which is not good thing from human perspective. But in this case (using it for a small personal project) it seems like it can be a handy thing. Obviously the "ai coding" saves a lot of time in code writing. I'll spare my comments about "the dark side" of all the popular "ai" algorithms for tracking, control, etc. 😀

Earlier I mentioned something about case/non case sensitive search "field":

aVd wrote on 2026-02-25, 10:27:

I forgot something important. Find and Replace functions now work fine, but finding text is case sensitive. Maybe a checkbox with option for "case sensitive text on/off" in find "field" will be nice addition.

I hope you can make the coding "ai" to implement this functionality as well. At lest now the produced com-file is far from 64KB limit.

DOS fan :: artificial "intelligence" - not a fan... not a fan at all :: is freeware a lie, when human freedom is a fundamental lie?

Reply 27 of 40, by cookertron

User metadata
Rank Member
Rank
Member
igully wrote on 2026-02-26, 04:01:
@cookertron […]
Show full quote

@cookertron

I can only find up to 104 files/dirs on my networked MS-DOS 6.22 drive when opening a file from the menu (I currently have 248 files and 24 directories on the root dir) . It should ideally support 512 entries (FAT16 limit). But I am guessing it is a memory consumption issue which prevents NOTEPAD from showing more. A warning message, or better a workaround should ideally be available, if viable.

A request: an ordinary "Shell to DOS" option would be great, located near the menu File->Exit .

Thank you very much for your work.

Memory constrains are a really horn right up in my *** with this project but, I'm now moving the text buffer to DOS memory which will free up another 8kb of BBS memory, the bit in memory above the program and within the 64kb limit. Keep the program limit to 64kb allows data indexing using the CS register and frees up the DS/ES for video framebuffer and DOS Memory.

Shell to DOS would be a good feature for developers. I'll keep that in mind.

Thanks for your feedback.

Asus P5A v1.06, Gigabyte GA-6BXDS, Soyo SY-5EMA (faulty), Viglen 486, Asus SP97-V

Reply 28 of 40, by cookertron

User metadata
Rank Member
Rank
Member
aVd wrote on 2026-02-26, 04:10:
Hi, @cookertron, Just tested the latest version 1.1.0. Now <Alt> key works as expected. But there's another related bug: <Alt>+< […]
Show full quote

Hi, @cookertron,
Just tested the latest version 1.1.0. Now <Alt> key works as expected. But there's another related bug: <Alt>+<F>, <Alt>+<E>, <Alt>+<S> and <Alt>+<H> activates drop down menus, but then another key for menu command can not be used, and if <Alt> key is released, the drop-down menu disappears. For example <Alt>+<F> combo and then <N> key press don't work.

Also, the file version in notepad.com and source notepad.asm files is still 1.0.1 (I manually corrected them to 1.1.0 by text and hex-editor).

The rest of the functions seem to work OK.

Thanks for explanation on this "ai programing". Now I see why these modern era tools take away the jobs for millions of "code monkeys", which is not good thing from human perspective. But in this case (using it for a small personal project) it seems like it can be a handy thing. Obviously the "ai coding" saves a lot of time in code writing. I'll spare my comments about "the dark side" of all the popular "ai" algorithms for tracking, control, etc. 😀

Earlier I mentioned something about case/non case sensitive search "field":

aVd wrote on 2026-02-25, 10:27:

I forgot something important. Find and Replace functions now work fine, but finding text is case sensitive. Maybe a checkbox with option for "case sensitive text on/off" in find "field" will be nice addition.

I hope you can make the coding "ai" to implement this functionality as well. At lest now the produced com-file is far from 64KB limit.

The menu shortcut bug is now fixed. I hurriedly rushed that release last night after staying up until nearly 2am so didn't have time to test it. Slap dash to say the least!

Yes the case sensitivity search is a must and and I'll get that done as right after moving the text buffer to DOS memory.

AI is a very polarising subject right so I'm not going to talk too much about it other than to say, on a personal level it has allowed me to juice my creativity to the max. There has always been a ceiling to my ability, through my own making or a limit in my physiology (either way the outcome is the same), so this is giving me a new lease of life. Plus juggling a 50hr a week job and a family doesn't leave much wiggle room, a bit like the 64kb limit to this Notepad project 😁.

Asus P5A v1.06, Gigabyte GA-6BXDS, Soyo SY-5EMA (faulty), Viglen 486, Asus SP97-V

Reply 29 of 40, by aVd

User metadata
Rank Newbie
Rank
Newbie

Thanks, @cookertron! Just tested the latest version from your github repo and now it works perfectly fine.

DOS fan :: artificial "intelligence" - not a fan... not a fan at all :: is freeware a lie, when human freedom is a fundamental lie?

Reply 30 of 40, by cookertron

User metadata
Rank Member
Rank
Member

Development paused.

There's a speed bottle neck with Agent86, the agentic 8086 assembler/disassembler/emulator tool. Currently it's built as an interpreter (similar to python) so running it for millions of cycles requires a lot of compute and time. Emulating notepad.com to find a single bug could up to take 2 mins. A life time in agent terms.

The new approach is to remove the interpreter and replace it with a JIT (Just In Time) emulator, which translates 8086 instructions & opcodes into 64-bit to run directly on the host system, which is Windows in my case. So far Agent86 is about 80% there so I'll resume as soon as it's done.

Thanks

Asus P5A v1.06, Gigabyte GA-6BXDS, Soyo SY-5EMA (faulty), Viglen 486, Asus SP97-V

Reply 31 of 40, by cookertron

User metadata
Rank Member
Rank
Member

DOS Notepad V1.1.0 broke because Claude Opus 4.6 couldn't get the 'unlimited' file size feature to work given the level of complexity it was at that time. The emulator built into Agent86 was an interpreter which was painfully slow when taking into consideration all the instructions to just render the screen, so that system was scrapped. After Agent86's emulator was transformed into a JIT, the code executed in real-time, saving 2-3 minutes per execution. Even after that speed increase, V1.1.0 of DOS Notepad and many, many tokens, Notepad still refused to integrate the new system - Notepad V1.1.0 was laid to rest.

On to new beginnings. How was I supposed to have this massive feature if it was seemingly impossible to implement? I had the idea of starting with the feature and building round it. TEXTREAD (https://github.com/cookertron/TEXTREAD) was born, a text file reader for MS-DOS that could read files up to 32MB big! It works really well and is a standalone program if you care to try it - I couldn't stop there though. I wanted the text editor! Over the next two days myself and Claude built a working real piece table append-only add buffer text editor built on top of TEXTREAD. TEXTEDIT (https://github.com/cookertron/textedit) emerged like a butterfly from a cocoon 🤣. A fairly stark TUI with two shortcut keys, save and exit, and you could only open a file from the command line.

Built on top of the foundation. TEXTEDIT was a solid proof of concept Claude and I needed to move forward - the architecture was there, it just needed moving into the early 90s with a jazzy TUI wrapper. That was the easy part, but I soon started getting greedy. I wanted multi-document support. We built it but realised that the memory constraints of real-mode address space meant that only 3 documents could be open at once and no clipboard and no undo/redo. Was it worth it, just to have two extra documents open? I didn't think so - I'd rather have a single document, feature-rich text editor with large file support capable of running on an 8086 system.

So that's pretty much where we are. The multi-document monstrosity needs stripping back to when it was wrapped in the TUI so we can start adding in the features from DOS Notepad V1.1.0:

  • Tab support
  • Search with direction, selection, case sensitivity
  • Replace
  • Insert key support
  • Menu shortcuts
  • Copy & paste
  • Undo/Redo
  • and all the other little bits that made it

Asus P5A v1.06, Gigabyte GA-6BXDS, Soyo SY-5EMA (faulty), Viglen 486, Asus SP97-V

Reply 32 of 40, by aVd

User metadata
Rank Newbie
Rank
Newbie

Hi, @cookertron,
TEXTREAD reminds me of one very old MASM example of text-file viewer - SHOW.EXE, which is very limited in file size reading/opening (something like 64KB or even less). Sound like a very good replacement for it. I'll try it.

So, basically the new TEXTEDIT editor is not a fully functional text editor, but a testing piece of software for some new features.

And we're back to the main thing. I was thinking, that NOTEPAD for DOS will never be a clone of Notepad++ for windows. Personally I prefer very big file support (32MB file size in DOS is amazing) instead of multi-file opening/editing.

  • Tab support
  • Search with direction, selection, case sensitivity
  • Replace
  • Insert key support
  • Menu shortcuts
  • Copy & paste
  • Undo/Redo
  • and all the other little bits that made it

Which of the above features are missing in latest version 1.1.0? Search with direction, (non-)case sensitive search, replace, <Ins> key support?

P.S. For "agent86" compiler you can add "#include <climits>" in main.cpp, so it can be compiled without errors.

I built three different executables from your latest updated source for "agent86" - for Linux_x64, win_x86 and win_x64 (win exe's are with statically linked lib's) but all of them gave me "Assembly failed with errors." when trying to compile TEXTREAD.ASM.

For the given example asm-files CIPHER.ASM, CREEP.ASM, LIFE.ASM and VM.ASM compiles OK and com-executables runs fine (built by all three different "agent86" compiler versions), but MACROS.ASM gives "MACRO 'PRINT' without matching ENDM" error with Linux_x64 version of compiler and compiles OK with both windows compilers, which is also strange. Ok, "dos2unix macros.asm" solved the problem with "MACRO 'PRINT' without matching ENDM" error when using Linux_x64 version of "agent86" - seems like this version found some non-Linux "line break" character in MACROS.ASM and it doesn't like this.

Still the problem with TEXTREAD.ASM compile error "Assembly failed with errors." remains.

DOS fan :: artificial "intelligence" - not a fan... not a fan at all :: is freeware a lie, when human freedom is a fundamental lie?

Reply 33 of 40, by aVd

User metadata
Rank Newbie
Rank
Newbie

I gave up on trying to build TEXTREAD.COM from TEXTREAD.ASM. Tried the prebuild executable downloaded in zip-archive from the github's repo. It works fine with big text files, very nice! The scrolling seems much smoother when "--wrap" switch is used (why *nix style command line switches in DOS software?). "--wra" switch also work just like "--wrap", but I don't see any visual difference when using the switch, except the smoother scrolling.

Anyway, thanks for this text-file DOS reader tool, @cookertron! Now I have a very good modern alternative for the ancient and very limited SHOW.EXE.

P.S. About the "--wra" working switch. There also work "--war", "--www", "--waaa" or whatever character combination starting with "--w" and with length of 5 or 6 characters and I saw why this happens in the assembly code. The switch can be easily reduced to "/w", but I can't compile TEXTREAD.ASM due to the unknown error "Assembly failed with errors.".

Last edited by aVd on 2026-03-11, 19:40. Edited 1 time in total.

DOS fan :: artificial "intelligence" - not a fan... not a fan at all :: is freeware a lie, when human freedom is a fundamental lie?

Reply 34 of 40, by igully

User metadata
Rank Member
Rank
Member

For what it is worth, I also attempted to compile both TEXEDIT and TEXTREAD, and they are only inflicting me pain. So I gave up.
Wouldn't be more "open" if it would compile/link against a standard assembler? What about using NASM? It is still being actively developed.
Having to resort to a disassembler and then look up to the original ASM file to compare code, and understand where things are is a nightmare. It is like reinventing the wheel just for changing something as tiny as shortcut.

Reply 35 of 40, by aVd

User metadata
Rank Newbie
Rank
Newbie

Unfortunately, the current version of NOTEPAD.ASM from the github repo also can't be compiled due to unknown errors. Tried with the latest "agent86" v.0.9.1 and the previews working version with no luck.

DOS fan :: artificial "intelligence" - not a fan... not a fan at all :: is freeware a lie, when human freedom is a fundamental lie?

Reply 36 of 40, by cookertron

User metadata
Rank Member
Rank
Member

You're right, it's because the new Agent86 has a completely different architecture. I can only apologise for wasting your time.

The assembly files produced with Agent86 aren't compatible with any of the DOS compilers, NASM, TASM and MASM. Once the notepad has been released as a stable version I'll include at least a NASM compliable version.

I have deleted the Notepad repo because it's basically broken and I'd hate to think people were killing themselves trying to get it to compile. I've also deleted the old Agent86 and replaced it with the new version so you should be able to compile TEXTREAD and TEXTEDIT with it - if you feel inclined.

Asus P5A v1.06, Gigabyte GA-6BXDS, Soyo SY-5EMA (faulty), Viglen 486, Asus SP97-V

Reply 37 of 40, by aVd

User metadata
Rank Newbie
Rank
Newbie

Hi, @cookertron,
How do you compile "agent86" v.0.19.3? This time it throws me a bunch of errors, while trying

i686-w64-mingw32-g++ -std=c++17 -O2 -static -o agent86.exe main.cpp

or

x86_64-w64-mingw32-g++ -std=c++17 -O2 -static -o agent86_x64.exe main.cpp

?

At least the prebuild agent86 0.19.3 seems to work and I managed to compile the latest TEXTREAD.ASM 😀

If you don't mind, I fixed the strange "--w___" switch acceptance, by replacing the switch with DOS-friendly "/w".

Changed code lines

Line 5:

; Usage:  TEXTREAD [--wrap] <filename>

to

; Usage:  TEXTREAD [/w] <filename>

Line 117:

s_usage:     DB  'Usage: TEXTREAD [--wrap] <filename>',0Dh,0Ah,'$'

to

s_usage:     DB  'Usage: TEXTREAD [/w] <filename>',0Dh,0Ah,'$'

Lines 337-351:

    ; Check for "--wrap" token
CMP CX, 6
JB .copy_fn
CMP BYTE [SI], '-'
JNE .copy_fn
CMP BYTE [SI+1], '-'
JNE .copy_fn
MOV AL, [SI+2]
OR AL, 20h ; fold to lower case
CMP AL, 'w'
JNE .copy_fn
; Matched "--w..." — accept as --wrap
MOV BYTE [wrap_mode], 1
ADD SI, 6
SUB CX, 6

to

    ; Check for "/w" token
CMP CX, 2
JB .copy_fn
CMP BYTE [SI], '/'
JNE .copy_fn
; - DELETED -
; - DELETED -
MOV AL, [SI+1]
OR AL, 20h ; fold to lower case
CMP AL, 'w'
JNE .copy_fn
; Matched "/w"
MOV BYTE [wrap_mode], 1
ADD SI, 2
SUB CX, 2

After this quick fix the freshly compiled TEXTREAD.COM works fine and accepts only "/w" switch as "wrapper" activator.

DOS fan :: artificial "intelligence" - not a fan... not a fan at all :: is freeware a lie, when human freedom is a fundamental lie?

Reply 38 of 40, by aVd

User metadata
Rank Newbie
Rank
Newbie

Just did a quick wild test on TEXTREAD with 32MB online generated txt-file in DOSBox-X wirh emulated 8086 CPU... it's insane, it really works!

The attachment TEXTREAD_32MB_txt_on_8086.jpg is no longer available

Many thanks for this wonderful DOS tool, @cookertron!

The only thing, that I'll change in addition will be the variable for line wrapper, so it will be active by default. And the switch to "/u" (from "unwrap") for disabling the wrapper.

Changed code lines for default wrapper mode on

Line 5:

; Usage:  TEXTREAD [--wrap] <filename>

to

; Usage:  TEXTREAD [/u] <filename>

Line 117:

s_usage:     DB  'Usage: TEXTREAD [--wrap] <filename>',0Dh,0Ah,'$'

to

s_usage:     DB  'Usage: TEXTREAD [/u] <filename>',0Dh,0Ah,'$'

Line 318:

MOV     BYTE [wrap_mode], 0

to

MOV     BYTE [wrap_mode], 1

Lines 337-351:

    ; Check for "--wrap" token
CMP CX, 6
JB .copy_fn
CMP BYTE [SI], '-'
JNE .copy_fn
CMP BYTE [SI+1], '-'
JNE .copy_fn
MOV AL, [SI+2]
OR AL, 20h ; fold to lower case
CMP AL, 'w'
JNE .copy_fn
; Matched "--w..." — accept as --wrap
MOV BYTE [wrap_mode], 1
ADD SI, 6
SUB CX, 6

to

    ; Check for "/u" token
CMP CX, 2
JB .copy_fn
CMP BYTE [SI], '/'
JNE .copy_fn
; - DELETED -
; - DELETED -
MOV AL, [SI+1]
OR AL, 20h ; fold to lower case
CMP AL, 'u'
JNE .copy_fn
; Matched "/u"
MOV BYTE [wrap_mode], 0
ADD SI, 2
SUB CX, 2

DOS fan :: artificial "intelligence" - not a fan... not a fan at all :: is freeware a lie, when human freedom is a fundamental lie?

Reply 39 of 40, by cookertron

User metadata
Rank Member
Rank
Member
aVd wrote on Today, 13:00:
Hi, @cookertron, How do you compile "agent86" v.0.19.3? This time it throws me a bunch of errors, while trying […]
Show full quote

Hi, @cookertron,
How do you compile "agent86" v.0.19.3? This time it throws me a bunch of errors, while trying

i686-w64-mingw32-g++ -std=c++17 -O2 -static -o agent86.exe main.cpp

or

x86_64-w64-mingw32-g++ -std=c++17 -O2 -static -o agent86_x64.exe main.cpp

?

At least the prebuild agent86 0.19.3 seems to work and I managed to compile the latest TEXTREAD.ASM 😀

If you don't mind, I fixed the strange "--w___" switch acceptance, by replacing the switch with DOS-friendly "/w".

Changed code lines

Line 5:

; Usage:  TEXTREAD [--wrap] <filename>

to

; Usage:  TEXTREAD [/w] <filename>

Line 117:

s_usage:     DB  'Usage: TEXTREAD [--wrap] <filename>',0Dh,0Ah,'$'

to

s_usage:     DB  'Usage: TEXTREAD [/w] <filename>',0Dh,0Ah,'$'

Lines 337-351:

    ; Check for "--wrap" token
CMP CX, 6
JB .copy_fn
CMP BYTE [SI], '-'
JNE .copy_fn
CMP BYTE [SI+1], '-'
JNE .copy_fn
MOV AL, [SI+2]
OR AL, 20h ; fold to lower case
CMP AL, 'w'
JNE .copy_fn
; Matched "--w..." — accept as --wrap
MOV BYTE [wrap_mode], 1
ADD SI, 6
SUB CX, 6

to

    ; Check for "/w" token
CMP CX, 2
JB .copy_fn
CMP BYTE [SI], '/'
JNE .copy_fn
; - DELETED -
; - DELETED -
MOV AL, [SI+1]
OR AL, 20h ; fold to lower case
CMP AL, 'w'
JNE .copy_fn
; Matched "/w"
MOV BYTE [wrap_mode], 1
ADD SI, 2
SUB CX, 2

After this quick fix the freshly compiled TEXTREAD.COM works fine and accepts only "/w" switch as "wrapper" activator.

I've been using Microsoft Visual Studio Community 2026. This is the contents of the batch file I use to build Agent86:

@echo off
setlocal

call "E:\Microsoft Visual Studio\18\Community\VC\Auxiliary\Build\vcvars64.bat" >nul 2>&1

cl.exe /O2 /EHsc /std:c++17 /Fe:agent86.exe ^
src\main.cpp ^
src\lexer.cpp ^
src\symtab.cpp ^
src\expr.cpp ^
src\asm.cpp ^
src\encoder.cpp ^
src\jit\decoder.cpp ^
src\jit\emitter.cpp ^
src\jit\jit.cpp ^
src\jit\dos.cpp ^
src\jit\kbd.cpp

del *.obj 2>nul

endlocal

This is the output:

Microsoft (R) C/C++ Optimizing Compiler Version 19.50.35726 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

main.cpp
lexer.cpp
symtab.cpp
expr.cpp
asm.cpp
encoder.cpp
decoder.cpp
emitter.cpp
jit.cpp
dos.cpp
kbd.cpp
Generating Code...
Microsoft (R) Incremental Linker Version 14.50.35726.0
Copyright (C) Microsoft Corporation. All rights reserved.

/out:agent86.exe
main.obj
lexer.obj
symtab.obj
expr.obj
asm.obj
encoder.obj
decoder.obj
emitter.obj
jit.obj
dos.obj
kbd.obj

Asus P5A v1.06, Gigabyte GA-6BXDS, Soyo SY-5EMA (faulty), Viglen 486, Asus SP97-V