Silverfrost Forums

Welcome to our forums

Disassembly failure in SDBG64

27 Jan 2022 5:07 (Edited: 28 Jan 2022 12:24) #28707

In an attempt to study the behavior of the library routine LENG8$ (in Clearwin64.dll), I compiled and linked the following test program using FTN95 8.83 with the /64 /debug /link options.

program blendol
implicit none
integer*8 lstr
character*16 :: str = 'AbcdEfghIjklMnop'
lstr=len_trim(str)
print *,'Length = ',lstr
end program

I opened the resulting EXE inside SDBG64, pressed F11, and then stepped in assembly mode until the library routine LENG8$ was entered. The disassembly of the code in LENG$ that I saw is quite wrong:

00007FFA0E3F2E50 48 db 48,83,fa,0l,7+ 0
00007FFA0E3F2E51 83 db 83,fa,01,7d,0+ 1
00007FFA0E3F2E52 fa cti + 2
00007FFA0E3F2E53 017d03 add [3]$,RDI + 3
00007FFA0E3F2E56 33c0 xor RAX,RAX + 6
00007FFA0E3F2E58 c3 ret + 8
...

For the same range of addresses (ignoring relocation adjustments), the output from the VC++ Dumpbin utility is

  00000001800D2E50: 48 83 FA 01        cmp         rdx,1
  00000001800D2E54: 7D 03              jge         00000001800D2E59
  00000001800D2E56: 33 C0              xor         eax,eax
  00000001800D2E58: C3                 ret

Comparing the two, you can see that the code bytes match, but the SDBG64 disassembler is confused.

27 Jan 2022 7:24 #28709

That is pretty confused!

Please login to reply.