NO

Author Topic: ADC  (Read 699 times)

Offline HellOfMice

  • Member
  • *
  • Posts: 360
  • Never be pleased, always improve
ADC
« on: January 28, 2025, 02:33:22 PM »
I found something strange:


Code: [Select]
14 01                               | ADC      AL,114
14 FF                               | ADC      AL,-114


Felix Cloutier on his site (https://www.felixcloutier.com/x86/adc) tells:
Quote
The ADC instruction does not distinguish between signed or unsigned operands. Instead, the processor evaluates the result for both data types and sets the OF and CF flags to indicate a carry in the signed or unsigned result, respectively. The SF flag indicates the sign of the signed result.
But the result is strange, why does it proceed like this?
--------------------------------
Kenavo

Offline Vortex

  • Member
  • *
  • Posts: 975
    • http://www.vortex.masmcode.com
Re: ADC
« Reply #1 on: January 29, 2025, 08:41:36 PM »
Hi Philippe,

Here, the OF and CF flags should operate for both ıf the signed and unsigned arithmetics.
Code it... That's all...

Offline HellOfMice

  • Member
  • *
  • Posts: 360
  • Never be pleased, always improve
Re: ADC
« Reply #2 on: January 29, 2025, 08:44:57 PM »
i TRIED WITH OTHER NUMBERS i DON4T UNDERTANS
--------------------------------
Kenavo