diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-05-16 21:46:37 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-05-16 21:47:47 -0700 |
commit | 0ab5f6fb3af7d26a102913ef0abe17d114a3e60f (patch) | |
tree | 7353d587b51a6a8400b2c9d4cca755dbddb3a684 | |
parent | 92984d557e4ead80ba3e52cdb6be6e6c578a5f9b (diff) | |
download | mu-0ab5f6fb3af7d26a102913ef0abe17d114a3e60f.tar.gz |
mu.subx: support bitwise not
-rwxr-xr-x | linux/mu | bin | 608300 -> 608477 bytes | |||
-rw-r--r-- | linux/mu.subx | 51 | ||||
-rw-r--r-- | mu.md | 3 | ||||
-rw-r--r-- | mu_instructions | 4 |
4 files changed, 58 insertions, 0 deletions
diff --git a/linux/mu b/linux/mu index 75d696b2..c5823b80 100755 --- a/linux/mu +++ b/linux/mu Binary files differdiff --git a/linux/mu.subx b/linux/mu.subx index 7c6f46c3..ecdb7b43 100644 --- a/linux/mu.subx +++ b/linux/mu.subx @@ -31251,6 +31251,47 @@ _Primitive-or-lit-with-mem: # (payload primitive) 0/imm32/no-xm32 0/imm32/no-x32 0x11/imm32/alloc-id:fake + _Primitive-not-reg/imm32/next +# - not +_Primitive-not-reg: # (payload primitive) + 0x11/imm32/alloc-id:fake:payload + # var1/reg <- not => f7 2/subop/not var1/rm32 + 0x11/imm32/alloc-id:fake + _string-not/imm32/name + 0/imm32/no-inouts + 0/imm32/no-inouts + 0x11/imm32/alloc-id:fake + Single-int-var-in-some-register/imm32/outputs + 0x11/imm32/alloc-id:fake + _string_f7_subop_not/imm32/subx-name + 3/imm32/rm32-is-first-output + 0/imm32/no-r32 + 0/imm32/no-imm32 + 0/imm32/no-imm8 + 0/imm32/no-disp32 + 0/imm32/no-xm32 + 0/imm32/no-x32 + 0x11/imm32/alloc-id:fake + _Primitive-not-mem/imm32/next +_Primitive-not-mem: # (payload primitive) + 0x11/imm32/alloc-id:fake:payload + # not var1 => f7 2/subop/not var1/rm32 + 0x11/imm32/alloc-id:fake + _string-not/imm32/name + 0x11/imm32/alloc-id:fake + Single-int-var-in-mem/imm32/inouts + 0/imm32/no-outputs + 0/imm32/no-outputs + 0x11/imm32/alloc-id:fake + _string_f7_subop_not/imm32/subx-name + 1/imm32/rm32-is-first-inout + 0/imm32/no-r32 + 0/imm32/no-imm32 + 0/imm32/no-imm8 + 0/imm32/no-disp32 + 0/imm32/no-xm32 + 0/imm32/no-x32 + 0x11/imm32/alloc-id:fake _Primitive-xor-with-eax/imm32/next # - xor _Primitive-xor-with-eax: # (payload primitive) @@ -34256,6 +34297,11 @@ _string-negate: # (payload array byte) # "negate" 0x6/imm32/size 0x6e/n 0x65/e 0x67/g 0x61/a 0x74/t 0x65/e +_string-not: # (payload array byte) + 0x11/imm32/alloc-id:fake:payload + # "not" + 0x3/imm32/size + 0x6e/n 0x6f/o 0x74/t _string-or: # (payload array byte) 0x11/imm32/alloc-id:fake:payload # "or" @@ -34823,6 +34869,11 @@ _string_f7_subop_negate: # "f7 3/subop/negate" 0x11/imm32/size 0x66/f 0x37/7 0x20/space 0x33/3 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x6e/n 0x65/e 0x67/g 0x61/a 0x74/t 0x65/e +_string_f7_subop_not: + 0x11/imm32/alloc-id:fake:payload + # "f7 2/subop/not" + 0xe/imm32/size + 0x66/f 0x37/7 0x20/space 0x32/2 0x2f/slash 0x73/s 0x75/u 0x62/b 0x6f/o 0x70/p 0x2f/slash 0x6e/n 0x6f/o 0x74/t _string_ff_subop_increment: # (payload array byte) 0x11/imm32/alloc-id:fake:payload # "ff 0/subop/increment" diff --git a/mu.md b/mu.md index dc6d9ff0..e3ed5418 100644 --- a/mu.md +++ b/mu.md @@ -221,6 +221,9 @@ or-with var1, var2/reg var/reg <- or n or-with var, n +var1/reg1 <- not +not var + var1/reg1 <- xor var2/reg2 var/reg <- xor var2 xor-with var1, var2/reg diff --git a/mu_instructions b/mu_instructions index 7a458660..2dca40c4 100644 --- a/mu_instructions +++ b/mu_instructions @@ -75,6 +75,10 @@ var/reg <- or n => "81 1/subop/or %" reg " " n "/imm32" or-with var, n => "81 1/subop/or *(ebp+" var.stack-offset ") " n "/imm32" or-with *var/reg, n => "81 1/subop/or *" reg " " n "/imm32" +var/reg <- not => "f7 2/subop/not %" reg +not var => "f7 2/subop/not *(ebp+" var.stack-offset ")" +not *var/reg => "f7 2/subop/not *" reg + var/reg <- xor var2/reg2 => "31/xor-with %" reg " " reg2 "/r32" var/reg <- xor var2 => "33/xor *(ebp+" var2.stack-offset ") " reg "/r32" var/reg <- xor *var2/reg2 => "33/xor *" reg2 " " reg "/r32" |