Questions tagged [opcodes]

47 questions
3
votes
1 answer

What do opcodes 0xE9 (JP HL) and 0xF8 (LD HL,SP+r8) do?

I think I am struggling to define correctly the following ambiguous opcodes: LD HL,SP+r8 and JP (HL) opcodes (0xE9 and 0xF8 respectively) In my implementation, LD HL,SP+r8 sets HL to the value of SP+r8, but I have a feeling that it may be to do with…
Nabushika
  • 364
  • 1
  • 17
3
votes
2 answers

What do the IL Prefix OpCodes do?

I've been playing around with IL and I noticed OpCodes like Prefix1, with documentation basically telling me not to worry about it. Naturally, this makes me quite curious as to what these various Prefix OpCodes actually do. A quick Google search…
Dan Bryant
  • 27,329
  • 4
  • 56
  • 102
2
votes
0 answers

Using unsupported opcode (DMB) in Golang (for 32bit ARM)

I'm trying to issue a DMB instruction in a Go program, and I'm using asm function defined in a .s file. I'm compiling with Go 1.7.3 on an ARMv7 device. DMB isn't a supported instruction in Go, but I see documentation here on how to use unsupported…
user3340499
  • 189
  • 1
  • 10
2
votes
0 answers

Explanation of PHP opcode instructions

I found the list of PHP opcodes and this helped me a bit to understand the internals of PHP. But I still have problems to exactly understand the scheme used to display all informations of the opcodes on this page. For example, look here under the…
Sirac
  • 693
  • 4
  • 18
2
votes
2 answers

LODS from FS (MASM)

I wish to use the LODS opcode to load a double byte from FS to eax. The default segment that is used with LODS is the DS, I wish to override that with FS. How can this be done using MASM opcodes ? 00000000 (02) 6a30 PUSH…
Michael
  • 796
  • 11
  • 27
1
vote
1 answer

What is the semantic inference or meaning of the term "Calli"?

I have seen this term in various places in code, such as in graphics programming samples. It seems to be a C++ semantic, but apparently there is a C# / .NET managed implementation called EmitCalli which seems to be related to OpCodes.Calli. I…
Jon Davis
  • 6,562
  • 5
  • 43
  • 60
1
vote
1 answer

What's the difference between normal opcodes and opcodes with their MSB set?

What's the difference between normal opcodes and opcodes with their MSB (Most Significant Bit) set? Example: 0036 5E000001 [4] return 1 2 003A 1E008000 [5] return 0 1 The first opcode (0x5E/1011110) has its MSB set…
lesderid
  • 3,388
  • 8
  • 39
  • 65
1
vote
2 answers

Is it possible to eliminate these redundant trailing zeros?

I am writing some very tightly confined ASM code. Notice this group of opcodes generated by NASM: 8AA4241C020000 mov ah,[esp+0x21c] And the similar: 051C020000 add eax,0x21c ; 4 extra 0's! 8D84241C020000 lea eax,[esp+0x21c] ; Brutal! Is…
MrSynAckSter
  • 1,681
  • 1
  • 18
  • 34
1
vote
3 answers

Lookup table to Function Pointer Array C++ performance

I have a following code to emulate basic system on my pc (x86): typedef void (*op_fn) (); void add() { //add Opcode //fetch next opcode opcodes[opcode](); } void nop() { //NOP opcode //fetch next opcode …
nmzik
  • 141
  • 1
  • 1
  • 9
1
vote
1 answer

as3commons generate function call at runtime

For reasons I am generating a class at runtime which has an existing super class with a protected member and implements an existing interface. Each method (and accessor) of the interface needs to get generated, too. The point where I'm struggeling…
1
vote
2 answers

DynamicMethod code unverifiable in .Net 4.0 (found ref 'this' pointer... expected ref '<>f__AnonymousType1`)

Was using this solution to convert anonymous types to dictionaries using reflection.emit. Was working fine until I changed to .Net 4.0 from 3.5. Now, I'm getting the "System.Security.VerificationException: Operation could destabilize the…
user365004
  • 41
  • 4
1
vote
1 answer

System.AccessViolationException storing a variable with reflectio.emit

I'm building a compiler with reflection.emit in my spare time, and i've come to a problem that i'm not understanding. A little context, I've a runtime with a couple of types and one of them is Float2, a simpler vector struct with two float values (X…
Ivo Leitão
  • 337
  • 1
  • 4
  • 16
1
vote
0 answers

Call Procedure In X86_64 Assembly

I'm writing a little program that traces another one and lists the functions call (Near call, far call, dynamic linking etc). The goal is to generate a callgraph thanks to the dotty framework. I'm currently struggling with the decoding of the…
Thibaud Auzou
  • 129
  • 10
1
vote
1 answer

Could this shift/jump be faster than switch...case statement?

I'm trying to optimize a branch (a switch...case like) at its max to emulate an X CPU on an x86 CPU. I thought of this: In memory I'll load blocks of x86 opCodes with a fixed length of 0x100 bytes, like this: first block 0 ...[my code, jump at…
venge
  • 177
  • 1
  • 9
1
vote
1 answer

Call a dynamically generated method on a ILGenerator on the same type

Normally, when I want to call a dynamic method in another ILGenerator object that is writing a method on the same type I do the following : generator.Emit(OpCodes.Ldarg_0); // reference to the current object generator.Emit(OpCodes.Ldstr,…
Thiago Padilha
  • 4,590
  • 5
  • 44
  • 69