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
-2
votes
1 answer

Byte Displacement in Assembly

https://i.stack.imgur.com/CVHBj.png I'm attempting to find the 1-byte displacement for some jumps. What I got was: 26 7 7 29 Not sure if I did that right though, any help?
user3434743
  • 155
  • 2
  • 9
-3
votes
1 answer

Confused about how an ARM32 processor distinguishes between a register and immediate instruction

I am looking at various instructions for an ARM32 processor, and am confused about how the processor is able to distinguish between an instruction that operates on registers and an instruction that operates with an immediate value. For example, in…
-3
votes
1 answer

How do these r-type bit numbers turn into 0,11,12,18,0, and x18? (picture below)

I understand that 6,5,5,5,5,6 represent the number of bits as well, but how do they relate to the numbers 0,11,12,18,0 and x18?
Arnab Das
  • 45
  • 4
-3
votes
3 answers

How is machine code generated from assembly?

I am trying to understand how machine code is formed from assembly code. I am using NASM assembler Say for example, I have a assembly code like this : BITS 64; mov rbx, 0x0123456789abcdef; mov rax, rbx; add rax, rax; ret; I run nasm example.S And…
-3
votes
1 answer

I am not understanding this assemby language program for what(what will be the input or output)

I got this assembly program from my mate..My teacher provided it .Unfortunately I missed it out..Please someone say me that what the program write for (input/output or objectives) .MODEL SMALL .STACK 100H .CODE MAIN PROC MOV DX,0 MOV AH,1 …
-3
votes
1 answer

Convert .class files to binary code (1's and 0's)

So say I have several .class files that make up some java program. I want to take these .class files and convert the java code to its binary equivalent (long string of 1's and 0's). Are there any online converters that will take the .class files…
Josh Brown
  • 47
  • 1
  • 9
-3
votes
2 answers

How machine code to specific processor?

As we know each processor has its own instruction set (ex-8085 processor has its own INSTRUCTION SET).So to execute any instruction by using that processor the instruction must be one of from its instruction set (means we can execute only that…
-3
votes
2 answers

How to convert High/Low level Programing Code into Machine Code directly?

I want to design and develop my own programming language and a compiler for it. I am still an undergraduate in Mathematics who knows C/C++. I did little web research and read some e-books, but most of them using specific tools to convert…
user7466998
-3
votes
1 answer

How to decipher the machine codes from x86 ASM?

I have following 2 lines from listing (x86 ASM): 0009 66| BB 00000014 mov EBX, (type Tabl1)*2 000F 67| 8D 00000000 R lea DL, A2[EBX]) Could you explain me what is a meaning of each part of machine code (the left part of line)?
-4
votes
1 answer

How Can I Convert Assembly Code to Machine Code In Java

I have some instructions for a cpu so i have assembly code and how can i translate them to machine code in java. I have code like this: LI 5 ST 1 AD 1 ST 0 LI 0 BZ 0 And i want to them like this: 85 41 c1 40 80 00 That assembly code stored in a…
Codeisacode
  • 37
  • 1
  • 7
-4
votes
2 answers

Bits required to address registers

Say I have 12 registers. How many bits must be reserved in the machine code instruction order to address any of these 12 registers?
-4
votes
1 answer

Obscure runtime error when running machine code

I need help figuring out why I am crashing at runtime when I am trying to run my machine code. The code crashes in between "3" and "result = %li". NOTE: Assume all code is error checked. I removed error checking code for the sake of people reading…
-4
votes
4 answers

Can some one write assembly code for the c program above that converts into machine code that is less than 100 bytes?

I want to overflow the array buffer[100] and I will be passing python script on bash shell on FreeBSD. I need machine code to pass as a string to overflow that buffer buffer[100] and make the program print its hostname to stdout. Here is the code in…
unpopular
  • 181
  • 1
  • 7
-5
votes
1 answer

Does this coding answer look good?

In school I was told to describe the difference between machine-, assembly-, and high-level computer languages. Give an example of machine language code and assembly language code and then name two high-level languages And this is my…
Pynoob
  • 7
  • 4
-5
votes
3 answers

Opening a simple .exe file in notepad++ vs in Sublime Text 3 yields very different results

I compiled the following C code with GCC for windows 10 (mingw-64) : #include int main(){ printf("Hello World!"); return 0; } with the command gcc.exe -o test test.c It works because when I execute the resulting file I do get a…
Mister Fresh
  • 670
  • 1
  • 10
  • 22
1 2 3
51
52