Re: A82: Creating a VAR (the ROM_CALL)


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

Re: A82: Creating a VAR (the ROM_CALL)




Yes, just add the type as you did.


Try using the first one to determine how muchof the user mem which is
free. The TIOS uses the user mem for some of its buffers, and when your
program is started it is very likely that these buffers take up all the
free mem. So if you need mem you need to resize the buffers so they leave
space for you var. 

What the calc does is something like the following. When yuou goto the
homescreen it reserves all free user memory for user input. The reason for
that is that the input routine needs to know how meny chars you are
allowed to enter (which is only limited by the amount of free mem). The
routine also needs a buffer of that size to store the chars in. When you
start your asm shell, it starts a basic program which waits for a key,
this routine uses the function as the main routine. Before the program
cleans up the mem the shell is called => no mem free for your program.

Resizing the buffers to 0 bytes works, but it means that the ANS history
(and ENTRY ?) disappears.

Dines
 __________________________________________

Dines Justesen
Email: c958362@student.dtu.dk
WWW  : http://www.student.dtu.dk/~c958362/
__________________________________________

On Sat, 3 Oct 1998, Evil Sam wrote:

> 
> >I think you have to set the type of the VAR too (load into OP1).
> 
>  You mean changing this:
> 
> >> CreateLvl:
> >>  ld hl,game
> >>  call $1A88
> >>  ld     hl, 260
> >>  jp   $22E0
> >> 
> >> game:
> >>  .db "PJLVLSAM",0
> >> 
> >>
> 
>  to using this
> 
>   ld hl,game
>   call $1A88
>   ld     hl, 260
>   jp   $22E0
> 
> game:
>  .db 5,"PJLVLSAM",0
> 
>   ?????? That's how its done on the 83.     
> 
> > Besides
> >that try cheking the amount of free mem before you call the function 
> (It
> >is normally =0 !). The reason is that ! or # is talking up all the 
> space.
> >Delete the one which takes up all the scaca (or resize it to 0 byte ?),
> >before you try to create new vars.
> >
> >DInes
> 
>    I guess that's why it says ERROR: MEMORY, but I have absolutely no 
> idea what you are talking about in the above statements with the ! and # 
> symbols. Maybe you mean one of these:
> 
> ---- CALL 2297 ---- Is memory availble 
> --------------------------------------
> Input: HL = Number of bytes to get
> Result: DE = Number of bytes to get
>         HL = Number of bytes you can have extra
>         Carry clear on succes
> 
> ---- CALL 22C8 ---- Is memory availble 2 
> ------------------------------------
> Input: HL = Size of variable data
>        OP1 = holds variable information on the var
>        If the variable is a  program then A = length of name
> Result: Carry clear if you can get it set otherwise.
> Note: This function check that there is room for the data and the vat 
> entry.
> 
> 
> ---- CALL 2848 ---- Is memory availble 
> --------------------------------------
> Input: HL = Number of bytes to get
> Result: Same as 2297, but error handler called on error.
> 
>    But what do any of these do? And why is it important to check for 
> availible memory even when there is 27K free on the calc?
> 
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
> 


References: