Questions tagged [machine-code]

Machine code is data that is directly fed into a microprocessor, being the only form that the processor is able to execute. It is the lowest possible level of abstraction, wherein all data is a raw binary stream. Machine code is barely readable by humans, which is why assembly is usually utilized instead.

Every processor or processor family has its own instruction set. This is a set of instructions the processor has been designed to execute. These instructions are binary codes and in general are not human readable, one would have to memorize the bit patterns. Assembly language is a human readable representation of the machine code where the assembly language mnemonics and following syntax attempt a one to one assembly language instruction to machine code instruction relationship. But assembly language has a fair amount of additional syntax that is not directly related to machine code or machine language.

https://en.wikipedia.org/wiki/Machine_code

The tag is used for questions related to machine code. Additional tags like and and others may also be used.

A tag specifying the architecture , , , , (and many others), is needed as the machine code for different architectures is not compatible, and the question will be difficult to answer without knowing the architecture.

766 questions
0
votes
6 answers

Are there any managed programming languages that compile to machine code?

Managed languages being the ones that handle memory cleanup for you. EDIT I'm not talking about garbage collection. I was just interested in knowing about languages that would free() memory for me automatically, and still compile down to machine…
Luca Matteis
  • 29,161
  • 19
  • 114
  • 169
0
votes
1 answer

Translating MIPS to machine code

.text .align 2 .global main .equ val,0x4712 # 16-bit binary code for 0x4712: 0100 0111 0001 0010 # Program code starts now main: movi r16,val movi…
Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424
0
votes
1 answer

Journey from Assembly Code to Machine Code

Something I can't quite wrap my head around is how what we type into a computer and read from the screen is turned into something a computer can utilize and execute. Even in the lowest of languages such as assembly, I read that "Assembly is the…
kjh
  • 3,407
  • 8
  • 42
  • 79
0
votes
1 answer

Instruction detection at run-time

I would like to identify and analyze different machine instruction executed and required clock cycle for each of them, throughout running of a code. Is there any way to do this simply? Dynamic binary translation might be a way but i am looking for…
0
votes
1 answer

Crack some exe file - how to remove bytes

Today I am trying to remove some bytes from an EXE file. Inside the EXE I found a path to a file that the EXE needs to load. I want to change the path, and to do that I have to remove some ../../ characters. When I do that and save the file, it…
ali
  • 10,927
  • 20
  • 89
  • 138
-1
votes
1 answer

What switch statement produces the least efficient machine code?

I've got a question in one of my tests that asked me to answer what switch statement produce the least efficient machine code. The possible answers were O4, O1, O2, or O3. I don't event know what those are supposed to mean.
Paul Manta
  • 30,618
  • 31
  • 128
  • 208
-1
votes
0 answers

How to solve these Jump-type instruction format question?

Convert the following MIPS assembly instruction into machine language using the Jump-type instruction format: j 0x0040001C Actually I Didn't know How to solve this.Plz Anyone can help ? This is the chtgpt ans: "Here's how you can convert the…
-1
votes
1 answer

Machinecode and hardware

first of all hello to all hope you are good and safe. well i have some questions about machine code and hardware and operating system. 1- i was search about how is pure machine code and i find somethings in here and net but not enough to answer my…
-1
votes
2 answers

How does an Assembler work at a hardware level?

I have been reading online about the working of an Assembler but it is quite confusing. To summarize what I have understood so far is the an Assembler is basically a text parser with access to a Look up table to map the Assembly language…
Saarthak
  • 39
  • 1
  • 2
  • 5
-1
votes
2 answers

What does "comparison is for a two’s-complement ‘>=’" mean?

I am learning assembly language and got stuck on this point. This is a problem from book "Computer System" chapter 3. The problem description is: 1st part of the problem 2nd part of the problem Look at questions A, B and C. A. cmpl %eax, %edx setl…
-1
votes
1 answer

Assembler: What means RAM_SP+16H?

I need your help by this assembler code: LOC OBJ LINE SOURCE 0116 369 controll_time EQU RAM_SP+16H ;enter controll time impulse What does "RAM_SP+16H" means? RAM_SP is the storage for C++ data an is…
Christian01
  • 307
  • 1
  • 5
  • 19
-1
votes
1 answer

ARM Assembly: Need help calculating jump offset for BL opcode

I am working on hacking a game to allow rumble. This requires replacing a line of code in the existing rom with a bl to the new function that I would like to call, however I am having a hard time calculating the necessary offset. the function I am…
-1
votes
1 answer

Absolute address of function in object file

I have ARM Cortex-M object file (.o) in which I have following code: BL $testFunc. In the same object file I can also find a implementation of the testFunc. Can I get the absolute address that the call will be made during the program execution? I…
KaDw
  • 78
  • 1
  • 7
-1
votes
1 answer

Understanding Instruction Encoding?

I used a website to encode this: movw $8, 4(%r8d,%esi,4) and got: encoding (hex): 67 66 41 C7 44 B0 04 08 00 Thanks to you I nearly understand everything except 2 small points: Here we are moving 2 bytes immediate to 4 bytes address. They used C7…
user16566250
-1
votes
1 answer

In MIPS assembly, how do we know what function the opcode refers to if it starts with 000000?

Sorry for this stupid question. For example, if I have 0x00812022 why is it SUB $a0, $a0, $at And not ADD $a0, $a0, $at According to the MIPS reference data, it says add Opcode: 0/20 Hex sub Opcode: 0/22 Hex How do I differentiate between all…
stepbysteptomathpro
  • 455
  • 1
  • 7
  • 16