Questions tagged [opcodes]
47 questions
28
votes
3 answers
Converting very simple ARM instructions to binary/hex
I've been trying to use this page as well as various other guides to figure out how to express very simple ARM instructions as binary and hex. It seems like it should be a straightforward process to me, but I still don't understand. Here's a few…

n00neimp0rtant
- 905
- 1
- 8
- 18
17
votes
1 answer
Assign by reference bug
I came across this seemingly very simple question the other day How to changing value in $array2 without referring $array1? However the more i looked into it the more odd it seemed that this is indeed functioning as intended. After this I started…

michael.schuett
- 4,248
- 4
- 28
- 39
15
votes
1 answer
Zilog Z80 OP-Code implementation
I'm currently developing an emulator for the good old GameBoy and I'm facing some problems understandig how some basic operation codes have to be implemented.
Right now I'm implementing the AND operations; the first few (0xA0 -> 0xA3; 0xA6 & 0xA7)…

Sepultura
- 997
- 1
- 9
- 28
14
votes
2 answers
Purpose of Emit.OpCodes in .NET for Windows Store apps API?
I am considering porting a third-party library to .NET for Windows Store apps. The library makes excessive use of System.Reflection.Emit.OpCodes via calls to the ILGenerator.Emit method overloads.
In the .NET for Windows Store Apps API, the OpCode…

Anders Gustafsson
- 15,837
- 8
- 56
- 114
10
votes
4 answers
Z80 memory refresh register
Me again with another innocuous Z80 question :-) The way my emulator core is currently structured, I am incrementing the lower 7 bits of the memory refresh register every time an opcode byte is fetched from memory - this means for multi-byte…

PhilPotter1987
- 1,306
- 2
- 12
- 20
10
votes
1 answer
Erlang Opcodes and their meaning
Some of the opcodes used by the Erlang VM have an obvious meaning, but others are mysterious and they seem to differ each other by subtle differences.
As an example:
What's the difference between the call_ext and call_ext_only opcodes?
What's the…

Roberto Aloi
- 30,570
- 21
- 75
- 112
8
votes
2 answers
Why does the JVM have the iconst_2 - iconst_5 opcodes?
While reading the JVM specification (as one does), I was very surprised when I came across the 7 iconst_ opcodes. After all, there is only one byte to play with.
I very rarely write the literals for 2, 3, 4 or 5 in my code. I can understand why…

user1675642
- 747
- 2
- 5
- 15
5
votes
2 answers
How Do I Execute Dalvik Op-Codes
I would like to execute opcodes directly against the running Dalvik VM instance from within my application on Android. I'm looking for something similar to the C asm function. I have a list of opcodes for dalvik, but I am unfamiliar with how to…

Heat Miser
- 19,438
- 7
- 35
- 38
5
votes
3 answers
Android smali question
I'm currently doing some research on smali/"code obfuscator" and I'm trying to get familar with the decompiled source codes at the moment. For this I created a simple app and decompiled it by smali.
I'm trying to understand the decompiled source…

Nils
- 1,705
- 6
- 23
- 32
5
votes
1 answer
Understanding of a shellcode example
in a shellcode tutorial, I have seen the following example:
main(){
exit(0);
}
The idea was to create an exit()-syscall.
So, then they produce the assembly:
Section .text
global _start
_start:
mov ebx, 0
mov eax, 1
…

user3097712
- 1,565
- 6
- 27
- 49
4
votes
5 answers
Why multiple instructions with same opcode and working?
I was looking at instructions and their corresponding opcodes. Instructions such as "je" and "jz" have the same opcode:
je,jz - 0x74 (8 bit)
je,jz - 0x0f84 (16/32 bit).
Why do we have such redundant instructions?
Is it because it makes assembly…

Hrishikesh Murali
- 535
- 3
- 7
- 16
4
votes
2 answers
Does a Lua 5.1 Assembler Exist?
I've been studying the Lua 5.1 VM opcodes for some time now, out of boredom.
And I want to try coding something!
So is there any existing way to assemble Lua Assembly into Bytecode ?

Anonymous
- 41
- 2
3
votes
2 answers
Decoding i386 opcodes to instructions
I'm trying to Is there any good resource available to learn 'decoding' of i386 opcodes? Most of the websites talk about how to encode instructions, but I don't find anywhere something telling as to how to decode opcodes to instructions.
I've looked…

Hrishikesh Murali
- 535
- 3
- 7
- 16
3
votes
3 answers
GameBoy color emulator opcodes automation
I'm writting a GameBoy color emulator in C, just to introduce myself into this world, it is interpreted, nothing of dynamic or static recompilation :P
Now I'm right in the tedious task of implementing all the CPU opcodes in C code, I have to write…

0x77D
- 1,564
- 2
- 18
- 17
3
votes
2 answers
MUL/DIV instructions vs. MOV & SHL/SHR (Pentium Pro)
Why would you want to use:
MOV EAX, 22
SHL EAX, 2
...when multiplying by 4 opposed to just using the MUL instruction?
I understand that this can also be done with SHR instead of DIV as well.
What are the advantages of doing this?
Also can you do…

LearningProcess
- 607
- 1
- 8
- 29