Search code examples
assemblyemu8086

How do i move the contents of AX register to CS register in 8086 Assembly Language


The questions that i have seen suggests that i have to use a JMP or a CALL but how. I want to replace the instruction MOV CS, AX with a valid 8086 instruction(instructions) to resolve the error CS cannot be modified directly (use far JMP or CALL)


Solution

  • Here are a couple of examples:

            mov     ax,segment_value
            mov     bx,offset_value
            push    ax
            push    bx
            retf
    
    ;       ...
    
            DB      0EAh                ;far jump
            DW      offset_value
            DW      segment_value