From eb533335e68ce687053fd28b43ab158b5de120a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Wed, 18 Apr 2007 07:43:47 +0000 Subject: [PATCH] feat: utilisation de la librarie math.lib pour l'usage des fonctions Randomize et random. --- programs/test.asm | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/programs/test.asm b/programs/test.asm index 11a3af4..eff3eb2 100644 --- a/programs/test.asm +++ b/programs/test.asm @@ -14,6 +14,7 @@ start: header exe <"CE",1,0,0,,offset imports,,offset realstart> realstart: + call [cs:randomize] push 0FFFFh pushd 652201 pushd 1545454545 @@ -91,29 +92,13 @@ go4: call [restorestate] retf put: - call random - mov di,dx + call [cs:random] + mov di,ax and di,4096-2 mov si,offset fond call showstring2 ret -random: - push ax - MOV AX,[cs:randseed] - MOV DX,8405h - MUL DX - INC AX - MOV [cs:randseed],AX - pop ax - ret -randseed dw 1234h -Randomize: - push ax cx dx - mov ah,0 - int 1ah - mov [cs:randseed],dx - pop dx cx ax - ret + zero db 'Chaine a z‚ro terminal',0 fixe db 20,'Chaine a taille fixe' @@ -156,6 +141,8 @@ strinaize4: importing +use MATH.LIB,randomize +use MATH.LIB,random use VIDEO.LIB,print use VIDEO,xchgpages use VIDEO,setvideomode