From d1320a4772ab9057200f64ec24b6047694e017ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Wed, 18 Apr 2007 07:43:02 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20ajout=20de=20la=20librairie=20math.lib?= =?UTF-8?q?=20qui=20contiendra=20les=20fonctionnalit=C3=A9s=20math=C3=A9ma?= =?UTF-8?q?tiques=20de=20base?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/MAKEFILE | 2 +- lib/math.asm | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 lib/math.asm diff --git a/lib/MAKEFILE b/lib/MAKEFILE index 3d9926c..ce1facc 100644 --- a/lib/MAKEFILE +++ b/lib/MAKEFILE @@ -1,7 +1,7 @@ asm= lzasm /z/t lnk= elink -all: detect.lib video.lib str0.lib bmp.lib graphic.lib 3d.lib +all: detect.lib video.lib str0.lib bmp.lib graphic.lib 3d.lib math.lib .asm.obj: $(asm) $< diff --git a/lib/math.asm b/lib/math.asm new file mode 100644 index 0000000..77cb89c --- /dev/null +++ b/lib/math.asm @@ -0,0 +1,38 @@ +model tiny,stdcall +p586 +locals +jumps +codeseg +option procalign:byte + +include "..\include\mem.h" + +org 0h + +header exe <"CE",1,0,0,offset exports,,,> + +exporting +declare random +declare randomize +ende + +randseed dw 1234h + +PROC random FAR + USES dx + mov ax,[cs:randseed] + mov dx,8405h + mul dx + inc ax + mov [cs:randseed],ax + mov ax,dx + ret +endp random + +PROC randomize FAR + USES ax,cx,dx + mov ah,0 + int 1ah + mov [cs:randseed],dx + ret +endp randomize