Skip to content

Commit 58dfbd8

Browse files
committed
specified Carry-out for __*shift_1 routines and Sign-out for __llshl_1
1 parent f69a9d1 commit 58dfbd8

9 files changed

Lines changed: 55 additions & 0 deletions

File tree

src/crt/i48shrs_1.src

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
.type __i48shrs_1, @function
66

77
__i48shrs_1:
8+
; Input:
9+
; - UDE:UHL
10+
; Output:
11+
; - UDE:UHL >>= 1 (signed)
12+
; - Carry = shifted-out bit
13+
; Cost: 24 bytes | 25F + 11R + 8W + 3
814
push hl
915
scf
1016
sbc hl, hl

src/crt/i48shru_1.src

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
.type __i48shru_1, @function
66

77
__i48shru_1:
8+
; Input:
9+
; - UDE:UHL
10+
; Output:
11+
; - UDE:UHL >>= 1 (unsigned)
12+
; - Carry = shifted-out bit
13+
; Cost: 24 bytes | 25F + 11R + 8W + 3
814
push hl
915
scf
1016
sbc hl, hl

src/crt/ishrs_1.src

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
.type __ishrs_1, @function
66

77
__ishrs_1:
8+
; Input:
9+
; - UHL
10+
; Output:
11+
; - UHL >>= 1 (signed)
12+
; - Carry = shifted-out bit
13+
; Cost: 14 bytes | 15F + 7R + 4W + 2
814
push hl
915
ld hl, 2
1016
add hl, sp

src/crt/ishru_1.src

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
.type __ishru_1, @function
66

77
__ishru_1:
8+
; Input:
9+
; - UHL
10+
; Output:
11+
; - UHL >>= 1 (unsigned)
12+
; - Carry = shifted-out bit
13+
; Cost: 14 bytes | 15F + 7R + 4W + 2
814
push hl
915
ld hl, 2
1016
add hl, sp

src/crt/llshl_1.src

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
.type __llshl_1, @function
66

77
__llshl_1:
8+
; Input:
9+
; - BC:UDE:UHL
10+
; Output:
11+
; - BC:UDE:UHL <<= 1
12+
; - Carry = shifted-out bit
13+
; - Sign = MSB of result
14+
; Cost: 10 bytes | 11F + 3R + 1
815
add hl, hl
916
ex de, hl
1017
adc hl, hl

src/crt/llshrs_1.src

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
.type __llshrs_1, @function
66

77
__llshrs_1:
8+
; Input:
9+
; - BC:UDE:UHL
10+
; Output:
11+
; - BC:UDE:UHL >>= 1 (signed)
12+
; - Carry = shifted-out bit
13+
; Cost: 28 bytes | 29F + 11R + 8W + 3
814
push hl
915
scf
1016
sbc hl, hl

src/crt/llshru_1.src

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
.type __llshru_1, @function
66

77
__llshru_1:
8+
; Input:
9+
; - BC:UDE:UHL
10+
; Output:
11+
; - BC:UDE:UHL >>= 1 (unsigned)
12+
; - Carry = shifted-out bit
13+
; Cost: 28 bytes | 29F + 11R + 8W + 3
814
push hl
915
scf
1016
sbc hl, hl

src/crt/lshrs_1.src

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
.type __lshrs_1, @function
66

77
__lshrs_1:
8+
; Input:
9+
; - E:UHL
10+
; Output:
11+
; - E:UHL >>= 1 (signed)
12+
; - Carry = shifted-out bit
13+
; Cost: 16 bytes | 17F + 7R + 4W + 2
814
push hl
915
ld hl, 2
1016
add hl, sp

src/crt/lshru_1.src

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
.type __lshru_1, @function
66

77
__lshru_1:
8+
; Input:
9+
; - E:UHL
10+
; Output:
11+
; - E:UHL >>= 1 (unsigned)
12+
; - Carry = shifted-out bit
13+
; Cost: 16 bytes | 17F + 7R + 4W + 2
814
push hl
915
ld hl, 2
1016
add hl, sp

0 commit comments

Comments
 (0)