-1

Problem :

What makes the FAR CALL to external procedure is set always to jump to CS:IP=0000:0000 ? which when traced by the debugger "CodeView" doesn't contain the actual procedure.

I make four public procedures in four different files , the first three calls work properly but the fourth call is assembled to be : CALL 0000:0000 .

Commenting the first three calls result in the same effect.

Code :

Inside Pro.asm [Which contains the main procedure ]

The first few lines contains the extrn declarations

EXTRN WelScr:FAR
EXTRN RdImgs:FAR
EXTRN DispImgs:FAR
EXTRN MouseAct:FAR

Then inside the main I perform the following calls :

Main_prog PROC FAR

CALL WelScr
CALL RETURN ; another procedure declared inside Pro.asm
CALL ClrScr

CALL RdImgs
;getch() for debug purpose
MOV AH,00
INT 16H

CALL DispImgs
CALL MouseAct ;**Here is the problem**

;Return to DOS
MOV AH,4CH
INT 21H
Main_prog endp

Inside Mouseact.asm first I declared the procedure name to be PUBLIC then two macros are declared after that the external procedure declaration is done

PUBLIC MouseAct

DISPIM1 MACRO SR,SC,dArr
MOV SI,SC;Start Column Pixel
MOV DX,SR;Start Rwo Pixel
LEA DI,dArr+2 ;image data strats from here 
CALL DispFile1 
DISPIM1   ENDM

ChkClk MACRO i
LOCAL E
CMP DX,75*i
JB RT
CMP DX,75*i+70
JA E
INC ClickNum
CMP ClickNum,2 
JE  RT ; A lable inside the Mouseact Procedure 
MOV ItemNum,i
JMP LOP
E:
ChkClk ENDM

The procedure itself :

Code_segment_name segment
MouseAct PROC FAR
.
.
;the procedure contents are here
.
. 
RETF
MouseAct  ENDP

Another procedure needed by the MouseAct procedure :

DispFile1 PROC
.
.
;the procedure contents are here
.
.
RET
DispFile1 ENDP
Code_segment_name ends
end

Attached also the MouseAct.lst [The listing file] which is different from other external procedures listings and also doesn't contain the DispFile1 procedure name.

 Microsoft (R) Macro Assembler Version 5.10                  12/20/15 05:18:0
                                                         Symbols-1


 Macros:

 N a m e            Lines

 CHKCLK . . . . . . . . . . . . .      0
 DISPIM1  . . . . . . . . . . . .     12

 Symbols:            

 N a m e            Type     Value   Attr

 MOUSEACT . . . . . . . . . . . .   F PROC  0000        Global  Length = 0000

@CPU . . . . . . . . . . . . . .    TEXT  0101h     
@FILENAME  . . . . . . . . . . .    TEXT  mouseact      
@VERSION . . . . . . . . . . . .    TEXT  510       


  0 Source  Lines
  0 Total   Lines
 13 Symbols

47570 + 451498 Bytes symbol space free

  0 Warning Errors
  0 Severe  Errors
4

1 回答 1

3

经过一番挖掘;我发现在上面的示例中,宏定义部分由 macro_name endm 结束,即: DISP1M1宏的 DISPIM1​​ ENDM 和 ChkClk 宏ChkClk ENDM使汇编器停止汇编文件的其余部分,这导致过程 global length=0 使宏结束是ENDM,现在一切正常。

于 2015-12-20T06:49:47.217 回答