flat assembler
Message board for the users of flat assembler.
Index
> Main > call far 10000h |
Author |
|
revolution 28 Jan 2011, 22:07
Code: .xyz dw 0100h, 0 ;0x1000*16+0=0x10000 call dword ptr bx call dword [bx] ;... retf ;far return |
|||
28 Jan 2011, 22:07 |
|
lazer1 29 Jan 2011, 02:49
revolution wrote:
that doesnt work! I tried it, and its wrong in 2 ways, first it should be offset, segment as x86 is little endian and NOT segment, offset. But for direct mode you give the segment first. secondly the segment should be 01000h and not 0100h, but everything else I've tried also doesnt work. so far only the following works: Code: call far 01000h : 0 note here the segment IS given first as its not a memory definition. I know whether a usage works because at 10000h I write an ascii character to the b8000h screen if the character appears it works, |
|||
29 Jan 2011, 02:49 |
|
revolution 29 Jan 2011, 02:56
lazer1 wrote: first it should be offset, segment as x86 is little endian lazer1 wrote: but everything else I've tried also doesnt work. |
|||
29 Jan 2011, 02:56 |
|
lazer1 29 Jan 2011, 17:42
revolution wrote:
unfortunately I DIDNT know how it works! but I ran your suggestion "call dword ptr bx" and it didnt work. BUT for a call to the same segment which does work I put the offset first in memory, thats how I know the offset is first. Code: ; this code is in memory BEFORE 10000h mov bx, .abc call far [ds:bx] .... .abc dw 8000h, 0 ; offset, segment this code SUCCESSFULLY goes to 8000h the call and the target address are both in the same segment ds with 0 But I now have the code functioning using your suggestion but with offset, segment Quote:
I have the code functioning now using the instruction you gave, but with offset, segment Code: use16 ; this code is between 8000h and 0ffffh of memory mov ebx, .xyz mov edi, ebx and edi, 0ffff0000h shr edi, 4 ; should be 0 mov ds, di ; establish 0 as the segment, and ebx, 00000ffffh ; should be a no-op, establishes the offset .me: call dword ptr bx .... .xyz dw 0, 1000h ; offset, segment, segment * 16 + offset this now does function! note that the call and the target are different segments but I see now that for a different choice of segment they are then the same segment eg Code: mov edi, .me ; see above fragment for .me shr edi, 4 mov ds, di but IMHO such nonstandard segments will be bug prone here a near call could be done, I know whether the code functions because the code at 10000h immediately renders a character to the 80x25 text screen if that character appears then the target address is successfully reached, the above fragment has a lot of redundancy, but its best to do it methodically as segment:offset is very bug prone, |
|||
29 Jan 2011, 17:42 |
|
lazer1 06 Feb 2011, 21:50
I now use the earlier idea of
Code: use16 call far 01000h : 0 because that works AND it uses no registers AND I have verified by trying it that the return instruction is the same as for the other idea. |
|||
06 Feb 2011, 21:50 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.