Jameco-electronics Rabbit 3000 Instrukcja Użytkownika Strona 47

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 349
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 46
38 Rabbit 3000 Microprocessor
The SBC instruction can also be used to perform a sign extension.
; extend sign of l to HL
LD A,l
rla ; sign to carry
SBC A,a ; a is all 1’s if sign negative
LD h,a ; sign extended
The multiply instruction performs a signed multiply that generates a 32-bit signed result.
MUL ; signed multiply of BC and DE,
; result in HL:BC - 1 byte, 12 clocks
If a 16-bit by 16-bit multiply with a 16-bit result is performed, then only the low part of
the 32-bit result (BC) is used. This (counter intuitively) is the correct answer whether the
terms are signed or unsigned integers. The following method can be used to perform a 16
x 16 bit multiply of two unsigned integers and get an unsigned 32-bit result. This uses the
fact that if a negative number is multiplied the sign causes the other multiplier to be sub-
tracted from the product. The method shown below adds double the number subtracted so
that the effect is reversed and the sign bit is treated as a positive bit that causes an addition.
LD BC,n1
LD HL’,BC ; save BC in HL’
LD DE,n2
LD A,b ; save sign of BC
MUL ; form product in HL:BC
OR a ; test sign of BC multiplier
JR p,x1 ; if plus continue
ADD HL,DE ; adjust for negative sign in BC
x1:
RL DE ; test sign of DE
JR nc,x2 ; if not negative
; subtract other multiplier from HL
EX DE,HL’
ADD HL,DE
x2:
; final unsigned 32 bit result in HL:BC
This method can be modified to multiply a signed number by an unsigned number. In that
case only the unsigned number has to be tested to see if the sign is on, and in that case the
signed number is added to the upper part of the product.
The multiply instruction can also be used to perform left or right shifts. A left shift of n
positions can be accomplished by multiplying by the unsigned number 2^^n. This works
for n # 15, and it doesn’t matter if the numbers are signed or unsigned. In order to do a
right shift by n (0 < n < 16), the number should be multiplied by the unsigned number
2^^(16 – n), and the upper part of the product taken. If the number is signed, then a signed
by unsigned multiply must be performed. If the number is unsigned or is to be treated as
unsigned for a logical right shift, then an unsigned by unsigned multiply must be per-
formed. The problem can be simplified by excluding the case where the multiplier is
2^^15.
Przeglądanie stron 46
1 2 ... 42 43 44 45 46 47 48 49 50 51 52 ... 348 349

Komentarze do niniejszej Instrukcji

Brak uwag

Sony MDR-NC100D podręczniki

Instrukcje obsługi i podręczniki użytkownika dla Nie Sony MDR-NC100D.
Dostarczamy 3 pdf podręczników Sony MDR-NC100D do pobrania za darmo według typów dokumentów: Instrukcja Użytkownika






Więcej produktów i instrukcji dla Nie Sony

Modele Rodzaj dokumentu
VPCF21Z1E Instrukcja Użytkownika   Sony VPCF21Z1E Kullanım Talimatları, 171 strony
PHA-2A Instrukcja Użytkownika   Sony PHA-2A ЦАП-усилитель USB для наушников Справочник, 2 strony
VGC-LN1M Instrukcja Użytkownika Sony VGC-LN1M Οδηγίες αντιμετώπισης προβλημάτων, 52 strony
CDX-GT240 Instrukcja Użytkownika      Sony CDX-GT240 Installation Guide [fr] [it] [pt] , 2 strony
KDL-22BX200 Instrukcja Użytkownika   Sony KDL-22BX200 Kullanım Talimatları, 36 strony
DSC-HX5V Instrukcja Użytkownika   Sony DSC-HX5V HX5 Kompakti digikamera Käyttöohjeet, 160 strony
RHT-G1550 Instrukcja Użytkownika     Sony RHT-G1550 Mode d’emploi, 148 strony
HT-FS1 Instrukcja Użytkownika   Sony HT-FS1 Käyttöohjeet [de] [it] [pt] [sv] , 92 strony
XNV-L66BT Instrukcja Użytkownika    Sony XNV-L77BT XNV-L77BT 7” / 17,78cm touchscreen LIVE AV Navigation Installation Guide [sv] , 2 strony
ICF-P26 Instrukcja Użytkownika      Sony ICF-P26 Portable Radio with Speaker Flyer/Addendum, 2 strony
DSLR-A390 Instrukcja Użytkownika   Sony DSLR-A390 Руководство по быстрой настройке и краткое руководство пользователя, 1 strony
SEL85F14GM Instrukcja Użytkownika   Sony SEL85F14GM FE 85 mm F1,4 GM Käyttöohjeet, 2 strony
VGN-TZ32VN Instrukcja Użytkownika   Sony VGN-TZ32VN Інструкції з експлуатації, 218 strony
SPK-CXB Instrukcja Użytkownika     Sony SPK-CXB CXB Спортивный чехол для Handycam® для подводной съемки Инструкция по эксплуатации, 2 strony
DCR-IP1E Instrukcja Użytkownika   Sony DCR-IP1E Инструкция по эксплуатации, 128 strony
RHT-G800 Instrukcja Użytkownika   Sony RHT-G800 Návod k obsluze, 60 strony
BC-VC10 Instrukcja Użytkownika   Sony BC-VC10 Bruksanvisning, 2 strony
KDL-48W705C Instrukcja Użytkownika   Sony KDL-48W705C i-Manual, 168 strony
VPCCW1Z4E Instrukcja Użytkownika   Sony VPCCW1S1E Käyttöohjeet, 170 strony
PCM-M10 Instrukcja Użytkownika Sony PCM-M10 Οδηγίες χρήσης, 145 strony