VOGONS


Reply 40 of 79, by curvedline

User metadata
Rank Newbie
Rank
Newbie

JFC is a jeff's file compare program, jeff might be the maker of xtree(but i forgot if it was johnson or jeff). anyway ztree uses the jeff's file compare util,

a long ago, back in the win98's time, i probably used either JFC or some other file compare utility (i forgot the exact story, lets just say JFC at this point)to compare files, it said to use maybe 10%~20% of bytes to check a file, maybe faster than a total check (i also forgot if this was true).

i modified a byte in the file and let it compare, it gave me "identical" as an answer , after that, i lost much confidence with it, i went straight back to comp.exe and not even to fc.exe

about IDSIZCRC.COM
how can IDSIZCRC.COM detect 1 byte change?

it would take several hours if not a day for a file compare util to check about a terra byte size two files
why would they compare two files through byte by byte in old way?

the filesizes are already given, so why wouldnt they just add these numbers together filesize + %65536 or 65536*? and compare both terra byte size files in a second, (what are % *? symbols by 65536)

crc.com dune2.exe COxKF2
crc.com dune2f.exe gTGKF2
how did IDSIZCRC know the 1 byte of dune2f.exe that was changed without the actual HDD's spindle hovering on that byte.
probably a polynomial crc algorithm as you said... but it still must somehow hover over the effected byte

Reply 41 of 79, by DaveDDS

User metadata
Rank Oldbie
Rank
Oldbie
curvedline wrote on 2025-02-05, 02:24:

i modified a byte in the file and let it compare, it gave me "identical"
as an answer , after that, i lost much confidence with it, i went
straight back to comp.exe and not even to fc.exe

Wow - thats pretty scary... I wouldn't trust it either!

about IDSIZCRC.COM how can IDSIZCRC.COM detect 1 byte change? […]
Show full quote

about IDSIZCRC.COM
how can IDSIZCRC.COM detect 1 byte change?

it would take several hours if not a day for a file compare util to check
about a terra byte size two files
why would they compare two files through byte by byte in old way?

CRCs are a bit tricky to implement, many programmers find them to hard,
a simple byte by byte compare is much easier!

Such error-checking is most commonly used in communications, and the
problems with byte-by-byte are 1) you would have to send the entire
data stream twice to compare and 2) if the same error occurs in both
transmissions you can't detect it - while this may seem highly
unlikely, consider a communications stream that should transfer 8-bit
values, but do to misconfigure - only transmits 7 bits... both copies
would be WRONG, but would both be the SAME.

So what you really want is an "error detect" sequence that is much smaller
and it's content will not be directly related to the actual data.

Early communications protocols, used "checksums" - this is just adding up
all the bytes in a data-frame, then sending it afterward. The receiver
would do the same thing, and compare the checksum it calculated to the
one send by the transmitter ... if not the same, the data-frame was not
received correctly and you ask the transmitter to send it again.

But - as I mentioned earlier, checksums are not a terribly reliable way
to tell if data has been corrupted - swapping two bytes (or sending them
in any order) will give the same checksum, bytes can be "offset" by a total
of the same amount +&- and the data frame still has the same checksum even
though it's content is very different.

