6.1.2360 UM* u-m-star CORE

( u1 u2 -- ud )

Multiply u1 by u2, giving the unsigned double-cell product ud. All values and arithmetic are unsigned.

Testing:

T{ 0 0 UM* -> 0 0 }T
T{ 0 1 UM* -> 0 0 }T
T{ 1 0 UM* -> 0 0 }T
T{ 1 2 UM* -> 2 0 }T
T{ 2 1 UM* -> 2 0 }T
T{ 3 3 UM* -> 9 0 }T

T{ MID-UINT+1 1 RSHIFT 2 UM* ->  MID-UINT+1 0 }T
T{ MID-UINT+1          2 UM* ->           0 1 }T
T{ MID-UINT+1          4 UM* ->           0 2 }T
T{         1S          2 UM* -> 1S 1 LSHIFT 1 }T
T{   MAX-UINT   MAX-UINT UM* ->    1 1 INVERT }T

ContributeContributions

AdrianMcMenaminavatar of AdrianMcMenamin [230] Question about final testRequest for clarification2022-04-02 21:58:34

I don't understand why MAXUINT MAXUINT UM* would generate 1 1 eg for 0xFFFFFFFF 0xFFFFFFFF surely it should be 0x1 0xFFFFFFFE?

AntonErtlavatar of AntonErtl

Indeed. The test gives the result as 1 1 invert, and 1 invert is $f..fe.

Closed
Reply New Version