I have to write a program which is reading chars from a file, moving bits in every char and writing those changed chars to a new file in TASM.
I've written a program which is reading chars from a file and writing them to a new file, but I don't know how to move bits in a char.
For example, here would be our file with chars:
▼ ▼
! // 00100001
" // 00100010
# // 00100011
$ // 00100100
And this would be our new file with changed chars (2nd bit goes to 7th position):
▼ ▼
! // 00100001
b // 01100010
c // 01100011
$ // 00100100
How to move that bit in a char in TASM?
Edit:
This is not a duplicate question to How to change bits in a char in TASM? because I need to detect if the desired bit is 0 or 1, necessary to know what to use, OR or AND, then set the proper bit in 1 and the rest in 0, or the proper bit in 0 and the rest in 1, then execute the OR or AND. That's a bit different question.