CyclicRedundancyCheck on the other hand is designed to make each bit sent
affect the error-check value in a different way than the same bits in
different positions. MUCH harder to accidentally "fool" (but not
impossible - there is no way to 1,000,000+% insure that data is
transmitted through a corruptible medium - but CRC makes it VERY
unlikely that accidental errors will go undetected.

and IDSIZCRC doesn't have to read/process both files .. just like data
transmission it only reads one file, and compares the calculated size/CRC
with the one(s) you calculated earlier.

Btw, you mentioned that you "changed one byte" and the compare program
you used said "identical" - I don't know what it was using, a byte-by-byte
compare would have seen the chance. A checksum would have seen the change
(checksums are vulnerable to multiple changes being undetected, but a single
change should have triggered it!) ... real fail IMHO

CRCs were traditionally fairly slow to calculate, but once the pre-
calculated polynomial table method was invented, it became VERY fast
to calculate.

BTW: Back in the day, my company DDS sold a number of software packages,
and one of the most popular was my Micro-C compiler (A development toolset
primarily for embedded systems) - I made the PC version of it available for
free - and one of the example programs I included "VALIDATE.C" was provided
by a good friend of mine, and has very good descriptive comments which tell
a lot about how CRCs & polynomials work.

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 42 of 79, by curvedline

User metadata
Rank Newbie
Rank
Newbie

what does it take for IDSIZCRC.COM return with COxKF2?
IDSIZCRC.COM %1 A
echo %A%
giving you the answer in this way is NOT ever meant in DOS batch, is this correct? (including windows DOS batch)

instead of
set K1=crctemp1.txt
set K2=crctemp2.txt
IDSIZCRC.COM ceckme.exe > %K1%
IDSIZCRC.COM %1 > %K2%

FOR /F "Delims=" %%V IN ('TYPE "%K1%"') DO ( set V1=%%VV)
FOR /F "Delims=" %%V IN ('TYPE "%K2%"') DO ( set V2=%%VV)
IF "%V1%"=="%V2%" ECHO identical
IF NOT "%V1%"=="%V2%" ECHO different
del "%k1%"
del "%k2%"

Mr. DaveDDs you gave me an opportunity to revitalize my XTREE's F9 application menu, i havent edited xtree's F9's batch application menu, this task all went to ZTREE's
what is the xtree and ztree's F9's batch application menu? it is like the windows context menu. while windows context menu can have several entries maybe 10 at most but with ztree, i currently use about 20000 entries, it is really no match.
now IDSIZCRC.COM can do what windows can not do, i kind of integrated IDSIZCRC.COM in xtree for dosbox and dosbox-x directly, and integrating with ztree with the Full FOR DO () batch capacity could be good, but i have to invoke dosbox at the end, processing will be slow

Reply 43 of 79, by curvedline

User metadata
Rank Newbie
Rank
Newbie

back in the day, i lost and wasted a significant portion of my life for checking errors in the DVDs(and CDs), i thought one-time DVD writable gonna last forever, but some of them started to go bad maybe within 3 weeks to 6 months, after a certain point, if i saw one small CRC checking process, i'd remake that DVD and throw away the effected DVD, then i threw away all one-time writable DVDs, when HDDs were cheap. CRC checking of CD and DVDs was funny, at some point, it said unrecoverable totally bad, then few days later, after struggling for 1~2 hours(when it should only take 10 min to write one) then it copied the DVD correctly with several different DVD drives, so it made me stare at those going bad DVDs endlessly hoping to copy them to HDD this time correctly or i'd lose data. now this behavior later went on to HDDs, if i saw CRC checking of a HDD, i mmediately checked if the cables were tightened up, if not solved, then i had to do file comparisons for days and days till to make sure the data were same as some backup data then bought a new HDD right away, CRC checking(or the data transfer rate) was the indication to me to change the HDDs BEFORE TOO LATE

Reply 44 of 79, by DaveDDS

User metadata
Rank Oldbie
Rank
Oldbie
curvedline wrote on 2025-02-05, 03:56:
what does it take for IDSIZCRC.COM return with COxKF2? IDSIZCRC.COM %1 A echo %A% giving you the answer in this way is NOT e […]
Show full quote

what does it take for IDSIZCRC.COM return with COxKF2?
IDSIZCRC.COM %1 A
echo %A%
giving you the answer in this way is NOT ever meant in DOS batch, is this correct? (including windows DOS batch)

I'm not sure what you are trying to do, I assume this is a .BAT
file, %1 would be the first argument.. 'A' would be an IDSIZCRC value,
- being less than 3 chars, it means the SIZ part is 0.

As it happens the IDSIZCRC of a zero-length file is: ZZe

R:\> xdir/cu zlen
25-02-05 7:55a 0 R:\ZLEN
R:\> idsizcrc zlen
ZZe

>IDSIZCRC anyfile A
would never match, and would always return ERRORLEVEL=0

I don't think you completely understand what IDSIZCRC does... consider
this simple A1.ASM program (source is for my own ASM86):

        ORG     $100            ; .COM address
MOV DX,#MSG ; Point to message
MOV AH,#9 ; DOS func#5
INT 21h ; Call DOS
RET ; Exit
MSG STR 'Test #1$' ; Message to display

Assemble this to A1.COM then copying/patch to A2.COM, A3.COM and A4.COM
each with a 1-byte different message, we get 4 programs:

R:\>a1
Test #1
R:\>a2
Test #2
R:\>a3
Test #3
R:\>a4
Test #4

R:\> dump a1.com
0000 BA 08 01 B4 09 CD 21 C3 54 65 73 74 20 23 31 24 ......!.Test #1$
R:\> dump a2.com
0000 BA 08 01 B4 09 CD 21 C3 54 65 73 74 20 23 32 24 ......!.Test #2$
R:\> dump a3.com
0000 BA 08 01 B4 09 CD 21 C3 54 65 73 74 20 23 33 24 ......!.Test #3$
R:\> dump a4.com
0000 BA 08 01 B4 09 CD 21 C3 54 65 73 74 20 23 34 24 ......!.Test #4$

Running IDSIZCRC on these:

R:\>idsizcrc a1.com
6Wd4
R:\>idsizcrc a2.com
6Kd4
R:\>idsizcrc a3.com
6Od4
R:\>idsizcrc a4.com
6Cd4

And using IDSIZCRC to test the files:

R:\>errlvl idsizcrc a1.com 6Wd4 6Kd4 6Od4 6Cd4
ErrorLevel=1
R:\>errlvl idsizcrc a2.com 6Wd4 6Kd4 6Od4 6Cd4
ErrorLevel=2
R:\>errlvl idsizcrc a3.com 6Wd4 6Kd4 6Od4 6Cd4
ErrorLevel=3
R:\>errlvl idsizcrc a4.com 6Wd4 6Kd4 6Od4 6Cd4
ErrorLevel=4
R:\>errlvl idsizcrc zlen 6Wd4 6Kd4 6Od4 6Cd4
ErrorLevel=0

note: The last one 'zlen' doesn't match ANY of the supplied idsizcrc values!

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 45 of 79, by curvedline

User metadata
Rank Newbie
Rank
Newbie

have you heard of xtree and ztree by any chance?
i put this code in xtree and it relentlessly sends me data, with a single key press while browsing files.

SET A1=E:\UTILITY\DOSBOX-X\UTIL
SET CRC=IDSIZCRC.COM
ECHO checking file: %1
%A1%\%CRC% %1
pause

**********************
or xtree can generate a batch with 1000s lines like below maybe in 1 ~2 sec
xtree puts a do-loop around a simple program with %1 for all filenames as variables from all branch directories and creates a batch like this, they made this software about 35 years ago.

idsizcrc.com C:\!ALBION.TXT
idsizcrc.com C:\ALBION.EXE
idsizcrc.com C:\DOS4GW.EXE
idsizcrc.com C:\INSTALL.SCR
idsizcrc.com C:\SETUP.EXE
idsizcrc.com C:\SETUP.INI
idsizcrc.com C:\DISC\ALBION.ISO -- cant be checked, 460M bytes and 4 min later i stopped
idsizcrc.com C:\DRIVERS\ADLIB.MDI
idsizcrc.com C:\DRIVERS\ADLIBG.MDI
idsizcrc.com C:\DRIVERS\ADRV688.DIG
idsizcrc.com C:\DRIVERS\AILDRVR.LST
idsizcrc.com C:\DRIVERS\SNDSYS.DIG
idsizcrc.com C:\DRIVERS\TANDY.MDI
idsizcrc.com C:\DRIVERS\ULTRA.DIG
idsizcrc.com C:\DRIVERS\ULTRA.MDI
idsizcrc.com C:\SAVES\SAVE.100
idsizcrc.com C:\XLDLIBS\PALETTE.000
idsizcrc.com C:\XLDLIBS\PALETTE0.XLD
idsizcrc.com C:\XLDLIBS\CURRENT\AUTOMAP1.XLD
idsizcrc.com C:\XLDLIBS\CURRENT\AUTOMAP2.XLD
idsizcrc.com C:\XLDLIBS\INITIAL\PRTCHAR1.XLD
idsizcrc.com C:\XLDLIBS\INITIAL\PRTCHAR2.XLD
.
.
.
when i checked idsizcrc.com C:\DISC\ALBION.ISO (460MB), it went endlessly, after 4 min checking i stopped . so it has a limit
but no big deal. i can compare small files for dosbox to select choices.

*********************************
another approach was the code below ran two doxbox consoles and 1 windows DOS console to get an answer

@ECHO OFF
SET S0=%~d0\UTILITY\DOSBOX
set K1=%S0%\!prog1\CRCTEMP1.TXT
set K2=%S0%\!prog1\CRCTEMP2.TXT
SET D0=%S0%\dosbox.exe
SET C0=dosbox.conf

SET D1=CRC1.BAT
"%D0%" "%D1%" -conf "%S0%\%C0%" -EXIT

SET D1=CRC2.BAT
"%D0%" %D1% -conf "%S0%\%C0%" -EXIT

TYPE "%K1%"
TYPE "%K2%"
FOR /F "Delims=" %%V IN ('TYPE "%K1%"') DO ( set V1=%%VV)
FOR /F "Delims=" %%V IN ('TYPE "%K2%"') DO ( set V2=%%VV)
IF "%V1%"=="%V2%" ECHO identical
IF NOT "%V1%"=="%V2%" ECHO different
del "%k1%"
del "%k2%"

rem where
CRC1.BAT has
E:\Utility\DOSBox-x\UTIL\IDSIZCRC.COM C:\aaa.exe > crctemp1.txt

CRC2.BAT has
E:\Utility\DOSBox-x\UTIL\IDSIZCRC.COM C:\bbb.exe > crctemp2.txt

Reply 46 of 79, by DaveDDS

User metadata
Rank Oldbie
Rank
Oldbie
curvedline wrote on 2025-02-06, 10:43:

have you heard of xtree and ztree by any chance?

Yes, I used XTREE many years ago ... but for things like you described, I tend to use my own WDIR (Walk DIRectory)
which can execute any command I give it on all matching files in a directory (or whole tree).

when i checked idsizcrc.com C:\DISC\ALBION.ISO (460MB), it went endlessly, after 4 min checking i stopped . so it has a limit
but no big deal. i can compare small files for dosbox to select choices.

No, IDSIZCRC isn't "endless", but calculating CRC (even with table
algorithm) is fairy processor intensive, and DosBox is SLOW!

