Path: utzoo!attcan!uunet!van-bc! From: lphillips@lpami.wimsey.bc.ca (Larry Phillips) Newsgroups: comp.sys.amiga.tech Subject: Re: Assembly question from turnip Keywords: can allocmem crash? Message-ID: <2169@lpami.wimsey.bc.ca> Date: 27 Oct 90 21:36:28 GMT Lines: 38 Return-Path: To: van-bc!rnews In <272a5374-a00.6comp.sys.amiga.tech-1@tronsbox.xei.com>, dfrancis@tronsbox.xei.com (Dennis Francis Heffernan) writes: > OK, I *knew* it had to be something stupid. In all the sample code >I looked at, I somehow never noticed that it was a dollar sign in front of >the four and not a number sign. > It hath been expunged. I had already knocked out the byte references >in favor of longwords or moveq instructions. > > As for checking the condition codes, I was under the impression that >any time you moved a zero into a data register, the zero flag was set. I >don't see then how the system calls could NOT set the flag, but I'll take your >words for it. There is no guarantee that the last operation to affect the condition codes is the one you are interested in (the move of the result to D0). In other words, the result might be moved to D0, then something else moved to or from another data reg, before control is returned to your program. > NEW QUESTION: When you do an AllocMem(), do you get a pointer to the >TOP of the allocated area or the BOTTOM? I'd think it'd be the top, but >after that first mistake... (You want a better one? Try this: Well, it all depends on what you call the top or the bottom of the allocated memory. I don't know your background, and if it includes any Intel CPU programming, it's likely to be different from the more sane processors. :-) The returned result is the address of the bottom of the allocated memory, or in other words, the lowest address. -larry -- It is not possible to both understand and appreciate Intel CPUs. -D.Wolfskill +-----------------------------------------------------------------------+ | // Larry Phillips | | \X/ lphillips@lpami.wimsey.bc.ca -or- uunet!van-bc!lpami!lphillips | | COMPUSERVE: 76703,4322 -or- 76703.4322@compuserve.com | +-----------------------------------------------------------------------+