bug-gforth
[Top][All Lists]
Advanced

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

Re: lshift bug


From: Klaus Schleisiek
Subject: Re: lshift bug
Date: Sun, 17 May 2020 22:22:03 +0200
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Am 17.05.2020 um 18:10 schrieb Anton Ertl:

> and this should work as you expect.  But I would not call a result 0
> "mathematically correct".

Aber ja doch! Lshift ist doch so definiert, dass die niederwrtigen Bits mit
Nullen gefüllt werden. Und wenn man so oft oder mehr shifted, als Stellen
vorhanden sind, dann bleiben eben nur Nullen übrig.

> : 2** 1 over lshift swap 8 cells < and ;

Das funktioniert dann aber nur bei 64 Bit. Die ?DO ... LOOP Version funktioniert
immer. Und bedenke bitte, das ich bei uCore auch mit 16, 18, 24, 27 und 32 Bits
Datenwortbreite arbeite und keine "Bytes" habe. Und deshalb ist bei mir cells
immer ein noop. Und deshalb ist : c@ ( addr -- char )  @ $FF and ;
-- 
Klaus Schleisiek
Am Elbufer 8
29478 Höhbeck-Vietze
05846 9804008



reply via email to

[Prev in Thread] Current Thread [Next in Thread]