To be honest, I did't really consider huge files when I wrote IDSIZCRC
(in communications where I "normally" use CRCs - you are usually doing
fairly small buffers) because most DOS executables aren't that big ...
so I just happened (out of habit) to use C standard buffered I/O, and
worked on a 256 byte buffer at a time.

My DosBox is set to CYCLES=MAX, and using about 10mb test file:

R:\>xdir/scu TST.BIN
25-02-06 7:31a 9,999,000 R:\TST.BIN
R:\>timeit idsizcrc tst.bin
yg2Ah2
Elapsed time: 00:00:07.91

Takes about 8 seconds, extrapolating to 460mb would be 8*46 or about
368 sonds (6 mins)

So I was able to about double IDSIZCRCs speed by switching to an 8192
(8k) internal buffer and using unbuffered I/O (DOS reads file directly into
my buffer)

R:\>timeit idsizcrc tst.bin
yg2Ah2
Elapsed time: 00:00:03.68

About 4 seconds, 4*46 = 184 seconds (about 3 mins)

Obviously still to long to "wait" but a lot faster.. (and should be very
good for more "normal" files).

I've also added a "-Test" option to IDSIZCRC where it will show you how it
is progressing ('.' every 256 buffers : about 2m and lets you press ESC
to stop it)

I have updated: .../Drop/IDSIZCRC.ZIP

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 47 of 79, by curvedline

User metadata
Rank Newbie
Rank
Newbie

IDSIZCRC .com -T %1 is about 2.5~3 times faster than the old one,

