Register | Login
Forum Index > Source Help > How would i Use the Div and iDiv in ziron?
Author Message
Pages: 1
Molotov
Member
(send private message)

Posts: 49
Topics: 21

Location:
Behind Keyboard
[1005] How would i Use the Div and iDiv in ziron? - posted: 2012-01-31 20:57:39
I was trying to test div and idiv a few days ago but got stuck.

Can you post an example on how i should use it in Ziron?

"Lerning new things is what life is all about, if you are always doing the same old things day in and day out you might aswell just kill yourself." - ME d^_^b
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1006] - posted: 2012-01-31 21:01:06
Hi Molotov,

here is a small example of using div

Code:
program WIN32CUI 'Test';

#include 'ch.zir';

//your denominator
ecx = 4;

//edx:eax is your qword number to divide up.
edx = 0;
eax = 25;

div ecx;

//eax is your result
print('Result = ', eax:int, '\r\n');
//edx is your remainder
print('Remainder = ', edx:int, '\r\n');

wait_key(nil);

ExitProcess(0);


as for idiv, it is the same as div only it is for signed division, and div is for unsigned

hope that helps.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Molotov
Member
(send private message)

Posts: 49
Topics: 21

Location:
Behind Keyboard
[1007] - posted: 2012-01-31 22:59:33
ok.. thanks. smile

"Lerning new things is what life is all about, if you are always doing the same old things day in and day out you might aswell just kill yourself." - ME d^_^b
Pages: 1
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 16 user(s) online. 0 member(s) and 16 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd