Random Values / Memory Allocation 
Author Message
 Random Values / Memory Allocation

Just two things:

First - an algo request:
Do you possibly know *good* way of getting random values in asm?

Second - call for help:
Maybe some of you guys happen to know the answer to my question:

Why is that it does not work?
I mean that is a call of function 048H of Dos Int (21H)
it's supposed to reserve some memory...
But it does not!
And - why??? Maybe I'm using it incorrectly..
(source is in TASM - below)

THX in advance...

BTW: Replies by personal mail *encouraged*...

----------------------------------SOURCE BEGIN------------------

ASSUME CS:CODE,DS:CODE,SS:STACKSEG

STACKSEG SEGMENT PARA STACK
 db 1024 dup(?)
STACKSEG ENDS

CODE SEGMENT

Start:
        mov ax,4800H                    ;reserve mem
        mov bx,100                      ;(100 paragraphs)
        int 21H                         ;call dos
        mov ax,4c00H                    ;end program
        int 21H                         ;call dos
CODE ENDS

END Start

----------------------------------SOURCE END--------------------

-----=#######=#######=###=##(R)----------------------------------------------
----=####==#=#######=###=###=----      greeetings     from     stealth!     -

--=#==####=-=###=-=###=###=--- http://www.*-*-*.com/ ~pidzki/stealth.html---
-=#######=-=###=-=###=###=---------------------------------------------------



Mon, 20 Sep 1999 03:00:00 GMT  
 Random Values / Memory Allocation

I also need a good section of code on a random number generator.  I'm
really new at this.  I have one in my book, but the teach says it's not
that great.  So I'm looking for another one.

--
Steve Young



Tue, 21 Sep 1999 03:00:00 GMT  
 Random Values / Memory Allocation

Quote:

> First - an algo request:
> Do you possibly know *good* way of getting random values in asm?

> Second - call for help:
> Maybe some of you guys happen to know the answer to my question:

> Why is that it does not work?
> I mean that is a call of function 048H of Dos Int (21H)
> it's supposed to reserve some memory...
> But it does not!
> And - why??? Maybe I'm using it incorrectly..

Przemyslaw,

Both of your questions are answered in the FAQ for this newsgroup.  For
a pseudo random number generator in ASM, see Subject #32 in the General
Part III section.  For why your program fails, see Subject #27 also in
the General Part III.

I upload the FAQ to alt.lang.asm, comp.lang.x86.asm, news.answers,
comp.answers, and alt.answers on or about the 21st of every month.
From that posting, the FAQ is archived at rtfm.mit.edu under those two
lang newsgroups.  You can download the FAQ using anonymous ftp.  Also,
I zip the FAQ and upload it to SimTel in the msdos/info directory.
The filename of the latest is asm9703t.zip for the text version and
asm9703h.zip for the html version.  Lastly, the FAQ is available for
viewing and downloading from my web site.  See my .sig below.

Hope that this helps.

Ray
=====================================================================
Ray Moon

http://www2.dgsys.com/~raymoon/moonware.html
Home of MoonWare Shareware and the x86 Assembly Language FAQ
Come steal my pages...   Well, not steal but come and see!



Tue, 21 Sep 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Memory allocation (was: Re: Herman wants dynamic allocation)

2. Q: value in the array after Allocation

3. :ALLOCATION :CLASS: getting slot value

4. TeX, Pascal/VS, dynamic memory allocation, and so forth

5. Memory allocation on DOS 6.22 / TAWK 4.0

6. Help Needed with Memory pre allocation

7. Memory allocation in DOS gawk

8. Memory allocations in Smalltalk

9. appe memory allocation?

10. Help !!! Memory allocation problems with VW2.5.2

11. Direct control over storage allocation and memory management

 

 
Powered by phpBB® Forum Software