i ran the old IDSIZCRC .com with dosbox-x
IDSIZCRC .com A.iso took 63 sec

i ran the new IDSIZCRC .com with dosbox-x
IDSIZCRC .com -T A.iso took 25 sec

at dosbox-x console prompt
IDSIZCRC .com -T A.iso took 22 sec

at xtrees' applicaion menu under dosbox-x took longer than dosbox-x's nautral prompt, this is odd
IDSIZCRC .com -T A.iso took 25 sec

at xtrees' console prompt under dosbox-x
i ran a single batch that listed about 100 command lines like this

IDSIZCRC .com -T 1.txt
IDSIZCRC .com -T 2.txt
IDSIZCRC .com -T 3.txt
.
.
.
.
IDSIZCRC .com -T 100.txt
IDSIZCRC .com -T A.iso

just because IDSIZCRC .com -T A.iso was around with other command lines
xtree ran IDSIZCRC .com -T A.iso slow and took 70 sec
xtree and ztree are kind of my life
now i need to check this again in a real DOS pc someday, whatever the reason was, this xtree behavior was unacceptable, it should run the same, shouldnt it?

xtree in dosbox max cycles
xtree's menu ran IDSIZCRC .com -T A.iso took 105 sec
iDSIZCRC .com -T is about 3 times faster
thanks for this, the new one was fast

************************
i downloaded Micro-C DOS.ZIP i have no idea what this is
i have never loaded an assemble file, because i have never seen an assembler compiler. so i dont know how to run it either
but i have read an advanced DOS book, so i kind of seen these notations
AH AL ..one is high and the other low if my memory is correct, it got 5 of highs and 5 of lows.. hmm maybe 4.. that is as far as i can go
my DOS true basic compiler can use the assembler compiled files and they can return values and variables to the true basic scripts... but i dont know how to link them obviously... not my area.

Reply 48 of 79, by DaveDDS

User metadata
Rank Oldbie
Rank
Oldbie
curvedline wrote on 2025-02-07, 16:38:

IDSIZCRC .com -T %1 is about 2.5~3 times faster than the old one,

Good tolknow it's helping / doing better.
Note that the difference in time is mainly the speed of buffered file
access ... you are testing on BIG files!

I don't know why you are seeing a difference in XTREE speed running
IDSIZCRC - it *should* be the same as running under native DOS - but
a problem with using stuff you didn't write yourself is that you can't
know exactly what it's doing? Perhaps it's trapping/inserting extra
handling for some DOS or BIOS interrupts... That would let them track and
report on certain conditions, and I doubt you'd notice if of you were not
doing such fast access to such a big file.

i downloaded Micro-C DOS.ZIP i have no idea what this is

This is my C development toolset for the PC - if you have no interest in
learning to program the PC in C .. just ignore it.

If you want to recompile IDSRZRCR.C which I posted, this is basically
what you will have to do.

