flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 29 Sep 2008, 04:45
You will need a far jump (or call), that way you also load CS with the segment of the data you just loaded.
Code: jmp far dword [some_memory_dword_that_has_the_offset_and_segment_values] |
|||
![]() |
|
DJ Mauretto 29 Sep 2008, 07:44
Hello
![]() Code: mov ah,02h ; read mov al,2 ; num. of sectors to read. mov ch,0 ; cylinder num mov cl,4 ; start to load from sector number 4 mov dh,0 ; head num. mov dl,[Boot_Drive] ; Load Boot Drive ; es:bx points to receiving data mov bx,1000h mov es,bx int 13h ; read jmp 1000h:1000h ; segment:offset Why 1000h ![]() _________________ Nil Volentibus Arduum ![]() |
|||
![]() |
|
ralc 02 Oct 2008, 16:09
I replaced jmp with jmp far.
mov ah, 02h ; read mov al, 2 ; num. of sectors to read. mov ch, 0 ; cylinder num mov cl, 4 ; sector num mov dh, 0 ; head num. ; es:bx points to receiving data mov bx, 0400h mov es, bx mov bx, 0 int 13h ; read jmp far 0800h Now the system reboots. That is better than freezing. But I must still be leaving something out. Thanks RALC |
|||
![]() |
|
revolution 02 Oct 2008, 16:18
Yes, you are forgetting about the segment register CS.
|
|||
![]() |
|
edfed 02 Oct 2008, 17:19
external jumps or calls implies external memory map.
then, if you call or jump to another segment or descriptor, you will use the far pointers ONLY. far pointers are cool and your friend. very simple to use, as well in RM, PM, 16 & 32 bits. to define a far pointer? read the manual: Code: farpointer1616 dd Ssegment:Ooffset farpointer1632 dp Ssegment:Ooffset ;where Ssegment is the segment ;and Ooffset is the offset. ; ;dd and dp directives, when defining a far pointer, will be identicall to: farpointer1616 dw Ooffset:Ssegment farpointer1632 dd Ooffset dw Ssegment how to use these pointers? where to put them? in any data segment! Code: call far [farpointer] ;if hte far pointer is in ds. call far dword[ss:ebp] ; if there is a far pointer in the stack. call far pword [gs:esi+eax*8+100h] ; to access the far pointer from advanced structure. of course, for jmp, it is the same!!! :D now, you can play with external call/jumps. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.