[Coco] A bug in Basic09/RunB

Willard Goosey goosey at virgo.sdc.org
Mon Dec 7 22:59:18 EST 2009


On Sun, Dec 06, 2009 at 05:49:58PM -0800, Wayne Campbell wrote:
> 
> The first bug occurs when you pass a byte by value:

This has already been addressed by others.  Type promotion by
padding.  

> The second bug occurs when you pass multiple variables into a single
> variable. 

That's not supported.  Don't do that.  You can't really expect it to
do anything but crash and burn.

Sorry to shoot you down so bluntly, but there it is.  A compiler with
a stronger type system than BASIC-09's would flag this at compile
time.  There's a difference between passing 3 ints and passing an
array of 3 ints.

As you said earlier:

> Second, as long as the receiving variable is of the correct size, it
> doesn't matter what type or order you specify the parameter list
> in. It just has to match the size.

And so it doesn't work if you pass 3 args of size 2 to a subroutine
expecting 1 arg of size 6.

Appendix C-1 of the Microware C manual discribes the calling
convention BASIC-09 uses to RUN binary subroutines.  

Willard	
-- 
Willard Goosey  goosey at sdc.org
Socorro, New Mexico, USA
I search my heart and find Cimmeria, land of Darkness and the Night.
  -- R.E. Howard




More information about the Coco mailing list