Code: Select all
code segment
org 100h
assume cs: code
start:
jmp begin
dest dw 600h
begin:
xor ax, ax
mov ds, ax
mov si, dest
jmp dword ptr [si]
code ends
end start
Code: Select all
code segment
org 100h
assume cs: code
start:
jmp begin
dest dw 600h
begin:
xor ax, ax
mov ds, ax
mov si, dest
jmp dword ptr [si]
code ends
end start
Code: Select all
0000000A BE0401 mov si,0x104 ; not that exact number, but close
0000000D 66FF24 jmp dword near [si]
You set DS to 0 (zero) before reading your data at SI so unless your code is loaded at 0x0000:0100 you will read garbage.Jerry wrote: begin:
xor ax, ax
mov ds, ax
mov si, dest
jmp dword ptr [si]
Code: Select all
code segment
org 100h
assume cs: code, ds:code
start:
jmp begin
dest dw 600h, 0 ;or whatever seg address you want
begin:
xor ax, ax
mov ds, ax
mov si, offset dest ;(or alternatively lea si, dest)
jmp dword ptr [si]
code ends
end start
Code: Select all
.data
FarDesc dd 0 ; this is the address you want to jump to
dw 10h ; this is the CODE SEGMENT... if your in userland, best of to set this to the current CS value
.code
----- snip -----
jmp fword ptr FarDesc