* * *

Author Topic: asm: j is jo, but only sometimes  (Read 592 times)

Kays

  • Full Member
  • ***
  • Posts: 112
  • Whasup!?
    • KaiBurghardt.de
asm: j is jo, but only sometimes
« on: May 16, 2018, 11:13:10 am »
Hi,

why does my attached program translate an instruction into something totally different? I use FPC 3.0.4.

Code: ASM  [Select]
  1. $ objdump -d --start-address=0x4001d8 --stop-address=0x4001e5 -M intel --insn-width=4 sizeOfDemo
  2.  
  3. sizeOfDemo:     file format elf64-x86-64
  4.  
  5.  
  6. Disassembly of section .text:
  7.  
  8. 00000000004001d8 <P$SIZEOFDEMO_$$_SUM$array_of_SMALLINT$$INT64+0x18>:
  9.   4001d8:       66 8b 14 4e     mov    dx,WORD PTR [rsi+rcx*2]
  10.   4001dc:       48 01 d0        add    rax,rdx
  11.   4001df:       70 04           jo     4001e5 <P$SIZEOFDEMO_$$_SUM$array_of_SMALLINT$$INT64+0x25>
  12.   4001e1:       e2 f5           loop   4001d8 <P$SIZEOFDEMO_$$_SUM$array_of_SMALLINT$$INT64+0x18>
  13.   4001e3:       70 03           jo     4001e8 <P$SIZEOFDEMO_$$_SUM$array_of_SMALLINT$$INT64+0x28>
The second jo-instruction clearly reads in the source code as j @sum_done (unconditional)
Yours Sincerely
Kai Burghardt

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6393
Re: asm: j is jo, but only sometimes
« Reply #1 on: May 16, 2018, 11:25:37 am »
I don't know the "j" mnemonic, but best is to file a bug. Maybe test with the normal opcode ("jmp") first.

Kays

  • Full Member
  • ***
  • Posts: 112
  • Whasup!?
    • KaiBurghardt.de
Re: asm: j is jo, but only sometimes
« Reply #2 on: May 16, 2018, 11:35:48 am »
I don't know the "j" mnemonic, but best is to file a bug. Maybe test with the normal opcode ("jmp") first.
Bingo.
Yours Sincerely
Kai Burghardt

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus