Jump to Absolute Address (24965)



The information in this article applies to:

  • Microsoft Macro Assembler (MASM) 1.25
  • Microsoft Macro Assembler (MASM) 1.27
  • Microsoft Macro Assembler (MASM) 3.0x
  • Microsoft Macro Assembler (MASM) 4.0
  • Microsoft Macro Assembler (MASM) 5.0
  • Microsoft Macro Assembler (MASM) 5.1
  • Microsoft Macro Assembler (MASM) 5.1a
  • Microsoft Macro Assembler (MASM) 6.0
  • Microsoft Macro Assembler (MASM) 6.0a
  • Microsoft Macro Assembler (MASM) 6.0b

This article was previously published under Q24965

SUMMARY

There are two methods of coding a jump to an absolute address. These methods are as follows:
  1. Use AT to create a segment template beginning at an absolute address. Then, using ORG, a label can be assigned at a specific offset. -or-

  2. Initialize a double word variable to the specific address.

MORE INFORMATION

The following code demonstrates both methods:
; Assembly options needed: none

ASEG SEGMENT BYTE AT 0000H

           ORG 100
far_label  LABEL FAR

ASEG       ENDS


DATA   SEGMENT WORD 'DATA'

FAR_VAR DW   100,0

DATA         ENDS



CODE   SEGMENT BYTE 'CODE'
       ASSUME CS:CODE, DS:DATA

start: mov ax, data
       mov ds, ax

       JMP far_label          ;This is the first type of jump.

       JMP DWORD PTR far_var  ;This is the second type of jump.
CODE   ENDS

END start
				

Modification Type:MajorLast Reviewed:10/22/2003
Keywords:KB24965