16-bit dynamic jump?
Posted: Thu Jul 12, 2012 6:52 pm
I don't know if this is what you would actually call it but I want to perform a dynamic jump in 16-bit mode assembly, sort of like a c function pointer. Here is an example of the code I am using:
This is a very incomplete example but it gets my main point across. For some reason every time I do this my OS resets itself (I am trying to write a small 16-bit ASM OS as a second option to my main kernel.) Is there something that is wrong with calling the contents of a memory address like this? I am assembling with nasm and I have checked my stack and have all the segment registers set up appropriately.
Code: Select all
mov bx,cmd_addr
call word [bx]
ret
cmd_addr: dw _test_funct
_test_funct:
mov ax,0x0123
ret