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

From where "b8", "bb" and "cd" is coming while doing objdump for a program?

Can someone please help me to understand, why "b8", "bb" and "cd" is getting added in machine code though I am moving only 1, 10 and 80 to registers. user@ubuntu:~/Documents/MyCode$ objdump -d shell1 -M intel shell1: file format…
WebEye
  • 51
  • 1
  • 4
-1
votes
1 answer

How to convert machine code to readable assembly (IDA free)

I need to convert a lot of Machine code hex to Assembly. I'm using the free version of IDA. I'm confident it can do this, but whenever I input the machine code in formats raw, bin, hex, exe, dmp it opens like this: seg000:00010 32 34 35 32 20 33 31…
Ponyisasquare
  • 189
  • 1
  • 2
  • 12
-1
votes
2 answers

Bitwise Rightshift Assignment operation in C

The output to this Leftshift assignment operator is -8.I didn't understand how.Please help! #include < stdio.h> int main() { int y = -1; y <<= 3; printf("%d", y);// prints -8; return 0; }
AppY
  • 1
  • 1
-1
votes
1 answer

Assembly language x86 to machine code : which come first displacement or immediat data

i wanna get the machine code for this instruction : MOV[BX+3465H],6754H. the code of "MOV immediate to memory" is : 1100,011w and w=1 cuze we are on 16 bits so the first byts is 1100,0111. for the 2nd its MOD reg r/m and mod=10, reg=000, r/m=…
-1
votes
1 answer

x64 MASKMOVDQU (Store selected bytes of double quadword) and VEX segment override

I'm stuck by this MASKMOVDQU instruction on page 902 of the intel x64 manual. I'm not quite sure how to change between the different register sizes in this instruction. It lists the default memory location as DS:DI/EDI/RDI but it also has 0x66…
Ryan Brown
  • 1,017
  • 1
  • 13
  • 34
-1
votes
1 answer

x86 call machine code

I looked up intel's document, it says In the absolute indirect call near, "FF /2" this "/2" means what? 2 bytes or sth else? And I want to know the entire list about "call proc" machince code, for example: 1: e8 xx xx xx xx --> near call…
oppo
  • 169
  • 8
-1
votes
1 answer

How to input a string containing between 1 and 50 characters.(Assembly)

;This program reverses a string. INCLUDE Irvine32.inc .data aName BYTE "Abraham Lincoln",0 nameSize = ($ - aName) - 1 .code main PROC ; Push the name on the stack. mov ecx,nameSize mov esi,0 L1: movzx eax,aName[esi] ; get…
DaCat
  • 25
  • 1
  • 9
-1
votes
3 answers

Print triangle of *'s in Assembly Language (LC-3)

I am trying to print a triangle of asterisks based on a value of N. The code I have here will just print an entire row of N *'s. The end result i am looking for is: * ** *** **** If N = 4 The code I have right now .ORIG x3000 LD …
connor moore
  • 611
  • 1
  • 8
  • 18
-1
votes
3 answers

I asked this yesterday, after the input given I'm still having trouble implementing

I'm not sure how to fix this or what I did wrong, but whenever I enter in a value it just closes out the run prompt. So, seems I do have a problem somewhere in my coding. Whenever I run the program and input a variable, it always returns the same…
Josh
  • 117
  • 1
  • 4
-1
votes
2 answers

Having trouble finding error in my assembly code

I am a beginner when it comes to assembly language. I am using "easy 68k editor/assembler" to write 68k assembly code that asks the user for 2 values, then sum them up together and display it. The problem is that my code keeps getting halted and I…
The Tokenizer
  • 1,564
  • 3
  • 29
  • 46
-2
votes
1 answer

what is the machine code equivalent of jr $ra?

Since its a r type operation, opcode is 000000 and source register is 11111 what are the other 2 registers for source and another for destination? And how do we write machine code for j type operations?
-2
votes
2 answers

Why aren't instructions' adresses consecutive in machine code?

I just compiled a CPP source code into an object .o file, and the first couple of lines are like the following: Disassembly of section .text: 0000000000000000 <_Z8mainLoopv>: 0: f3 0f 1e fa endbr64 4: 55 …
Joao Donasolo
  • 359
  • 1
  • 9
-2
votes
1 answer

Understanding this simple movl opcode

I'm starting to learn to read opcodes and I've found this: 89 75 95 movl %esi, var_6ch where var_6ch is at ebp-0x6c Which part of 89 75 95 indicates the 'address' ebp-0x6c? I've found on internet that 89 is the code for movl, maybe 75 is for…
Paprika
  • 402
  • 5
  • 18
-2
votes
1 answer

Change from MOV instructions to ADD or SUB instructions

I want to change from mov instructions to SUB instructions (I think ,we can also change to ADD instructions) and I want to adjust the values so that the function of the entire program remains unchanged. for_real_programmers: mov dx, 0 ; …
-2
votes
3 answers

Do computer programs/OSes consist of only the X86-64 instructions at low level?

I am sorry for a newbie/stupid question, but this has bothered me some time and a straight up answer seems difficult to find. The question is about how computers work at a low level - more specifically whether there are commands the computer can…