VOGONS


DOS Notepad v1.1.0 [UPDATE]

Topic actions

Reply 40 of 46, by aVd

User metadata
Rank Newbie
Rank
Newbie

Thanks. I don't use windows, so I'll have to try crosscompiling in Code::Blocks as a project.

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

Reply 41 of 46, by roytam1

User metadata
Rank Member
Rank
Member
cookertron wrote on Yesterday, 17:21:
I've been using Microsoft Visual Studio Community 2026. This is the contents of the batch file I use to build Agent86: […]
Show full quote
aVd wrote on Yesterday, 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

your build.bat deleted in repo actually works, and I can use v141_xp (i.e. v14.16) to build and it even works in XP.
(just jit.cpp needs to include intrin.h for building in older MSVC)

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64_x86  -vcvars_ver=14.16

set PATH=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH%
set INCLUDE=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;%INCLUDE%
set LIB=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib;%LIB%
set CL=/D_USING_V110_SDK71_

cl.exe /EHsc /O2 /std:c++17 /Fe:agent86.exe %CL% src\main.cpp src\lexer.cpp src\expr.cpp src\symtab.cpp src\encoder.cpp src\asm.cpp src\jit\emitter.cpp src\jit\decoder.cpp src\jit\dos.cpp src\jit\kbd.cpp src\jit\jit.cpp /I src /link /SUBSYSTEM:CONSOLE,5.1

Reply 42 of 46, by aVd

User metadata
Rank Newbie
Rank
Newbie

Hi, guys,
Finally compiled latest Agent86 by using Mingw-w64 and Code::Blocks's project with all the cpp-files added like in @cookertron's bat-file.

Also, as @roytam1 I had to add "#include <intrin.h>" line in "jit.cpp" file, due to error preventing normal compilation.

Now I have 32 and 64bit Agent86 windows executabels. Thank you!

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

Reply 43 of 46, by roytam1

User metadata
Rank Member
Rank
Member
cookertron wrote on 2026-03-10, 23:53:
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 compl […]
Show full quote

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

I wonder if there is "direct viewing mode" to view file in any size that DOS/file system supports?

Reply 44 of 46, by cookertron

User metadata
Rank Member
Rank
Member
aVd wrote on Today, 06:34:
Hi, guys, Finally compiled latest Agent86 by using Mingw-w64 and Code::Blocks's project with all the cpp-files added like in @co […]
Show full quote

Hi, guys,
Finally compiled latest Agent86 by using Mingw-w64 and Code::Blocks's project with all the cpp-files added like in @cookertron's bat-file.

Also, as @roytam1 I had to add "#include <intrin.h>" line in "jit.cpp" file, due to error preventing normal compilation.

Now I have 32 and 64bit Agent86 windows executabels. Thank you!

Excellent, well done!

I was going to try and compile it for Linux myself tonight as I have Ubuntu installed on a partition. If successful I'll include the Linux build strategy in Agent86 readme.

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

Reply 45 of 46, by roytam1

User metadata
Rank Member
Rank
Member
aVd wrote on Today, 06:34:
Hi, guys, Finally compiled latest Agent86 by using Mingw-w64 and Code::Blocks's project with all the cpp-files added like in @co […]
Show full quote

Hi, guys,
Finally compiled latest Agent86 by using Mingw-w64 and Code::Blocks's project with all the cpp-files added like in @cookertron's bat-file.

Also, as @roytam1 I had to add "#include <intrin.h>" line in "jit.cpp" file, due to error preventing normal compilation.

Now I have 32 and 64bit Agent86 windows executabels. Thank you!

for mingw-w64 (I'm using strawberry perl x64 here, comes with gcc-8.3.0), following command line generates working x64 agent86.exe without linking to libgcc/libstdc++/libwinpthread DLL:

g++ -O3 -s -std=c++17 -static-libgcc -static-libstdc++ -o agent86 src\main.cpp src\lexer.cpp src\expr.cpp src\symtab.cpp src\encoder.cpp src\asm.cpp src\jit\emitter.cpp src\jit\decoder.cpp src\jit\dos.cpp src\jit\kbd.cpp src\jit\jit.cpp -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive

also tested strawberry-perl-5.38.2.1-32bit-portable.zip and its 32bit gcc-8.3.0 works with above command line as well.

Reply 46 of 46, by cookertron

User metadata
Rank Member
Rank
Member

Agent86 Linux executable added to repo (github:cookertron/Agent86)

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