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

Assembly using rN registers (r8,r9,...) have more code-size than other registers

i have a question about using 'rN' registers (r8,r9,r10,....) i want to use r8,r9,... registers in my program (a lot usage !) but i found code-size problem ! For example, mov eax, DWORD [rdi+4] is equal to (8b 47 04) (disassembler) but when i use…
ELHASKSERVERS
  • 195
  • 1
  • 10
-2
votes
2 answers

Table of the instruction length of each assembly command

I need to give a list of assembly commands that is 1-byte instruction length to 13 bytes instructions: 1-byte: push, ... 2-byte: add al, ... 3-byte: add ax, ... . . . 13-byte... Where can I find such a list? That I can see the assembly command and…
ana
  • 17
  • 2
-2
votes
1 answer

Why does this loop show 20 as the result instead of 120?

Why does this loop show 20 as the result instead of 120? ORG 100H facto dw ? START: MOV CX, 5 MOV AX, 5 DEC CX repeat : MUL CX MOV facto , AX LOOP repeat ENDS END START :
-2
votes
1 answer

(MIPS Assembler) Can we initialize the Program Counter on our own?

I am still trying to develop a MIPS Assembler as a part of my assignment. And I was given these input and output files. main: lw $a0, 0($t0) begin: addi $t0, $zero, 0 # beginning addi $t1, $zero, 1 loop: slt $t2, $a0, $t1 …
Tina
  • 179
  • 1
  • 3
  • 13
-2
votes
2 answers

How exactly DO lines of code relate to each other in assembly code when jump is involved?

Okay, so I understand what mov means, I understand what the registers are, I understand what the operation commands. I even understand that the leftmost hexadecimal is the instruction's number. For example, on line 7, the hexadecimal 7f is…
The_Senate
  • 149
  • 6
-2
votes
4 answers

Dissecting functions

I am curious to see how the cout function was written, where should i look for it? My second question is, can i really dissect every component of the language in order to understand it? For example, can i see how the compiler read the operators?…
-2
votes
1 answer

Assembly x86 REP, REPZ, REPNZ, XACQUIRE and XRELEASE instructions

As I have noticed the 0xF3 binary prefix is used as: 1) repeat and decrease ecx until ecx equal to 0 in the INS,OUTS,MOVS,LODS,STOS instructions and called rep 2) repeat and decrease ecx until ecx equal to 0 or ZF set in the CMPS,SCAS instructions…
ARISTOS
  • 33
  • 1
  • 7
-2
votes
1 answer

What is the use of relocatable machine code which is generated by Assembler? and why its get converted into absolute afterwards?

What is the use of relocatable machine code which is generated by Assembler? And if generated then whats the use of getting that relocatable machine code to convert it into absolute code? I watched this video.…
-2
votes
1 answer

How can I check if some number n is divisible by 10?

I have the following instruction set for a simple computer There is no remainder or modulus command in the above instruction set. So the last part of my project is to check whether the number n I got from previous calculations, which is maximum 16…
-2
votes
1 answer

0 1 binary programming

hey guys im looking for references to learn binary programming like coding with just 0 1 ... if anyone can show me the right way or help me i would be thankful its necessary for me to learn 0 1 programming but unfortunately i couldnt find sources to…
amin
  • 1
-2
votes
1 answer

Different between Machine code and Processor code

What's the different between the Machine code and the Processor code when we execute a computer by an Operating System.
-2
votes
1 answer

How does this machine code prevent buffer-overrun?

Following's are part of three different .s files. The .c file has been compiled with three different options: -fno-inline -fstack-protector-strong, -fno-inline -fsanitize=address, -fno-inline -fno-stack-protector -zexecstack. The followings are…
TYN
  • 29
  • 5
-2
votes
1 answer

Compact implementation of logical AND in x86 assembly

Hi, x86 assembler geeks! I have an interesting problem to test your assembler programming skills. I'm the author of this problem, so I know the correct answer. Your task is to implement logical AND in x86 assembly and satisfy the following 5…
Egor Skriptunoff
  • 23,359
  • 2
  • 34
  • 64
-2
votes
1 answer

bit shifting in c returning wrong result

I'm writing code to translate machine code. readFiveBytes is inside of a loop and supposed to take one byte at a time and place each byte into its correct place and return an address in the end. void readFiveBytes(int c) { if (counter != 0) { …
user3397656
  • 57
  • 1
  • 10
-2
votes
1 answer

How do I view the 8086 machine code of C and assembly programs?

I have a program in 8086 and C languages now i want to compare the machine code of each program. How can I get machine code of C and assembly 8086 code I use emu8086 and DEV .
user63835
  • 29
  • 7