China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-31 22:26
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to use bitwise operations in set/a? View 7,271 Replies 42
Floor 16 Posted 2006-10-18 22:56 ·  中国 湖南 娄底 电信
银牌会员
★★★
Credits 1,218
Posts 485
Joined 2006-07-21 21:24
20-year member
UID 58987
From 湖南.娄底
Status Offline
Gaga~ The things in textbooks are all static. The most important thing is to know how to use them flexibly...
Floor 17 Posted 2006-10-18 22:57 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Floor 18 Posted 2006-10-18 22:57 ·  中国 北京 东城区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Suggest that the moderator and electronixtar start a new thread to discuss posts about batch processing bitwise operations. :)

Because there are very few schemes for using bitwise operations in batch processing, and these bitwise operations are mostly very wonderful in games. :)

So, if we start a new thread to discuss, there are several advantages:

) Increase the advanced essence content of the forum (rarely mentioned and applied in other forums)
) Facilitate future retrieval of this bitwise operation knowledge point
) Through everyone adding content together to discuss this bitwise operation, make it lively! Increase popularity! Increase advanced popularity (Oh~ that's called increasing fairy qi~ :)
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 19 Posted 2006-10-18 22:59 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
I saw nothing~~ I said nothing, I knew nothing~~

(Sneakily drag out Notepad to write code, read the help document in ntcmds.chm -_-! )

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 20 Posted 2006-10-18 22:59 ·  中国 湖南 娄底 电信
银牌会员
★★★
Credits 1,218
Posts 485
Joined 2006-07-21 21:24
20-year member
UID 58987
From 湖南.娄底
Status Offline
Originally posted by qwe1234567 at 2006-10-18 22:57:
There's no way, Microsoft doesn't have such instructions.


Hehe~ Just like what brother namejm said, the help of cmd is like a天书...
Floor 21 Posted 2006-10-18 23:02 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
namejm is snickering aside. Oh, I was originally writing VBS irregular form code, and now it's interrupted again. Ugh

Wengier, come here quickly, there are a group of people chatting in the forum. The moderator qwe1234567 is leading the chat, go and ban all their IPs~~~

[ Last edited by electronixtar on 2006-10-18 at 23:05 ]

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 22 Posted 2006-10-18 23:06 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
```
set /a a=0x01
set /a b=0x02
set /a c=0x01
set /a d=a^&b
set /a e=a^&c
```

Running results:

C:\Documents and Settings\est>set /a c=a^&b
0
C:\Documents and Settings\est>set /a d=0x1
1
C:\Documents and Settings\est>set /a c=a^&d
0
C:\Documents and Settings\est>set /a c=b^&d
0
C:\Documents and Settings\est>set /a a=0x01
1
C:\Documents and Settings\est>set /a b=0x02
2
C:\Documents and Settings\est>set /a c=0x01
1
C:\Documents and Settings\est>set /a d=a^&b
0
C:\Documents and Settings\est>set /a e=a^&c
1
C:\Documents and Settings\est>



Finished, bye
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
redtek +1 2006-10-18 23:07
fyb198351 +1 2007-04-17 20:09

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 23 Posted 2006-10-18 23:07 ·  中国 北京 东城区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Originally posted by electronixtar at 2006-10-18 23:02:
namejm is snickering aside. Oh, I was originally writing the code for irregular forms in VBS, and now it's interrupted again. Oh my...

Wengier, come here quickly, there are a group of people chatting here. Moderator qwe1234567 leads the chat, and let's all...


Writing a batch script to calculate lottery numbers is still interesting. When you win 5 million with the batch script you wrote, I'll give you 100,000. Haha...
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 24 Posted 2006-10-18 23:09 ·  中国 北京 东城区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Give electronixtar an extra point~:)
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 25 Posted 2006-10-19 05:08 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
——————————————————Moderation Record——————————————————
Executor: qwe1234567
Operation: Split Topic
Description: This topic is part of the original I Found the Character Limit per Line in CMD, because the discussion content is different from the original post content
————————————————————————————————————————
Floor 26 Posted 2006-10-19 07:04 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

  Thanks to brother est for writing the post about bit operations.

  But it didn't write about what aspects of applications these bit operations have, which fails to arouse everyone's interest in bit operations. Everyone only knows the results of a few bit operations, and they can analyze them themselves, but what aspects can these bit operations be used in? I think giving a practical application example of bit operations can illustrate the problem better.

  Strongly suggest brother electronixtar.........heh, you know what I mean...... d= =b
Floor 27 Posted 2006-10-19 07:25 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Well then, I put forward a direction for everyone to study. Using batch processing to do base64 encoding, and it will make bit operations very enjoyable.

[ Last edited by electronixtar on 2006-10-19 at 07:29 ]

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 28 Posted 2006-10-19 08:43 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Floor 29 Posted 2006-10-19 10:14 ·  中国 北京 朝阳区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Originally posted by electronixtar at 2006-10-19 07:25:
Well then, I'll put forward a direction for everyone to study. Using batch processing to do base64 encoding will make bit operations very enjoyable

[ Last edited by electronixtar on 2006-10-19 at 07:29 ]



Such a fun idea, you should start a new thread~ : )
Leave the very attractive content outside (the title should have it), so that more people will see it as soon as they enter the forum, which is also promotion and popularity~ : )

It's really difficult to use DOS batch processing to do BASE64 encoding without using external tools to read binary and then encode it : (
I estimate that VBS is suitable?
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 30 Posted 2006-10-19 12:08 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
js is appropriate. js also supports bitwise operations

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Forum Jump: