Microsoft KB Archive/50405

= Specifying the Size of a CALL or JMP Instruction in MASM =

Article ID: 50405

Article Last Modified on 10/17/2003

-

APPLIES TO


 * Microsoft Macro Assembler 5.0
 * Microsoft Macro Assembler 5.1 Standard Edition
 * Microsoft Macro Assembler 5.1a
 * Microsoft Macro Assembler 6.0 Standard Edition
 * Microsoft Macro Assembler 6.0a
 * Microsoft Macro Assembler 6.0b

-



This article was previously published under Q50405



SUMMARY
The PTR operator can be used to specify the size of a register indirect operand for a CALL or JMP instruction. However, the qualifying operators are not NEAR and FAR, but WORD and DWORD. For example, to make a near jump to label xxx, use JMP WORD PTR xxx



MORE INFORMATION
The following example demonstrates how to generate an indirect far call and an indirect far jump in MASM.

Sample Code
; Assemble options needed: none

.model large .data jumptable DD     routine1 DD     routine2

.code start:   MOV     ax, @data MOV    ds, ax          CALL    DWORD PTR  jumptable JMP    DWORD PTR  jumptable+4 RET

cseg     SEGMENT word public 'code' routine1 PROC RET routine1 ENDP

routine2 PROC RET routine2 ENDP cseg     ENDS

END    start

Additional query words: kbinf 5.10 5.10a 6.00 6.00a 6.00b

Keywords: KB50405

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.