flat assembler
Message board for the users of flat assembler.

Index > Windows > math in assembly

Author
Thread Post new topic Reply to topic
baller34



Joined: 29 Oct 2008
Posts: 2
baller34
I am pretty new to assembly and I was just wondering how to do some basic math functions in assembly. Like adding, subtracting, multiplying, and dividing. Does anyone have information on this?
Post 29 Oct 2008, 13:36
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17281
Location: In your JS exploiting you and your system
revolution
Well the x86 integer instruction set has ADD, SUB, MUL and DIV. And the x86 floating point instruction set has FADD, FSUB, FMUL and FDIV.
Post 29 Oct 2008, 14:00
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
look at section 2.1.3 of the fasm manual, it explains how to use the instructions revolution posted. For the floating point instructions he posted look at section 2.1.13

And while your at it, read most of the manual. I found it very helpful when I was learning assembly.

Also, A good reference for looking up what a certain assembly instruction does are the intel instruction set manuals:
On this page


If you're coming from a hll language like C, then This site could be helpful.
Post 29 Oct 2008, 14:08
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.