[OpenBIOS] [PATCH 10/10] Adding filll Forth primitive

William Hahne will07c5 at gmail.com
Wed Aug 10 17:50:54 CEST 2011


On Wed, Aug 10, 2011 at 6:01 AM, Mark Cave-Ayland <
mark.cave-ayland at siriusit.co.uk> wrote:

> On 09/08/11 22:55, William Hahne wrote:
>
>  This is a forth primitive that is required by BootX. It just fills some
>> specified memory address and length with longs.
>>
>>
>> Index: kernel/forth.c
>> ==============================**==============================**=======
>> --- kernel/forth.c (revision 1041)
>> +++ kernel/forth.c (working copy)
>> @@ -1610,6 +1616,20 @@
>> memset(src, value, count);
>>  }
>> +/*
>> + *  filll       ( addr len byte -- )
>> + */
>> +static void filll(void)
>> +{
>> +    ucell value = POP();
>> + ucell count = POP();
>> + ucell *dest = (ucell *)cell2pointer(POP());
>> +
>> + int i;
>> + for (i = 0; i <= count / 4; i++) {
>> +    dest[i] = value;
>> + }
>> +}
>>  /*
>>   *  unaligned-w@  ( addr -- w )
>> @@ -1963,4 +1983,5 @@
>>      do_encode_file,         /* $encode-file */
>>      do_debug_xt,            /* (debug  */
>>      do_debug_off,           /* (debug-off) */
>> +    filll                   /* filll */
>>  };
>> Index: kernel/bootstrap.c
>> ==============================**==============================**=======
>> --- kernel/bootstrap.c (revision 1041)
>> +++ kernel/bootstrap.c (working copy)
>> @@ -89,7 +89,7 @@
>> "here", "here!", "dobranch", "do?branch", "unaligned-w@",
>> "unaligned-w!", "unaligned-l@", "unaligned-l!", "ioc@", "iow@",
>> "iol@", "ioc!", "iow!", "iol!", "i", "j", "call", "sys-debug",
>> - "$include", "$encode-file", "(debug", "(debug-off)"
>> + "$include", "$encode-file", "(debug", "(debug-off)", "filll"
>>  };
>>  /*
>>
>
> This looks reasonably straightforward - again, can you add a reference to
> the documentation for this word as part of the commit message?
>
>
I wish I could. I had to do reverse engineer it from Apple's OF
implementation. I don't believe it is an official OF word.


>
> ATB,
>
> Mark.
>
> --
> Mark Cave-Ayland - Senior Technical Architect
> PostgreSQL - PostGIS
> Sirius Corporation plc - control through freedom
> http://www.siriusit.co.uk
> t: +44 870 608 0063
>
> Sirius Labs: http://www.siriusit.co.uk/labs
>
> --
> OpenBIOS                 http://openbios.org/
> Mailinglist:  http://lists.openbios.org/**mailman/listinfo<http://lists.openbios.org/mailman/listinfo>
> Free your System - May the Forth be with you
>

William Hahne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openbios.org/pipermail/openbios/attachments/20110810/17fdd1f2/attachment-0001.html>


More information about the OpenBIOS mailing list