Re: A86: TI-86 VAT


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

Re: A86: TI-86 VAT




At 08:59 AM 6/12/98 -0400, you wrote:
>
>>>Hi guys,
>>>
>>>If some of the gurus in here get a chance, I'd love having it checked
>>>over for technical accuracy. Some of the info is basic... but hell,
>>>I started z80 programming two days ago.
>>>
>>Looks great! A couple of nitpicky little things (but then, I'm a
>>perfectionist). The VAT can never overflow pg. 7. In the variable routines
>>I've looked at, that causes a memory error. To get the variable size, don't
>>bother with _load_ram_ahl, just use _get_word_ahl ($521d) to get the size
>>in de. Also, if you want the variable size in bytes, there's a ROM routine
>>to do that. You know, because the size word at the start of the variable
>>isn't the size in bytes for a bunch of the variable types.
>
>
>How can the use of _get_word_ahl allow you to find the variable data size of
>the VAT? I didnt know the VAT contained
>information that contained the size of a variable
>

rst 10h
ld a,b	;put var data ptr in ahl
ex de,hl

;then instead of

call _load_ram_ahl
ld e,(hl)
inc hl
ld d,(hl)

;just do

call _get_word_ahl	;does the same thing. Actually, I think it keeps ahl, too.
		;or maybe it moves it to point to the start of the actual data.

>>I call the routine _get_var_size. It's at $477f.
>>Input: a=type, bhl=var data ptr
>>Output: de=size (in bytes), ahl=var data ptr.
>
>
>This call would work great to implement in a shell, you can tell how many
>bytes the program uses
>Cooooooolness
>
Yeah, but a program variable's size word _is_ the number of bytes. It's
only with the math types (matrices, lists, etc.) where you'd need to use
_get_var_size. Check out the descriptions for the _CREATEvar routines. What
you pass it in hl basically goes straight into the size word in the variable.

--Joshua


Follow-Ups: References: