| Index | Manual | Download | Source | Macros | Embedded word Case ins.
Sitemap | Links | Forum | Tests | Projects

# Test t3165: Machine instruction CALL automatic distance

Description
  CALL (and JMP) default distance selected by memory model.
See also
  t3145
Tested procedures
  IiDispatchLocation

Source & expected listing t3165.htm.lst
  `| | EUROASM LIST=ON,DUMP=ON,DUMPWIDTH=22,CPU=386 | |t3165 PROGRAM FORMAT=BIN,MODEL=MEDIUM,IMAGEBASE=0x3000,LISTMAP=ON,LISTGLOBALS=OFF |[CodeSeg] |[CodeSeg] SEGMENT PURPOSE=CODE,WIDTH=16 ; Linked at 0x0300:0. |0000:E8(1900) | CALLN FarLabel: |0003:9A[1900]{0000} | CALLF FarLabel: |0008:9A[1900]{0000} | CALL FarLabel: ; Defaults to CALLF due to the different target segment [FarSeg] and MODEL=MEDIUM. |000D:E8(1900) | CALLN FarProc: |0010:9A[1900]{0000} | CALLF FarProc: |0015:9A[1900]{0000} | CALL FarProc: ; Defaults to CALLF due to the different target segment [FarSeg]. |001A:E8(2211) | CALLN 0x1122 ; Relative near call to the scalar offset 0x1122 within segment [CodeSeg]. |001D:9A22110000 | CALLF 0x1122 ; Absolute far call to the scalar target 0:0x1122 with implicit segment 0. |0022:9A22110000 | CALL 0x1122 ; Defaults to CALLF. |0027:9A22110000 | CALLF 0:0x1122 ; Absolute far call to the scalar target 0:0x1122 with explicit segment 0. |002C:9A22110000 | CALL 0:0x1122 ; Defaults to CALLF. Near call with implicit segment is not supported. | |;; |[FarSeg] |[FarSeg] SEGMENT PURPOSE=CODE,WIDTH=16,ALIGN=0x10 ; Lined 0x0304:0. |0000:E81600 | CALLN FarLabel: ; Relative NEAR call. |0003:9A[1900]{0000} | CALLF FarLabel: ; Absolute FAR call. |0008:E80E00 | CALL FarLabel: ; Intrasegment distance defaults to NEAR. |000B:E80B00 | CALLN FarProc: |000E:9A[1900]{0000} | CALLF FarProc: |0013:9A[1900]{0000} | CALL FarProc: ; Distance defaults to FAR due to target's DIST=FAR modifier. |0018:C3 | RET ; Instruction RET defaults to DIST=NEAR. |0019: |FarLabel: |0019: |FarProc: PROC DIST=FAR ; Explicitly specified FAR property of FarProc. |0019:CB | RET ; Instruction RET inside far procedure defaults to DIST=FAR. |001A: | ENDP FarProc: | |ENDPROGRAM t3165 | **** ListMap "t3165.bin",model=MEDIUM,groups=0,segments=2,entry=,stack= | [CodeSeg],FA=00000000h,VA=00003000h,size=00000031h=49,width=16,align=0010h,purpose=CODE | [FarSeg],FA=00000040h,VA=00003040h,size=0000001Ah=26,width=16,align=0010h,purpose=CODE`

Expected messages t3165.out
  `I0180 Assembling source file "t3165.htm". I0270 Assembling source "t3165". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t3165". "t3165.htm"{57} I0510 Assembling program pass 1. "t3165.htm"{57} I0510 Assembling program pass 2. "t3165.htm"{57} I0510 Assembling program pass 3. "t3165.htm"{57} I0530 Assembling program pass 4 - final. "t3165.htm"{57} I0660 16bit MEDIUM BIN file "t3165.bin" created, size=90. "t3165.htm"{83} I0650 Program "t3165" assembled in 4 passes with errorlevel 0. "t3165.htm"{83} I0750 Source "t3165" (116 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t3165.htm.lst" created, size=2349. I0990 EuroAssembler terminated with errorlevel 0.`

Expected output file t3165. bin

      0000: E8 56 00 9A 19 00 04 03 9A 19 00 04 03 E8 49 00  ¤V°¤·°··¤·°··¤I°
      0010: 9A 19 00 04 03 9A 19 00 04 03 E8 05 11 9A 22 11  ¤·°··¤·°··¤··¤"·
      0020: 00 00 9A 22 11 00 00 9A 22 11 00 00 9A 22 11 00  °°¤"·°°¤"·°°¤"·°
      0030: 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90  °¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
      0040: E8 16 00 9A 19 00 04 03 E8 0E 00 E8 0B 00 9A 19  ¤·°¤·°··¤·°¤·°¤·
      0050: 00 04 03 9A 19 00 04 03 C3 CB                    °··¤·°··¤¤

▲Back to the top▲