From: H. P. A. <hp...@zy...> - 2006-07-06 21:03:07
|
Frank Kotler wrote: > ce...@ar... wrote: >> Hello again! >> >> I seem to have run into another problem with the nasm-human interface. >> I've got code loaded into es:bx, courtesy of int 13. >> >> My understanding is that I ought to be able to far jump to es:bx, however >> jmp es:bx gets me the error "invalid combination of opcode and operands". >> >> For fun, I replaced es:bx with 0xFFFF:0xFFFF which worked OK (although, >> FFFFh:FFFFh doesn't -- nasm parses that first FFFFh as a label). I then >> tried 0xFFFF:bx and es:0xFFFF, both of which gave me the same invalid >> combination of opcodes and operands. >> >> Here's a listing of things which I've tried while trying to figure out >> the >> problem. >> jmp cs:0xFFFF >> jmp ds:0xFFFF >> jmp es:bx >> jmp bx:dx >> jmp ebx:edx >> jmp ds:dx >> >> These two complain about operation size not being specified. Including >> dword after jmp brings back the invalid combination error. >> jmp 0xFFFF:bx jmp 0xFFFF:ebx >> >> Incidentally, [cs:0xFFFF] and [ds:0xFFFF] will work, although that's >> nothing even approximating what I want. > > Hi Phil, > > You've pretty much run the gamut! The only kind of "jmp xxxx:xxxx" is > "imm:imm". As you know "jmp [xxx]" is a different thing. If you've got a > target address in es:bx, your choices are to put 'em in a memory > location "mov [target], bx"/"mov [target + 2], es"/"jmp far [target]", > or "push es"/"push bx"/"retf". I don't *know* of any other way to do > it.... Well, typically in a bootsector, we know what went into es and bx > before the int 13h, so we can do "jmp imm:imm"... > A common way to jump to say ES:BX is: push es push bx retf -hpa |