Dear friends of batch programming,
Here are some of my batch files. I wrote them for the DOS of windows 9x. I don't know if they work with earlier DOS versions.

1. adding two numbers (3,7 KB)
2. adding two numbers (1,6 KB)

1. Add.bat (3,7 KB) adding two numbers:

@if %1_==$_ set [=%2
@if %1_==$_ goto xxxxxxx%2
@echo off
set ]=%%$
set [= %%$%%$%%$%%%2
goto %%$%%$%%$%%%2?
:%$%$%$%0
for %%0 in (%%) do set [=%]%0%[%
goto+%[%$
:%$%$%$%1
for %%1 in (%%) do set [=%]%1%[%
goto+%[%$
:%$%$%$%2
for %%2 in (%%) do set [=%]%2%[%
goto+%[%$
:%$%$%$%3
for %%3 in (%%) do set [=%]%3%[%
goto+%[%$
:%$%$%$%4
for %%4 in (%%) do set [=%]%4%[%
goto+%[%$
:%$%$%$%5
for %%5 in (%%) do set [=%]%5%[%
goto+%[%$
:%$%$%$%6
for %%6 in (%%) do set [=%]%6%[%
goto+%[%$
:%$%$%$%7
for %%7 in (%%) do set [=%]%7%[%
goto+%[%$
:%$%$%$%8
for %%8 in (%%) do set [=%]%8%[%
goto+%[%$
:%$%$%$%9
for %%9 in (%%) do set [=%]%9%[%
goto+%[%$
:%$%$%$%-
goto 
:%$%$%$%
if %]%_==_ goto 
if not c%[%==c set ]=
for %%+ in (%%) do set [=%%$%[%
goto+%[%

:%$%$%$%$
if %]%_==_ for %%$ in (" ") do %0 $ %[%$ "" %1
set ]=
for %%$ in (" ") do %0 $ 0 %[%$ "" %1

:xxxxxxx$
goto %30-
goto %31
:xxxxxxx0
for %%0 in ("set [=" goto:%30\) do %%%[%
for %%0 in ("set [=" goto:%31\) do %%%[%
:xxxxxxx1
for %%1 in ("set [=" goto:%31\) do %%%[%
for %%1 in ("set [=" goto:%32\) do %%%[%
:xxxxxxx2
for %%2 in ("set [=" goto:%32\) do %%%[%
for %%2 in ("set [=" goto:%33\) do %%%[%
:xxxxxxx3
for %%3 in ("set [=" goto:%33\) do %%%[%
for %%3 in ("set [=" goto:%34\) do %%%[%
:xxxxxxx4
for %%4 in ("set [=" goto:%34\) do %%%[%
for %%4 in ("set [=" goto:5%3\) do %%%[%
:xxxxxxx5
for %%5 in ("set [=" goto:5%3\) do %%%[%
for %%5 in ("set [=" goto:6%3\) do %%%[%
:xxxxxxx6
for %%6 in ("set [=" goto:6%3\) do %%%[%
for %%6 in ("set [=" goto:7%3\) do %%%[%
:xxxxxxx7
for %%7 in ("set [=" goto:7%3\) do %%%[%
for %%7 in ("set [=" goto:8%3\) do %%%[%
:xxxxxxx8
for %%8 in ("set [=" goto:8%3\) do %%%[%
for %%8 in ("set [=" goto:9%3\) do %%%[%
:xxxxxxx9
for %%9 in ("set [=" goto:9%3\) do %%%[%
for %%9 in ("set [=" goto:A%3\) do %%%[%
:00
:
shift
:0 ,
set ]=0%]%
goto:xxxxxxx%[%$
:10
:01
shift
:1
set ]=1%]%
goto xxxxxxx%[%$
:20
:11
:02
shift
:2
set ]=2%]%
goto xxxxxxx%[%$
:30
:21
:12
:03
shift
:3
set ]=3%]%
goto xxxxxxx%[%$
:40
:31
:22
:13
:04
shift
:4
set ]=4%]%
goto xxxxxxx%[%$
:50
:41
:32
:23
:14
shift
:5
set ]=5%]%
goto xxxxxxx%[%$
:60
:51
:42
:33
:24
shift
:6
set ]=6%]%
goto xxxxxxx%[%$
:70
:61
:52
:43
:34
shift
:7
set ]=7%]%
goto xxxxxxx%[%$
:80
:71
:62
:53
:44
shift
:8
set ]=8%]%
goto xxxxxxx%[%$
:90
:81
:72
:63
:54
shift
:9
set ]=9%]%
goto xxxxxxx%[%$
:A0
:91
:82
:73
:64
:55
shift
:A
set ]=0%]%
goto xxxxxxx%[%$.-
:A1
:92
:83
:74
:65
:56
shift
set ]=1%]%
goto xxxxxxx%[%$.-
:A2
:93
:84
:75
:66
:57
shift
set ]=2%]%
goto xxxxxxx%[%$.-
:A3
:94
:85
:76
:67
:58
shift
set ]=3%]%
goto xxxxxxx%[%$.-
:A4
:95
:86
:77
:68
:59
shift
set ]=4%]%
goto xxxxxxx%[%$.-
:A5
:96
:87
:78
:69
shift
set ]=5%]%
goto xxxxxxx%[%$.-
:A6
:97
:88
:79
shift
set ]=6%]%
goto xxxxxxx%[%$.-
:A7
:98
:89
shift
set ]=7%]%
goto xxxxxxx%[%$.-
:A8
:99
shift
set ]=8%]%
goto xxxxxxx%[%$.-
:A9
shift
set ]=9%]%
goto xxxxxxx%[%$.-

:%$%$%$%a
:%$%$%$%b
:%$%$%$%c
:%$%$%$%d
:%$%$%$%e
:%$%$%$%f
:%$%$%$%g
:%$%$%$%h
:%$%$%$%i
:%$%$%$%j
:%$%$%$%k
:%$%$%$%l
:%$%$%$%m
:%$%$%$%n
:%$%$%$%o
:%$%$%$%p
:%$%$%$%q
:%$%$%$%r
:%$%$%$%s
:%$%$%$%t
:%$%$%$%u
:%$%$%$%v
:%$%$%$%w
:%$%$%$%x
:%$%$%$%y
:%$%$%$%z
:%$%$%$%!
:%$%$%$%#
:%$%$%$%%
:%$%$%$%&
:%$%$%$%'
:%$%$%$%(
:%$%$%$%)
:%$%$%$%@
:%$%$%$%^
:%$%$%$%_
:%$%$%$%{
:%$%$%$%}
echo Invalid number!
goto End
:%$%$%$%
:
echo Syntax Error
goto End
:%$%$%$%?
echo 	Adds two numbers.
echo 	Usage: %0 VarName [+]number1[+number2]
goto end
:0
:written by Hermann Fritz December 2001
set %4=%]%
echo %4=%]%
:End
set [=
set ]=
2. Add.bat (1,6 KB) adding two numbers:
@echo off
set ]=
if %3_==_ for %%T in (echo goto:end) do %%T Syntax: %0 VarName Num1 Num2
set [o=0000000>%2.{a
set [q=???????>%3.{b
for %%T in (????.{?) do ren %%T 0000%%T
for %%T in (??????.{?) do ren %%T 00%%T
for %%T in (???????.{?) do ren %%T 0%%T
:loop
for %%T in (1 2 3 4 5 6 7 8 9 0) do if exist %[q%%%T*.{a set [a=%%T
for %%T in (1 2 3 4 5 6 7 8 9 0) do if exist %[q%%%T*.{b set [b=%%T
set \%[a%%[b%=" for %%T in (
set \%[b%%[a%=" for %%T in (
if not exist "\\%\09%%\18%%\27%%\36%%\45%0 9) do if %[%%\08%%\17%%\26%%\35%%\44%%\99%9 8) do if %[%%\07%%\16%%\25%%\34%%\89%8 7) do if %[%%\06%%\15%%\24%%\33%%\88%%\79%7 6) do if %[%%\05%%\14%%\23%%\78%%\69%6 5) do if %[%%\04%%\13%%\22%%\77%%\68%%\59%5 4) do if %[%%\03%%\12%%\67%%\58%%\49%4 3) do if %[%%\02%%\11%%\39%%\48%%\57%%\66%3 2) do if %[%%\01%%\56%%\47%%\38%%\29%2 1) do if %[%%\00%%\55%%\46%%\37%%\28%%\19%1 0) do if %[%0 " for %%T in (Error) do goto==%%T set ]=%%T%]%
if not not"""==%\55%%\46%%\37%%\28%%\19%%\56%%\47%%\38%%\29%%\39%%\48%%\57%%\66%%\67%%\58%%\49%%\77%%\68%%\59%%\78%%\69%%\88%%\79%%\89%%\99%not%\00%%\01%%\02%%\11%%\03%%\12%%\04%%\13%%\22%%\05%%\14%%\23%%\06%%\15%%\24%%\33%%\07%%\16%%\25%%\34%%\08%%\17%%\26%%\35%%\44%""" ") do set [=%%T
set \%[a%%[b%=
set \%[b%%[a%=
set [a=
set [b=
if exist %[o%*.{a if exist %[o%*.{b goto sum
for %%0 in ("=") do set [o%%%[o%
for %%? in ("=") do set [q%%%[q%
goto loop
:Error
echo invalid number!
set \%[b%%[a%=
set [a=
set [b=
goto end
:sum
if %[%_==1 set ]=1%]%
set %1=%]%
echo %1=%]%
:end
set ]=
set [o=
set [q=
set [=
:written by Hermann Fritz December 2001
if exist *.{? del *.{?