Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #135130

Re: Forth for a balanced ternary machine

Date 2026-06-05 17:37 +1000
Subject Re: Forth for a balanced ternary machine
Newsgroups comp.lang.forth
References (1 earlier) <2026May25.201036@mips.complang.tuwien.ac.at> <6a153548$1@news.ausics.net> <10vkt7m$2gnof$1@dont-email.me> <6a1f9fd9$1@news.ausics.net> <2026Jun4.140819@mips.complang.tuwien.ac.at>
From dxf <dxforth@gmail.com>
Message-ID <6a227cb5@news.ausics.net> (permalink)
Organization Ausics - https://newsgroups.ausics.net

Show all headers | View raw


On 4/06/2026 10:08 pm, Anton Ertl wrote:
> dxf <dxforth@gmail.com> writes:
>> On 2/06/2026 7:23 am, Hans Bezemer wrote:
>> In eForth one finds:
>>
>>  : 2*  2 * ;
>>  : 2/  2 / ;
>>
>> which rather defeats the purpose of the functions which is speed.
> 
> But eForth's purpose is not speed.

Wondering if there was a rationale for eForth, I found this from Bill
Muench's old webpage:

  "I wrote eForth so that it would be easier for me to develop Forth 
   systems for many processors. Processors included 56000, 6502, 68332, 
   68HC11, 8051, 8080, 80C166, 80C196, 80x86, RTX2000, RTX2001, RTX2010, 
   SC32, StrongARM, TMS320, Z80, and I may have forgotten some.

   eForth allows me to make a complete Forth system with about 30 very 
   simple machine code routines. With so few words to code, I could do 
   the coding by hand, that is, without the need to write an assembler 
   first. After this simple model is running, it is desirable to code 
   much of the rest in assembly."

That "30" figure perhaps explains why  1+ 1- 2+ 2- 2* 2/  were excluded
from the kernel and provided as high-level definitions.  The idea being
users would eventually 'code' them.

> 
>> As to what is returned by a bit-shifting 2/ depends on the hardware.
>> For 2's complement it's floored.  For 1's complement it's symmetric.
>> For signed-magnitude it's ...
> 
> For sign-magnitude an arithmetic interpretation is that, for positive
> numbers, it's division by 2, while for negative numbers, it's the
> average between the number and -2^(n-1) (where n is the number of bits
> in a cell).  It's not very useful for sign-magnitude, but given that
> sign-magnitude and ones-complement have died out long ago and never
> had Forth systems, who cares.

Thanks.  Not dead enough for Forth-94 which was the first standard to
expressly mention and support them.  For that reason I was curious what
2/ would do on these.  As the effect does vary, I would expect '94 to
have documented it.  But then the same happened with other words.

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Forth for a balanced ternary machine Matthias Koch <m.cook@gmx.net> - 2026-05-25 14:58 +0200
  Re: Forth for a balanced ternary machine anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-05-25 18:10 +0000
    Re: Forth for a balanced ternary machine dxf <dxforth@gmail.com> - 2026-05-26 15:53 +1000
      Re: Forth for a balanced ternary machine anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-05-26 07:46 +0000
        Re: Forth for a balanced ternary machine dxf <dxforth@gmail.com> - 2026-05-27 00:52 +1000
          Teaching Scenarios [Re: Forth for a balanced ternary machine] Buzz McCool <buzz_mccool@yahoo.com> - 2026-05-26 08:52 -0700
            Re: Teaching Scenarios [Re: Forth for a balanced ternary machine] dxf <dxforth@gmail.com> - 2026-05-28 21:03 +1000
            Re: Teaching Scenarios [Re: Forth for a balanced ternary machine] anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-05-30 20:16 +0000
              Re: Teaching Scenarios [Re: Forth for a balanced ternary machine] minforth <minforth@gmx.net> - 2026-05-31 11:02 +0200
                Re: Teaching Scenarios [Re: Forth for a balanced ternary machine] anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-05-31 14:13 +0000
          Division (was: Forth for a balanced ternary machine) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-05-30 18:23 +0000
            Re: Division dxf <dxforth@gmail.com> - 2026-05-31 12:49 +1000
              Re: Division anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-05-31 14:20 +0000
                Re: Division dxf <dxforth@gmail.com> - 2026-06-01 12:47 +1000
              arithmetic shift right (was: Division) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-05-31 14:43 +0000
                Re: arithmetic shift right dxf <dxforth@gmail.com> - 2026-06-01 18:18 +1000
      Re: Forth for a balanced ternary machine Hans Bezemer <the.beez.speaks@gmail.com> - 2026-06-01 23:23 +0200
        Re: Forth for a balanced ternary machine dxf <dxforth@gmail.com> - 2026-06-03 13:30 +1000
          Re: Forth for a balanced ternary machine Hans Bezemer <the.beez.speaks@gmail.com> - 2026-06-04 11:59 +0200
            Re: Forth for a balanced ternary machine anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-06-04 12:15 +0000
          Re: Forth for a balanced ternary machine anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-06-04 12:08 +0000
            Re: Forth for a balanced ternary machine dxf <dxforth@gmail.com> - 2026-06-05 17:37 +1000
              Re: Forth for a balanced ternary machine anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-06-05 09:22 +0000
    Re: Forth for a balanced ternary machine Matthias Koch <m.cook@gmx.net> - 2026-05-28 13:36 +0200

csiph-web