[Prev][Next][Index][Thread]

A92: Handle's Messiah




Hello all,

Sorry for the pun.  I have been totally confused with handles.  I can
allocate and free them without any trouble.  But I can't seem to use them.
I get "Address Error" and "Line 1111 Emulator" errors.  Am I completely
using them incorrectly?  (see the following code)

move.l  #2,-(a7)
jsr tios::HeapAlloc
lea     4(a7),a7
cmp.l   #0,d0
beq \UnableToAlloc
move.w  d0,a0
clr.w   0(a0)
move.w  d0,-(a7)
jsr tios::HeapFree
lea     2(a7),a7
\UnableToAlloc:

Does this program correctly allocate 2 bytes, clear them, and then free the
memory?

====
Aaron Hill (mozart@inlink.com)
IRC Nickname on EF-Net: SeracOhw
http://www.inlink.com/~mozart/i3/