Howdy, Stranger!

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

Categories

any code to calculate y=a*x^2+b*x+c ?

I'm looking for 8086 ASM code that calculates
[code]y=a*x^2+b*x+c[/code] with a, b, c coefficients
and x varying for positive values.

If possible I'd like it to be compatible with
emu8086.

Thank you.

Comments

  • blipblip Member Posts: 756
    [code]
    ;Input: AL = A, BH=B, BL=X, CX=C
    ;Output: SI:DI = Y
    ;Destroyed:
    mul bl ;AX = AL * CL
    mul ax ;DX:AX = AX * AX
    mov di,ax
    mov si,dx
    mov al,bh
    mul bl ;AX = AL * BL
    add ax,cx
    add di,ax
    adc si,0
    ret
    [/code]
  • Andre YoungAndre Young USAMember Posts: 0

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

Sign In or Register to comment.