Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

ADC instruction

mr_biologymr_biology Member Posts: 44
hi..

Could someone explain to me how ADC instruction works?


Comments

  • blipblip Member Posts: 756
    ADC is exactly like ADD, except that it add CF to the sum of the other two operands. It updates CF at the end of the operation like ADD to allow the addition of more ADCs. Example code demonstrating 96-bit addition on a 386+ processor:
    [code]
    ;EAX:EBX:ECX = EAX:EBX:ECX + EDX:ESI:EDI
    add ecx,edi
    adc ebx,esi
    adc eax,edx
    jc OverFlow
    [/code]
    Simple enough eh?

    Technically, though, there is really an AND mask in the instruction that is ANDed with CF and the result is added to the sum of the other two operands. The z80 and 6510 show this behavior as well.
  • Andre YoungAndre Young USAMember Posts: 0

    ___ || http://forcoder.org || free video tutorials and ebooks about // Visual Basic .NET PHP Visual Basic C++ Ruby JavaScript MATLAB Python PL/SQL Objective-C Scratch Go Delphi R Perl Java C# Assembly Swift C SAS Crystal F# Dart Lua Scheme Ada Awk Transact-SQL VBScript FoxPro Logo Clojure D Erlang Rust ABAP Hack Scala Kotlin Fortran Alice LabVIEW Lisp Apex Bash Prolog ML COBOL Julia // ____________

Sign In or Register to comment.