• Starting today August 7th, 2024, in order to post in the Married Couples, Courting Couples, or Singles forums, you will not be allowed to post if you have your Marital status designated as private. Announcements will be made in the respective forums as well but please note that if yours is currently listed as Private, you will need to submit a ticket in the Support Area to have yours changed.

  • CF has always been a site that welcomes people from different backgrounds and beliefs to participate in discussion and even debate. That is the nature of its ministry. In view of recent events emotions are running very high. We need to remind people of some basic principles in debating on this site. We need to be civil when we express differences in opinion. No personal attacks. Avoid you, your statements. Don't characterize an entire political party with comparisons to Fascism or Communism or other extreme movements that committed atrocities. CF is not the place for broad brush or blanket statements about groups and political parties. Put the broad brushes and blankets away when you come to CF, better yet, put them in the incinerator. Debate had no place for them. We need to remember that people that commit acts of violence represent themselves or a small extreme faction.
  • We hope the site problems here are now solved, however, if you still have any issues, please start a ticket in Contact Us

  • The rule regarding AI content has been updated. The rule now rules as follows:

    Be sure to credit AI when copying and pasting AI sources. Link to the site of the AI search, just like linking to an article.

machine code

H

humanguy

Guest
Hello. I'm wondering when viewing and editing machine code ( ones and zeros ) would be necessary. At my job, the lowest level viewing and editing is done with a hex editor. From my research, it appears that that is pretty much the lowest level editor used by most computer professionals. Is it possible to view and edit a single bit in a hex editor? And what would be the reason for it? Thanks.
 
H

humanguy

Guest
I think I figured out the answer. I was forgetting that the character encodings we humans use to represent information are made up of a 'group' of bits - therefore editing a single bit would be overkill. Of course it could be possible to have an editor made up of ones and zeros, but, since characters are encodings based on groups of bits, using a hex editor for shorthand makes sense. Onward and upward :)
 
Upvote 0
N

Nanopants

Guest
Hello. I'm wondering when viewing and editing machine code ( ones and zeros ) would be necessary. At my job, the lowest level viewing and editing is done with a hex editor. From my research, it appears that that is pretty much the lowest level editor used by most computer professionals. Is it possible to view and edit a single bit in a hex editor? And what would be the reason for it? Thanks.

Flags (boolean values) are often stored as single bits for efficiency. If you can arrange these bits in a meaningful order, then you can reinterpret them as a numerical value and perform mathematical operations on all flags stored in a single word at once (32 or 64), instead of retrieving one flag at a time from memory. That's useful if for example you want to quickly sort subsets of boolean values.

You can retrieve the value of a single bit by using something called a bit mask and a logical operation. Say for example you have a byte containing 0011 1100, but all you want is the value of the fourth bit from the right. So you would use a mask value of 0000 1000, use an AND bitwise operation with the original byte, and the result is 0000 1000, which may be interpreted as equivalent to true or one (because it is non-zero). Had the original byte been 0011 0100, the result would be zero, or false.

This isn't exactly machine code. Yes it is closely related to how the machine works with data but the concepts of bit manipulation are fairly fundamental for any programming language that will allow you to play around with them. Machine code is practically unreadable.
 
Upvote 0