flat assembler
Message board for the users of flat assembler.

Index > Main > CALL opcodes - absolute vs relative offset

Author
Thread Post new topic Reply to topic
Akko



Joined: 23 Jan 2011
Posts: 1
Akko
Hi
I want to do some opcode patching to speed up my virtual machine.
For this I tried to find the Intel hex opcodes for CALL instructions.
Reason: I need absolute addresses as call targets.
Hex E8 aa aa aa aa however calls only relative to the actual instruction pointer, i.e. the address (IP + aaaaaaaa) is called.

But I need to call an absolute address. Is there another opcode instead of E8 that will do so?

Thanx
Akko
Post 23 Jan 2011, 15:39
View user's profile Send private message Reply with quote
b1528932



Joined: 21 May 2010
Posts: 287
b1528932
Your virtual machine?
And you ask such questions?

There is no way to call absolute address using immiediate value. You need the modrm variant.
Post 23 Jan 2011, 16:06
View user's profile Send private message Reply with quote
neville



Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
neville
Akko, welcome!

Opcode 9A is an absolute ("far") call.

_________________
FAMOS - the first memory operating system
Post 23 Jan 2011, 21:16
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4240
Location: 2018
edfed
use16
jmp far dword 0123h:0ABCDh = EA CD AB 23 01
Post 24 Jan 2011, 00:08
View user's profile Send private message Visit poster's website Reply with quote
neville



Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
neville
edfed, I think he wanted to CALL, not JMP Wink

BTW, I've been looking through some old interesting threads from my long absence, and I found this: http://board.flatassembler.net/topic.php?t=10980
I assume it never happened? I like your idea though, it is a bit like a memory OS Wink

_________________
FAMOS - the first memory operating system
Post 24 Jan 2011, 01:18
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4240
Location: 2018
edfed
yeah, sorry, but it is the same

use16
call far dword 0123h:0ABCDh = 9A CD AB 23 01
use32
call far fword 0ABCDh:01234567h = 9A 67 45 23 01 CD AB

problem solved.

now, return to pic programming Very Happy
Post 24 Jan 2011, 14:40
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.