Programming Examples
1. Binary Search for Highest Bit Position
;
;if extracted bit is zero, fall thru and keep assumption
;else make conclusion
; |
|
|
EXTRU,= | %arg0,0,1,%r0 | ; check next bit |
ADDI | ; next higher power of 2 | |
B,N | tally |
|
all_zeros |
|
|
LDI |
| |
tally |
|
|
.LEAVE |
|
|
.PROCEND |
|
|
Chapter 7 | 131 |