808 questions
Advice
1
vote
4
replies
145
views
How did programming transition from mechanical systems to digital code editors? What was the mechanism behind creating the first programming tools?
I’m trying to understand the historical and technical transition from early mechanical programming (like punched cards and hardware switches) to modern digital programming using code editors and ...
-4
votes
1
answer
127
views
How would I run a .bin file [closed]
I was making a .bin file and I ran into a issue, I don't know how to run it! I just wanted to make a basic HLT function file to test it out. Here's the contents: ...
3
votes
1
answer
107
views
Do the bytes "00 10 A1 B3" make sense in Arm 32-bit architecture?
The bytes 00 10 A0 B3 decodes to movlt r1, #0 in the arm 32-bit architecture.
When I type the bytes 00 10 A1 B3 into the shell-storm online disassembler, it shows "N/A".
However, in the ...
3
votes
1
answer
100
views
Can I somehow tell GAS to change direction of operands?
I have the binary image of a bootloader which was written with some ancient assembler.
I want to port the assembly code to GNU assembler (GAS). We speak about the X86/16-bit
(real mode) world.
This ...
3
votes
2
answers
320
views
ARM64 add instruction preferred opcode?
ARM64 supports add (extended register) that must be used for SP register, and add (shifted register) that must be used for ZR register.
The instruction add X0, X1, X2 matches the syntax for both of ...
1
vote
1
answer
176
views
Does java compiler (javac) require JVM to compile the java code? [duplicate]
So I got to know that javac compiler is written in Java. And JVM converts the bytecode (compiled Java code) to machine code for execution.
Two questions:
If javac is written in Java, does compiling ...
8
votes
3
answers
399
views
How to detect whether my x86 code is running in 16-bit mode or 32-bit mode without modifying FLAGS or regs?
My precompiled x86 code may be running in a 16-bit (real mode or 16-bit protected mode) or a 32-bit (i386 protected mode). How do I detect it from the code at runtime?
I was able to come up with this ...
0
votes
1
answer
81
views
Segmentation fault in x86-64 Assembly program
Im making a very simple and basic assembly program (create array with 0 to 15, find the prime numbers, square each number and do the fibonacci in each). But everytime i run it i get a a segmentation ...
1
vote
1
answer
301
views
Attack Lab Phase 4: rdi gets the wrong value despite correct assembly being put on stack
I am working on phase 4 of the buffer overflow attack lab, where the solution is is to use ROP (Return Oriented Programming). The idea is that you are given a "farm" where you will look for ...
0
votes
0
answers
99
views
MIPS - How to find the immediate value/branch offset from the bne instructions?
slt $t2, $t5, $t0 <---- 0x04001248 (PC) [Memory Address]
bne $t2, $s4, ELSE
lw $s4, 120($s1)
j DONE
ELSE: addi $t2, $t2, -100
DONE: nop
Assume this is the example. What ...
0
votes
0
answers
82
views
Why the order of Assembly code changed after Machine Code Sinking?
I am new to compiler and llvm, and I am sorry if my question or approach is kinda odd...
Following is the example machine code:
bb.0.entry:
successors: %bb.1(0x50000000), %bb.5(0x30000000); %bb.1(62....
1
vote
1
answer
218
views
8086 memory to accumulator encoding: why do mov al, [absolute] and mov ah, [absolute] have different sizes?
mov al, [10] ; a0 0a 00
mov ah, [10] ; 8a 26 0a 00
After assembling the above 8086 assembly code using NASM, I noticed a length disparity in the resulting machine code (shown in the comments above ...
0
votes
0
answers
58
views
How can I make a dynamically changing list size variable in machine code? (Assembly)
Tricky question about a a project in machine code, effectively Assembly code without labels. We are trying to find the length of a list that will change each time. The problem is, without labels, we ...
0
votes
0
answers
195
views
Understanding the Funct6 field in shift immediate instruction in RISC-V
The following figure shows the instruction format of the RISC-V architecture.
Also in the following figure, that is from Computer Organization and Design, RISC-V edition, 2nd edition, the three ...
0
votes
0
answers
153
views
How are x64 instructions decoded and what is the format of the generated uOps?
I'm looking at computer microarchitecture and understanding how CPUs work in hope to perhaps design my own CPU out of logic gates. I understand that the complex nature of x86-64 instructions having ...