flat assembler
Message board for the users of flat assembler.
  
|  Index
      > OS Construction > far jump from long mode | 
| Author | 
 | 
| revolution 30 Jul 2011, 14:58 In long mode you have to point to a memory address with your address:     Code: use64 MyAddress: dq $272727 dw 8 jmp tword [MyAddress] | |||
|  30 Jul 2011, 14:58 | 
 | 
| asmdev 30 Jul 2011, 15:06 Thank you | |||
|  30 Jul 2011, 15:06 | 
 | 
| Enko 30 Jul 2011, 15:07 | |||
|  30 Jul 2011, 15:07 | 
 | 
| cod3b453 30 Jul 2011, 19:27 I'm glad I saw this; I though this was not possible.
 Thanks  | |||
|  30 Jul 2011, 19:27 | 
 | 
| asmdev 29 Sep 2011, 07:59 Hello again. Ran into weird problem today. Apparently long jump with 64bit offset doesn't work on AMD Athlon x2 4400+. 
 new version: Code: use64 MyAddress: dd $272727 dw 8 jmp pword [MyAddress] Amd docs(Nov 2009) say that 64bit offset is not supported for far jump if target is code segment, only 32bit. So I changed from "tword " to "pword" and now it works ! | |||
|  29 Sep 2011, 07:59 | 
 | 
| BAiC 30 Sep 2011, 07:22 the address component at the memory location needs to be a QWORD, not a DWORD. | |||
|  30 Sep 2011, 07:22 | 
 | 
| ouadji 30 Sep 2011, 10:22 The equivalent exists for the 64-bit mode (i'm sure), but I'm not an expert in 64bits. Code: use32 push 8 push x retf pushfd push 8 push x iretd | |||
|  30 Sep 2011, 10:22 | 
 | 
| asmdev 01 Oct 2011, 20:34 BAiC wrote: the address component at the memory location needs to be a QWORD, not a DWORD. Quote: 
 | |||
|  01 Oct 2011, 20:34 | 
 | 
| Tomasz Grysztar 01 Oct 2011, 22:06 JMP m16:64 is Intel's extension, original AMD's x86-64 never had it. | |||
|  01 Oct 2011, 22:06 | 
 | 
| BAiC 05 Oct 2011, 04:45 sorry, my bad. | |||
|  05 Oct 2011, 04:45 | 
 | 
| Feryno 05 Oct 2011, 09:18 use IRETQ instruction (has 48h prefix) as ouadji already suggested
 just push 5 necessary things before the instruction if you want to jump to compatibility mode then IRET is enough (without 48h prefix) - because addresses are only 32 bit there | |||
|  05 Oct 2011, 09:18 | 
 | 
| < Last Thread | Next Thread > | 
| Forum Rules: 
 | 
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.