[Coco] A bug in Basic09/RunB
asa.rand at gmail.com
Tue Dec 8 00:09:37 EST 2009
I understand. In most languages I have looked at this is true. I am merely
testing the limits of what appeared to be a possibility, given that I can
pass a 32-byte array to a 32-character string, or vice-versa, and it works
just fine. No type checking. I thought, if this is true, then I should be
able to pass 3 parameters, the sum of whose lengths equal the size of the
expected variable. I guess the former is relegated to individual parameters,
and not the list as a whole.
I am still thinking that the field passing issue needs to be looked into. I
don't think there is any reason why I can't pass a field reference more than
1 field deep. From what I've seen in my tests, it's as though the pointer in
the parameter list is pointing to the first field instead of the second. I
wish I understood more of what is going on there. I may be totally off in my
thinking, just because I don't understand what's going on at the object code
----- Original Message -----
From: "Willard Goosey" <goosey at virgo.sdc.org>
To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
Sent: Monday, December 07, 2009 7:59 PM
Subject: Re: [Coco] A bug in Basic09/RunB
> 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
>> The second bug occurs when you pass multiple variables into a single
> 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 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
> Coco mailing list
> Coco at maltedmedia.com
More information about the Coco