Make sure you read that documentation (There's a LOT) this will tell you
pretty much everything you need to know, from how to set up the compiler,
the available Micro-C/PC library functions, to "a introduction to C"

- Unpack MCDOS.ZIP into the directory where Micr0-C/PC will live.
I usually use: C:\MC
>set MCDIR=C:\MC

- As the compiler runts it's steps, it use some TEMP files.
I usually use my R:\ ramdisk - but you can use any location
>set MCTMP=R:\

- Before you compile IDSIZCRC.C, you need to get CHT.ZIP (C Help Text)
from my site - run CHT IDSIZCRC.C - that will generate the HELP.H
include file that IDSIZCRC.C #includes from "/*ChtTxt ..." comments in
the IDSIZCRC.C source file.

- Compile with: CC IDSIZCRC -pof
-P means use the fill C Pre-processor
-O means Optimize the output (slightly better code)
-F means Fold constant strings (C standard says "TestString" and "String"
should be stored independently in the program image. But I like to save
space by "folding" them so that "String" is just "TestString"+4

but i have read an advanced DOS book, so i kind of seen these notations
AH AL ...

This is details of the 80x86 instruction set, and won't be of concern to you
unless you get into assembly programming. C will be closer to ASM that BASIC
but still removed from these details.

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 49 of 79, by curvedline

User metadata
Rank Newbie
Rank
Newbie

is there a way to use the CTRL-Break combo key (not the Ctrl-C, ) to stop a program from running further?
the syntax would be like this
"CtrlBrk.com TBasic.exe" lets TBasic use the CTRL-break key to stop from running

SUB SET_INTERRUPT1(VECTOR,AH,AL,BH,BL,CH,CL,DH,DL,AX,BX,CX,DX,SI,DI,BP,DS,ES)
DECLARE DEF INTERRUPT !LIBRARY"INT_DOS.TRC" MUST BE DECLARED
CALL PACKB(REGS$,1,8*18,0) !18 BYTES
!------------------------------
CALL PACKB(REGS$, 1, 8,AH) !AH MUST BE DECIMAL
CALL PACKB(REGS$, 9, 8,AL) !VECTOR MUST BE DECIMAL
CALL PACKB(REGS$, 17, 8,BH)
CALL PACKB(REGS$, 25, 8,BL)
CALL PACKB(REGS$, 33, 8,CH)
CALL PACKB(REGS$, 41, 8,CL)
CALL PACKB(REGS$, 49, 8,DH)
CALL PACKB(REGS$, 57, 8,DL)
!---------------
CALL PACKB(REGS$, 65,16,SI)
CALL PACKB(REGS$, 81,16,DI)
CALL PACKB(REGS$, 97,16,BP)
CALL PACKB(REGS$,113,16,DS)
CALL PACKB(REGS$,129,16,ES)
!------------INPUT-------------
!------------------------------
LET N = INTERRUPT(VECTOR,REGS$)
!------------------------------
!------------OUTPUT------------
LET AH=UNPACKB(REGS$, 1, 8) !1-8
LET AL=UNPACKB(REGS$, 9, 8) !9-16
LET BH=UNPACKB(REGS$, 17, 8) !17-24
LET BL=UNPACKB(REGS$, 25, 8) !25-32
LET CH=UNPACKB(REGS$, 33, 8) !33-40
LET CL=UNPACKB(REGS$, 41, 8) !41-48
LET DH=UNPACKB(REGS$, 49, 8) !49-56
LET DL=UNPACKB(REGS$, 57, 8) !57-64
!------------------------------
LET AX=UNPACKB(REGS$, 1,16) !1-16
LET BX=UNPACKB(REGS$, 17,16) !17-32
LET CX=UNPACKB(REGS$, 33,16) !33-48
LET DX=UNPACKB(REGS$, 49,16) !49-64
LET SI=UNPACKB(REGS$, 65,16) !65-80
LET DI=UNPACKB(REGS$, 81,16) !81-96
LET BP=UNPACKB(REGS$, 97,16) !97-112
LET DS=UNPACKB(REGS$,113,16) !113-128
LET ES=UNPACKB(REGS$,129,16) !129-144
END SUB
SUB ASK_DRIVE(DRIVE$,DRIVE)            !INPUT: NONE        !DOS book Page 306
LET VECTOR = 33 !INT 21H=33
LET AH = 25 !19H=25
CALL SET_INTERRUPT1(VECTOR,AH,AL,BH,BL,CH,CL,DH,DL,AX,BX,CX,DX,SI,DI,BP,DS,ES)
LET DRIVE = AL !OUTPUT:DRIVE{CURRENT DRIVE YOU ARE IN}
LET DRIVE$ = CHR$(ORD("A")+DRIVE)&":\" !DRIVE=> "2=C", "3=D", "4=E"..
END SUB !ORD("A")=65
!-----------------------------------------------------------------------------
SUB SET_DRIVE(DRIVE) !CHANGE TO THE DRIVE YOU WANT
LET VECTOR = 33 !INT 21H=33
LET AH = 14 !0EH =14
LET DL = DRIVE !INPUT : DRIVE=> "2=C", "3=D", "4=E"..
CALL SET_INTERRUPT1(VECTOR,AH,AL,BH,BL,CH,CL,DH,DL,AX,BX,CX,DX,SI,DI,BP,DS,ES)
LET TOTAL_DRIVE = AL !TOTAL NUMBER OF DRIVE IN DOS IS 26
END SUB

this small thing , INTERRUPT(VECTOR,REGS$) was $60, back in the day.

although i have never seen an assembler compiler like MSAM, True Basic's text code can use the values and variables that are produced by the assembler, back in the day, i used an advanced DOS book and created few simple examples for learning.
i generalized the structure SUB SET_INTERRUPT1(VECTOR,AH,AL,BH,BL,CH,CL,DH,DL,AX,BX,CX,DX,SI,DI,BP,DS,ES), the advan dos book was too sporadic about telling the exact registries??? last time i played with INTerrupt was 30+ years ago.

i always write numerical programs with DOS computers, i can not do them with windows, my logical thought stops flowing in the windows version truebasic editor, once done, i can port them to windows and add colors and other aesthetical things.
a big limit of using the DOS version truebasic under windows is vdosplus dosbox, dosboxx do not support ctrl-break key, it cant stop. for what i am doing, that is equal to a death, turning on a DOS pc that is not even on my main house table is ... very unappealing

Reply 50 of 79, by DaveDDS

User metadata
Rank Oldbie
Rank
Oldbie
curvedline wrote on 2025-02-09, 03:04:

is there a way to use the CTRL-Break combo key (not the Ctrl-C, ) to stop a program from running further?
the syntax would be like this
"CtrlBrk.com TBasic.exe" lets TBasic use the CTRL-break key to stop from running

Not that I've found in DosBox .. thats why I wrote _PAUSE,
to let me halt .BAT files...

The only semi-reliable way I've found is to asychronously stop a program
running under DosBox is to "save the state" just before running
the program and "remove the saved state" after the program runs.

Saving the state means creating "%TEMP%$DBBOOT$.BAT which has
connads to:
set any environment variables not set in Z:\AUTOEXEC.BAT
CD to whatever drive/directory you are currently in

My DosBox.ini (AUTOEXEC section) contains:

--------------------------------------------
if not exist %TEMP%$DBBOOT$.BAT goto noboot
call %TEMP%$DBBOOT$.BAT
del %TEMP%$DBBOOT$.BAT
:noboot
--------------------------------------------

So.. if I want to stop a the running program, I shut down
DosBox ... then re-launch it.

If you want to get fancy, right after the above IF you can
prompt with something like "Resume where you left off?" and
"call %TEMP%$DBBOOT$.BAT" only if a Yes answer!

As per above request, you could write CtrlBrk to:
save the state to: %TEMP%$DBBOOT$.BAT
run the program
delete %TEMP%$DBBOOT$.BAT

I don't know if you could actually make it work with CTRL-BREAK,
perhaps the DosBox keymapper can make this key terminate DosBox?

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 51 of 79, by DaveDDS

User metadata
Rank Oldbie
Rank
Oldbie

I don't know why I'd never tried this before... but I just did a "quick test":

My TFB (TsrFileBrowser) actually works under DosBox and will pop-up the
file browser when another program is running...

So you could make a little TSR which when activated by the right hotkeys,
would save the state as described above and restart DosBox ... effectively
making a "stop everything" hotkey!

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 52 of 79, by curvedline

User metadata
Rank Newbie
Rank
Newbie

i dont think _pause.com would work, even if it works, i must include this in call dosshell("_pause.com", return) inside the true basic code.
i dont need to save the current state of hardware or OS's something when _pause.com is invoked.
cos or sin or some other functions probably causing something not to converge or the gradient arrows are too big or mostly used the incorrect math, putting "stop before exit" everywhere in a controlled code is just not viable, "10 stops" per file, 1000 files = i need to put 10000 times all over the scripts. it is not just stop, controlled stop
something like
t1=time
t2=time
if t2-t1 >10 sec then stop
or
do
if key input then stop
loop
..just closing the dosbox-x is probably better and start over.

let me see if i could find TFB (TsrFileBrowser) in your website

would you like to try my two DOS programs and 2 win programs (i ported to win)? could be fun....
SolarGPS.exe (DOS) if you know by roughly measuring the sun's location and time, it tells your location on earth, i also added a world clock in it
Solar GPS.exe(Win)
Timer.exe(DOS) if it is set for 10 sec, it rings in 10 sec, with the simplest interface
Xtree's XTG_MENU.DAT converter (win), it can let you add or include your batch files to xtree, without this xtree is unusable.

ps, if you could make a find.com for a single file checking or comp.com for two files checking to send errorlevel to a batch, i would be grateful

Reply 53 of 79, by DaveDDS

User metadata
Rank Oldbie
Rank
Oldbie
curvedline wrote on 2025-02-10, 05:02:

i dont think _pause.com would work, even if it works, i must include this in call dosshell("_pause.com", return) inside the true basic code.
i dont need to save the current state of hardware or OS's something when _pause.com is invoked.
...just closing the dosbox-x is probably better and start over.

_pause was made to let me easily pauuse/abort .BAT files. It has to be active/running,
so I wouldn't help interrupt a running program.

The "annoying" thing about closing/restarting DosBox is that you then have to move back to the directory where you
were working...

I've just tossed together DBRSTRES (DosBoxReSeTREStore) - a little TSR that you can use to setup some HotKeys which
will restart DosBox (ending anything that's running) and put you back at the DOS prompt in whatever directory
you were in when you pressed they hotkeys .. see <mysite>/Drop/DBRSTRES.ZIP

let me see if i could find TFB (TsrFileBrowser) in your website

It was one of the example programs I included with my C compiler (as source code). I've now published all that source code
(and much more) in the "Retirement project - release 40+ years worth of source code" section on my site.
You will have to figure out how to run my compiler to build an executable... (if you need me to, I can drop TFB.COM)

would you like to try my two DOS programs and 2 win programs (i ported to win)? could be fun.... SolarGPS.exe (DOS) if you know […]
Show full quote

would you like to try my two DOS programs and 2 win programs (i ported to win)? could be fun....
SolarGPS.exe (DOS) if you know by roughly measuring the sun's location and time, it tells your location on earth, i also added a world clock in it
Solar GPS.exe(Win)
Timer.exe(DOS) if it is set for 10 sec, it rings in 10 sec, with the simplest interface
Xtree's XTG_MENU.DAT converter (win), it can let you add or include your batch files to xtree, without this xtree is unusable.

Sure, I can take a look - btw, what Windows development toolset do you use?
I've never been a "big fan" of Winblows, but when I have to make a Win32 program, I tend to use LCC
(Little C Compiler) - a fairly decent/small C toolset for Win.

ps, if you could make a find.com or comp.com to send errorlevel to a batch, i would be grateful

As I mentioned before, those are able to do things with many files, and what to set ERRORLEVEL
to isn't obvious/best for most people.

I do think that I have a tool somewhere that might help you with most programs that don't set ERRORLEVEL...
It looks at the last (n) written lines on the screen and detects various strings that you supply, returning an
ERRORLEVEL corresponding to the first one it finds. Basically let ayou look for certain messages from the
last program you ran to see what it did/if it worked etc.

If you want it, I'll have to dig it up ... it's been a few years since I made use of it... but I'm pretty sure I would still
have it somewhere...

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 54 of 79, by curvedline

User metadata
Rank Newbie
Rank
Newbie

i uploaded to mega
https://mega.nz/file/zNRRFbjB#qwkx5iNeCh0APSO … ei_60JofqWtj0aA

>btw, what Windows development toolset do you use?
toolkits\3DGraph\, BasicToTB\,BTree\,Complex variables,CSubs,FortranToTB,Huge number,Statistics Graf... all tools in there are for mathematics
all i do is run TBGold.exe, it does what it does, it has these two files TBGold.exe and tbsystem.exe and 2 dlls and nothing else. all others are just maths related.

DOS version is $500, win ver $100
or straight to WIn ver is $500
they ask each win upgrade for$100... they said upgrade would be free, but it was not
DOS ver was good, it stood with the same pedestal with fortran and pascal. the best known numerical recipes book has fortran, pascal, true basic and C versions
True Basic maker is Kemany, he is best known for Albert Einstein's math assistant, he was probably the one who invented these FOR next. do loop kind of things back in 1930s maybe, he was the member of manhattan project serving Compton and Richard Feymann

> but when I have to make a Win32 program, I tend to use LCC (Little C Compiler)
C is for system engineers, and for big programmers
Win T-basic 's syntaxes are just the same as the DOS version's but the windows T-Basic also has these CALL dir functions and typical window making things like clicking TAB icons. so far i didnt use any of those win's typical window making functions. i write in DOS and i compile in windows and that is all... at least i have one reason for it. i asked True basic to add or change the window making behavior. they refused , in order to use a keyboard in window frame, i have to use a mouse to click the window 1st, this mean every time i switch to a different window for 1 sec, i have to use a mouse to invoke the keyboard again and again. i went like fk this! you can see from my uploaded windows programs, they are looking just like the DOS versions . i simply ported without using any win library functions.

>The "annoying" thing about closing/restarting DosBox is that you then have to move back to the directory where you
were working...
completely understandable, this is why DOS's True Basic's built-in editor shines the most, this DOS compiler's line editor is a better editor than any other bestest editors in the world to me. but windows ver. True basic removed this and became very unusable

DOS True Basic's STARTUP.TRU file goes like this.. it can alias like mathematica
SPLIT 23;NOLET
ALIAS {DO},"",\TBDO\
ALIAS {LIBRARY},"",\TBLIBS\,\TBLIBS1\,\TBLIBS2\
ALIAS {L},"",\TBLIBS\,\TBLIBS1\,\TBLIBS2\
ALIAS {SCRIPT},"",\SCRIPT\
ALIAS {HELP},"",\TBHELP\
ALIAS {WB_C},"",\TBWB\

KEY FROM {DO}!KEY --> is the best macro ever
MENUS --> trash that eats memory
SWITCH --> trash that eats memory
COLORS FROM {DO}!COLORS
SCRIPT ST2.

SCRIPT runs and records ST2. that acts like another batch inside the batch, it will locate where i was in the script,
in other words, every ST2. has all different contents in it for every other directory .. filename and its last position if chosen
****************************
>As I mentioned before, those are able to do things with many files, and what to set ERRORLEVEL to isn't obvious/best for most people.
ok this means it is hard to isolate the script for doing one file? ok i will forget it.
***************************
i also have this problem,
i have this DOS editor that i am used to, back in the day, when science and math notation writing programs were not available. i modified its font database for 6month for my use, but i can NOT print out in dot-matrix anymore. if i choose an Epson dot matrix printer, i need something to hijack and translate it to any common laser printers, any idea how to achieve this?

Reply 55 of 79, by DaveDDS

User metadata
Rank Oldbie
Rank
Oldbie

Ok, I found (and cleaned up a little) my CMDOSS tool and posted it to my
site: .../Drop/CMDOSS.ZIP

CoMmanD Output Screen Scan : CMDOSS nlines strings... [options]

Scans last nlines of output to screen (starting at last non-blank line)
looking for the specified string(s) - if any found, returns ERRORLEVEL(1+)
indicating which string was found first (last on screen), or (0) if none
were found!

This makes it fairly easy to see if a command generates a certain output(s).
For example, my compiler says "All done" after a successful compile, so you
can see if the last compile worked:

C:\NEW>cc cmdoss -pof
DDS MICRO-C PC86 Compiler v3.23
cmdoss.C: Preprocess... Compile... Optimize... Assemble... Link TINY...
Turbo Link Version 2.0 Copyright (c) 1987, 1988 Borland International
All done.
C:\NEW>errlvl cmdoss 1 All~_done -q
ErrorLevel=1
C:\NEW>cc cmdoff -pof
DDS MICRO-C PC86 Compiler v3.23
cmdoff.C: Preprocess... cmdoff.C(0): Cannot open input file
MCP.EXE failed (255)
C:\NEW>errlvl cmdoss 1 All~_done -q
ErrorLevel=0

This might help with some of your tests!

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 56 of 79, by DaveDDS

User metadata
Rank Oldbie
Rank
Oldbie
curvedline wrote on 2025-02-10, 10:21:

i uploaded to mega
...
C is for system engineers, and for big programmers

The SolarGPS stuff looks really nice, and I'll have to spend some time with it - thanks!

I don't really use X-TREE so I've not looked at that one much.

I kinda liked your "TIMER"... nice simple way to do quick timer
with an alarm from the command line.

But you really might want to get to know 'C' for such "systems" programs 😀

TrueBasic TIMER.EXE is over 100k.
even after being compressed with UPX ... over 62k

Just for fun... I made my own TIMER.COM which looks kinda like it = a bit
smaller menu because I wanted to stick within an standard 80x25 PC text
screen. Alarm is via DOS beeper (which DosBox has more trouble with - but
nice and stable under DOS) I also added a few command line options (Preset
seconds/auto-start, set beep etc.) and some command line help.

Compiled with Micro-C/PC, < 7k ... after compression, < 5k.

If you want to look at how I did it - <mysite>/Drop/TIMER.ZIP
(no guarantee it's "bug free" - ripped it off in a few mins, and didn't spend
a lot of time testing)

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 57 of 79, by curvedline

User metadata
Rank Newbie
Rank
Newbie

::Find Screen String - IDSizCRC
@ECHO OFF
IDSizCRC.COM -T %1
SET SPEC=Gi20v2
ECHO.
ECHO checking file: %4.%5 if is the %SPEC%
CMDOSS.COM 25 %SPEC%
ECHO.
IF ErrorLevel 1 GOTO :Found
IF ErrorLevel 0 GOTO :NotFound
ECHO.

:Found
ECHO %SPEC% Found
GOTO :END

:NotFound
ECHO %SPEC% Not Found
GOTO :END

:END
PAUSE

you are a genius, now i can remove the code to generate the temporary files for TYPE command to directly read the Gi20v2 file identification

CMDOSS.COM has a limit in this test
TYPE %1
CMDOSS.COM 25 BLUE

CMDOSS.COM only can read if a TXT file has 25 lines or less or max 25x80 columns= 2000 chars
or the last 25 lines from the end of a file, in other words, it somehow captures a screen to find the string
there is no purpose of this command that is like CMDOSS.COM 50 BLUE, however "VGA mode"which might give 53 lines, it might

> All~_done maybe you can explain what "~ _ "are for?

it is tough to find a proper file name for CMDDOSS as to what it does .. that sort of represents the notions of
screen char capture
find screen string
ask screen character
i will take AskScrch for a while, unless the maker has something else in mind.

with CMDOSS.COM , two independent EXE programs can communicate through screen chars, and NOT by temp-files

thanks for this program

Reply 58 of 79, by curvedline

User metadata
Rank Newbie
Rank
Newbie

The SolarGPS stuff looks really nice, and I'll have to spend some time with it - thanks!

>I don't really use X-TREE so I've not looked at that one much.
i know yes you mentioned, but that MenuDAT converter could save someone's life, you can not type in 10000 lines of batch lines that were already written, you must be able to import or include or add. ztree can do this, but xtree can not. what was Johnson thinking not implementing this vital function in xtree?, ...just wanted to show my secret weapon

>I kinda liked your "TIMER"... nice simple way to do quick timer
>with an alarm from the command line.
>TrueBasic TIMER.EXE is over 100k. even after being compressed with UPX ... over 62k
there is a reason for this, when True BASIC binds a script file to make an EXE file, it loads all its libraries in it, all video modes, all numerical functions like cosines tangent exponential, erf function, you name it. the minimum size is about 75k byte.. like compile this print "a" as shortest you can get and make a bind EXE file, it still makes a 75kb file. because of this. i do not use the Binded EXE file made by True Basic, too slow in XTree but not unbearably, when my DOS batch knowing was lacking back in the day, i paved the XTree Menu with TB(true basic) binded programs

and I tried to port that timer to windows platform and it is still on going, but i lost a motivation to do so like 25 years ago, one of the True Basic's representatives refused my request with one shortest sentence, using a mouse in windows is trendy and keyboard is out the door, BUT "i have to use a mouse to invoke the keyboard again and again" explained this earlier. i went like fk this. I am using XTREE, ZTree, dos version Trrue basic , All these are unbeatable keyboard programs. all batch files are also for a keyboard.

>But you really might want to get to know 'C' for such "systems" programs 😀
one story to tell, when i worked in a company, when computer programmers saw my sine and cosine functions in my basic codes, they went like WTF?

>Just for fun... I made my own TIMER.COM which looks kinda like it = a bit smaller menu
the size can not be customized in TB DOS, it is a DOS program and TB, one fixed screen output 640x480 to the ends of the earth. if you look at the menu how it operates i designed it pixel by pixel, because there are no TB libraries like Fortran's IMSL, i made all from the basic bottoms, i can use that menu to navigate all Dirs and all files in branch trees and press it to make them do things and execute things, but that TB representative refused it. so i am going to make a graphic menu in windows style someday, but i havent moved the plan forwards for 25 years. and the window size in graphic style menu in TB can not be controlled, for that i must use the windows functions but the keyboard thing was not going the way i wanted. i lost the motivation

>because I wanted to stick within an standard 80x25 PC text
very understandable, but if graphics( not limited to 25-1 lines but 43-1 lines) for my use, i can also show pictures and add texts next to them while the menu navigates, i also made a TB scrap book of it basically it loads abc.pcx and abc.txt together

i will check your timer soon

Last edited by curvedline on 2025-02-11, 07:20. Edited 5 times in total.

Reply 59 of 79, by curvedline

User metadata
Rank Newbie
Rank
Newbie

>SolarGPS
one important, how science is at its work
simply is this...
you are in the middle of nowhere , and you know your time , year month date time
1. you mark the direction of the polar star at night
2. when the sun is up, you face the direction of the mark
3,. if the sun is behind you, you are most likely at the northern hemisphere which can remove the half the possibility of being in southern hemi.
4. spread your arm, and see if the sum is in the left side your arm, it is going to a dusk mode descending, and not dawn
5. now you check the sun's elevation, if high .. you are near equator, low then high latitude.
6 if you check this with a sextant or an angle meter, there is one unique location that belong to one particular location on earth, you move a mouse around and check two angles in the map, if similar that is your location

Peak actually means the sun's zenith position
red moon represents the moon's zenith position.
dawn means when the sun is WITHIN 6 degrees below the horizon and rising
dusk means when the sun is STILL WITHIN 6 degrees below the horizon, after that an official night begins
they said sea DUSK is defined as WITHIN 18 degrees below the horizon, because in the sea, you can still see much lights even after 6 degrees below

i hope this explanation to help to digest it better,
1st thing you do is you need to find your location's GMT and edit it in Solar GPS.ini then it will tell a world clock - extremely practical in graphics