Declarations ​
function SAR_3(Value: Integer): Integer;
function SAR_4(Value: Integer): Integer;
function SAR_6(Value: Integer): Integer;
function SAR_8(Value: Integer): Integer;
function SAR_9(Value: Integer): Integer;
function SAR_11(Value: Integer): Integer;
function SAR_12(Value: Integer): Integer;
function SAR_13(Value: Integer): Integer;
function SAR_14(Value: Integer): Integer;
function SAR_15(Value: Integer): Integer;
function SAR_16(Value: Integer): Integer;Overload Details
Overload 1 ​
function SAR_3(Value: Integer): Integer;Arithmetically shifts Value right by 3 bits (Value div 8 with negative sign conservation).
| Parameter | Type | Description |
|---|---|---|
Value | Integer | Integer value to shift. |
| Type | Description |
|---|---|
Integer | Value shifted right by 3 bits. |
Overload 2 ​
function SAR_4(Value: Integer): Integer;Arithmetically shifts Value right by 4 bits.
| Parameter | Type | Description |
|---|---|---|
Value | Integer | Integer value to shift. |
| Type | Description |
|---|---|
Integer | Value shifted right by 4 bits. |
Overload 3 ​
function SAR_6(Value: Integer): Integer;Arithmetically shifts Value right by 6 bits.
| Parameter | Type | Description |
|---|---|---|
Value | Integer | Integer value to shift. |
| Type | Description |
|---|---|
Integer | Value shifted right by 6 bits. |
Overload 4 ​
function SAR_8(Value: Integer): Integer;Arithmetically shifts Value right by 8 bits.
| Parameter | Type | Description |
|---|---|---|
Value | Integer | Integer value to shift. |
| Type | Description |
|---|---|
Integer | Value shifted right by 8 bits. |
Overload 5 ​
function SAR_9(Value: Integer): Integer;Arithmetically shifts Value right by 9 bits.
| Parameter | Type | Description |
|---|---|---|
Value | Integer | Integer value to shift. |
| Type | Description |
|---|---|
Integer | Value shifted right by 9 bits. |
Overload 6 ​
function SAR_11(Value: Integer): Integer;Arithmetically shifts Value right by 11 bits.
| Parameter | Type | Description |
|---|---|---|
Value | Integer | Integer value to shift. |
| Type | Description |
|---|---|
Integer | Value shifted right by 11 bits. |
Overload 7 ​
function SAR_12(Value: Integer): Integer;Arithmetically shifts Value right by 12 bits.
| Parameter | Type | Description |
|---|---|---|
Value | Integer | Integer value to shift. |
| Type | Description |
|---|---|
Integer | Value shifted right by 12 bits. |
Overload 8 ​
function SAR_13(Value: Integer): Integer;Arithmetically shifts Value right by 13 bits.
| Parameter | Type | Description |
|---|---|---|
Value | Integer | Integer value to shift. |
| Type | Description |
|---|---|
Integer | Value shifted right by 13 bits. |
Overload 9 ​
function SAR_14(Value: Integer): Integer;Arithmetically shifts Value right by 14 bits.
| Parameter | Type | Description |
|---|---|---|
Value | Integer | Integer value to shift. |
| Type | Description |
|---|---|
Integer | Value shifted right by 14 bits. |
Overload 10 ​
function SAR_15(Value: Integer): Integer;Arithmetically shifts Value right by 15 bits.
| Parameter | Type | Description |
|---|---|---|
Value | Integer | Integer value to shift. |
| Type | Description |
|---|---|
Integer | Value shifted right by 15 bits. |
Overload 11 ​
function SAR_16(Value: Integer): Integer;Arithmetically shifts Value right by 16 bits.
| Parameter | Type | Description |
|---|---|---|
Value | Integer | Integer value to shift. |
| Type | Description |
|---|---|
Integer | Value shifted right by 16 bits. |
Description ​
The SAR_n functions perform an arithmetic shift right by SAR_3 through SAR_16).
Unlike standard integer division (x div 2^n), which truncates towards zero and introduces asymmetry for negative numbers, SAR_n preserves two's-complement sign extension consistent with CPU SAR assembly instructions across positive and negative values.