diff --git a/src/crt/i48shrs_1.src b/src/crt/i48shrs_1.src index a1825becd..b84b4d4df 100644 --- a/src/crt/i48shrs_1.src +++ b/src/crt/i48shrs_1.src @@ -5,6 +5,12 @@ .type __i48shrs_1, @function __i48shrs_1: + ; Input: + ; - UDE:UHL + ; Output: + ; - UDE:UHL >>= 1 (signed) + ; - Carry = shifted-out bit + ; Cost: 24 bytes | 25F + 11R + 8W + 3 push hl scf sbc hl, hl diff --git a/src/crt/i48shru_1.src b/src/crt/i48shru_1.src index 6159a9848..05f58f495 100644 --- a/src/crt/i48shru_1.src +++ b/src/crt/i48shru_1.src @@ -5,6 +5,12 @@ .type __i48shru_1, @function __i48shru_1: + ; Input: + ; - UDE:UHL + ; Output: + ; - UDE:UHL >>= 1 (unsigned) + ; - Carry = shifted-out bit + ; Cost: 24 bytes | 25F + 11R + 8W + 3 push hl scf sbc hl, hl diff --git a/src/crt/ishrs_1.src b/src/crt/ishrs_1.src index d1464ba72..48890e27a 100644 --- a/src/crt/ishrs_1.src +++ b/src/crt/ishrs_1.src @@ -5,6 +5,12 @@ .type __ishrs_1, @function __ishrs_1: + ; Input: + ; - UHL + ; Output: + ; - UHL >>= 1 (signed) + ; - Carry = shifted-out bit + ; Cost: 14 bytes | 15F + 7R + 4W + 2 push hl ld hl, 2 add hl, sp diff --git a/src/crt/ishru_1.src b/src/crt/ishru_1.src index a88c783d5..d81cd0b65 100644 --- a/src/crt/ishru_1.src +++ b/src/crt/ishru_1.src @@ -5,6 +5,12 @@ .type __ishru_1, @function __ishru_1: + ; Input: + ; - UHL + ; Output: + ; - UHL >>= 1 (unsigned) + ; - Carry = shifted-out bit + ; Cost: 14 bytes | 15F + 7R + 4W + 2 push hl ld hl, 2 add hl, sp diff --git a/src/crt/llshl_1.src b/src/crt/llshl_1.src index dfb491ca7..368e880ed 100644 --- a/src/crt/llshl_1.src +++ b/src/crt/llshl_1.src @@ -5,6 +5,12 @@ .type __llshl_1, @function __llshl_1: + ; Input: + ; - BC:UDE:UHL + ; Output: + ; - BC:UDE:UHL <<= 1 + ; - Carry = shifted-out bit + ; Cost: 10 bytes | 11F + 3R + 1 add hl, hl ex de, hl adc hl, hl diff --git a/src/crt/llshrs_1.src b/src/crt/llshrs_1.src index 0e6e2d786..e999d26b8 100644 --- a/src/crt/llshrs_1.src +++ b/src/crt/llshrs_1.src @@ -5,6 +5,12 @@ .type __llshrs_1, @function __llshrs_1: + ; Input: + ; - BC:UDE:UHL + ; Output: + ; - BC:UDE:UHL >>= 1 (signed) + ; - Carry = shifted-out bit + ; Cost: 28 bytes | 29F + 11R + 8W + 3 push hl scf sbc hl, hl diff --git a/src/crt/llshru_1.src b/src/crt/llshru_1.src index 487c9362d..5d0dc9400 100644 --- a/src/crt/llshru_1.src +++ b/src/crt/llshru_1.src @@ -5,6 +5,12 @@ .type __llshru_1, @function __llshru_1: + ; Input: + ; - BC:UDE:UHL + ; Output: + ; - BC:UDE:UHL >>= 1 (unsigned) + ; - Carry = shifted-out bit + ; Cost: 28 bytes | 29F + 11R + 8W + 3 push hl scf sbc hl, hl diff --git a/src/crt/lshrs_1.src b/src/crt/lshrs_1.src index cc47736ef..d54caeac5 100644 --- a/src/crt/lshrs_1.src +++ b/src/crt/lshrs_1.src @@ -5,6 +5,12 @@ .type __lshrs_1, @function __lshrs_1: + ; Input: + ; - E:UHL + ; Output: + ; - E:UHL >>= 1 (signed) + ; - Carry = shifted-out bit + ; Cost: 16 bytes | 17F + 7R + 4W + 2 push hl ld hl, 2 add hl, sp diff --git a/src/crt/lshru_1.src b/src/crt/lshru_1.src index 8aa1bb3ae..5e7c47af7 100644 --- a/src/crt/lshru_1.src +++ b/src/crt/lshru_1.src @@ -5,6 +5,12 @@ .type __lshru_1, @function __lshru_1: + ; Input: + ; - E:UHL + ; Output: + ; - E:UHL >>= 1 (unsigned) + ; - Carry = shifted-out bit + ; Cost: 16 bytes | 17F + 7R + 4W + 2 push hl ld hl, 2 add hl, sp