flat assembler
Message board for the users of flat assembler.

Index > Main > Modulus

Author
Thread Post new topic Reply to topic
1800askgeek



Joined: 04 Apr 2004
Posts: 10
Location: Hawaii
1800askgeek 08 Apr 2004, 05:41
How???

I tried:
mod cx, 10

with cx set to 18....

shouldn't that set cx to 8???
Yet it gives me an error:

"Illeagal instruction"

why?
Post 08 Apr 2004, 05:41
View user's profile Send private message Visit poster's website AIM Address Reply with quote
VitalOne



Joined: 29 Jul 2003
Posts: 54
Location: USA
VitalOne 08 Apr 2004, 06:06
Code:
xor dx,dx
mov ax,18
mov cx,10
div cx
;Remainder in DX
    
Post 08 Apr 2004, 06:06
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
1800askgeek



Joined: 04 Apr 2004
Posts: 10
Location: Hawaii
1800askgeek 08 Apr 2004, 06:24
... how does division work in assembly? Perhaps that's the question I should be asking.

Anyway, thanks for that code. It worked perfectly.
Post 08 Apr 2004, 06:24
View user's profile Send private message Visit poster's website AIM Address 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.