0

假设我想将小写字母转换为大写字母。显然,我需要清楚地这样做:

所以是这样的:

01101100 

变成这样:

01001100

我们是否有类似 bitclearing 的功能,以便我们可以清除字节内的位?一个浪费的例子将不胜感激。

4

1 回答 1

1

Perform a bitwise conjunction with a suitable mask, as usual:

(i32.and (i32.const 0x6c) (i32.const 0xdf))

where 0x6c is your value, and 0xdf is the bit mask 11011111.

于 2017-04-22T19:06:34.397 回答