Přejít na obsah
ARCHIVEKArchiv e-mailových konferencí o 8bitových počítačích Archiv Pandory 1999 až 2013

Zpět na zprávu

Celé vlákno · 2 zprávy

Podivna instrukce

Jiri Biba SAPI-1

Ahoj!

Resim tu nejaky nasobeni a deleni na Z80. Nekde jsem vyhrabal algoritmy ale narazil jsem na zahadu. Pouzivaji nedokumentovany instrukce SLIA.

Some routines use "undocumented" instruction SLIA (Shift Left Inverted Arithmetic), sometimes also denoted as SLL (Shift Left Logical). SLIA shifts register left and sets the least significant bit to 1 (operation code is CBh 30h..37h). It is used in routines which subtract 16-bit divisor from the 16-bit remainder. As there is no simple way to test whether such subtraction will be successful without actually performing it, it's better to assume it will be successful (hence 1 in the LSB) and possibly make a correction to 0. Doing it the opposite way introduces the overhead of Carry complement (see bellow).

Netusite prosim nekdo, ktery procesory (vyrobci) tohle podporuji?

Diky

Jirka

Re: Podivna instrukce

Jardax SAPI-1

Ahoj Jirko,
pokud vim tak vsechny CPU tyhle instrukce podporuji.
Vychodonemecke a nektere ruske klony maji sice drobne odchylky ve funkci, ale to se tyka priznaku.
Opcody by mely behat uplne vsude.

Jarda

Dne 30.8.2012 6:12, Jiri Biba (sapipandora.cz) napsal(a):

Ahoj!

Resim tu nejaky nasobeni a deleni na Z80. Nekde jsem vyhrabal algoritmy ale narazil jsem na zahadu. Pouzivaji nedokumentovany instrukce SLIA.

Some routines use "undocumented" instruction SLIA (Shift Left Inverted Arithmetic), sometimes also denoted as SLL (Shift Left Logical). SLIA shifts register left and sets the least significant bit to 1 (operation code is CBh 30h..37h). It is used in routines which subtract 16-bit divisor from the 16-bit remainder. As there is no simple way to test whether such subtraction will be successful without actually performing it, it's better to assume it will be successful (hence 1 in the LSB) and possibly make a correction to 0. Doing it the opposite way introduces the overhead of Carry complement (see bellow).

Netusi! te prosim nekdo, ktery procesory (vyrobci) tohle podporuji?

Diky

Jirka

--------------------- sapipandora.cz Konference o SAPI-1


---