diff --git a/README.md b/README.md
index 89e987c..6c2ebb7 100644
--- a/README.md
+++ b/README.md
@@ -467,46 +467,26 @@ Many instructions have two forms:
; Count leading zeros
(clz Wr Rd)
(clz RW)
-
-; Count leading zeros in the lower 32 bits
-(clz32 Wr Rd)
-(clz32 RW)
-
-; Count leading zeros in the lower 16 bits
-(clz16 Wr Rd)
-(clz16 RW)
-
-; Count leading zeros in the lower byte
-(clz8 Wr Rd)
-(clz8 RW)
+; Count leading zeros in the lower XX bits
+(clzXX Wr Rd)
+(clzXX RW)
+; Count leading zeros in the XX bits starting at YY (e.g. 16/32 is the lower 16 bits of the higher 32 bits)
+(clzXX/YY Wr Rd)
+(clzXX/YY RW)
; Count leading ones
(clo Wr Rd)
(clo RW)
-
-; Count leading ones in the lower 32 bits
-(clo32 Wr Rd)
-(clo32 RW)
-
-; Count leading ones in the lower 16 bits
-(clo16 Wr Rd)
-(clo16 RW)
-
-; Count leading ones in the lower byte
-(clo8 Wr Rd)
-(clo8 RW)
-
-; Sign extend 32-bit to 64 bits
-(se32 Wr Rd)
-(se32 RW)
-
-; Sign extend 16-bit to 64 bits
-(se16 Wr Rd)
-(se16 RW)
-
-; Sign extend 8-bit to 64 bits
-(se8 Wr Rd)
-(se8 RW)
+; Count leading ones in the lower XX bits
+(cloXX Wr Rd)
+(cloXX RW)
+; Count leading ones in the XX bits starting at YY
+(cloXX/YY Wr Rd)
+(cloXX/YY RW)
+
+; Sign extend a XX-bit value to 64 bits, XX in range 1..63)
+(seXX Wr Rd)
+(seXX RW)
; AND A&B
(and Wr Rd Rd)
diff --git a/compile_examples.sh b/compile_examples.sh
new file mode 100755
index 0000000..cdc0960
--- /dev/null
+++ b/compile_examples.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e
+
+cargo build
+
+for file in examples/*.csn
+do
+ echo "--- $file ---"
+ target/debug/launcher -P "$file"
+done
diff --git a/crsn/src/builtin/defs.rs b/crsn/src/builtin/defs.rs
index 86adb3d..3bf1b65 100644
--- a/crsn/src/builtin/defs.rs
+++ b/crsn/src/builtin/defs.rs
@@ -41,7 +41,7 @@ pub enum LdsValue {
Chars(String),
}
-#[derive(Clone, Copy, Debug, PartialEq)]
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct BitSlice {
pub width: u32,
pub src_pos: u32,
@@ -80,7 +80,50 @@ impl BitSlice {
Self::default()
}
+ /// Parse LEN (no SRC and DST)
+ pub fn parse1(src: &str, pos: &SourcePosition) -> Result