Atari Logo
Atari Computer

Hauptseite -
Welches System? -
Hardware -
Software -
Emulatoren -
Internet
MausNet
Programmieren
Verweise
Über

Assembler

Previous Next TOC

NAME ASL, ASR -- Arithmetic shift left and arithmetic shift right
SYNOPSIS
ASdDx,Dy
ASd#<data>,Dy
ASd<ea>
where d is direction, L or R
Size = Byte, Word, Long
FUNCTION Performs an arithmetic shifting bit operation in the indicated direction, with an immediate data, or with a data register. If you shift address contents, you can only do ONE shift, and your operand is ONE word exclusively.
ASL:<--
 
C <------ OPERAND <--- 0
|
|
X <---'
ASR:-->
 
.---> OPERAND ------> C
|    T          |
|    |          |
`----'          `---> X
FORMAT In the case of the shifting of a register:
1514131211109876543210
1110NUMBER
REGISTER
drSIZEi/r00REGISTER
In the case of the shifting of a memory area:
1514131211109876543210
1110000dr11MODEREGISTER
 <ea>
NUMBER/REGISTER Specifies number of shifting or number of register which contents the number of shifting.
  • If i/r = 0, number of shifting is specified in the instruction as immediate data
  • If i/r = 1, it's specified in the data register.
  • If dr = 0, right shifting
  • If dr = 1, left shifting
SIZE
00->one Byte operation
01->one Word operation
10->one Long operation
REGISTER For a register shifting:
Indicates the number of data register on which shifting is applied.

For a memory shifting:
<ea> indicates operand which should be shifted.
Only addressing modes allowed are:
Addressing ModeModeRegister
Dn--
An--
(An)010No reg. An
(An)+011No reg. An
-(An)100No reg. An
(d16,An)101No reg. An
(d8,An,Xi)110No reg. An
(bd,An,Xi)110No reg. An
([bd,An,Xi]od)110No reg. An
([bd,An],Xi,od)110No reg. An
Addressing ModeModeRegister
Abs.W111000
Abs.L111001
(d16,PC)--
(d8,PC,Xi)--
(bd,PC,Xi)--
([bd,PC,Xi],od)--
([bd,PC],Xi,od)--
#data--

RESULT
X-Set according to the list bit shifted out of the operand.
Unaffected for a shift count of zero.
N-Set if the most-significant bit of the result is set.
Cleared otherwise.
Z-Set if the result is zero. Cleared otherwise.
V-Set if the most significant bit is changed at any time during the shift operation.
Cleared otherwise.
C-Set according to the list bit shifted out of the operand.
Cleared for a shift count of zero.


Best viewed with any browser English version not yet available.

Änderungen und Irrtümer vorbehalten. Letzte Änderung:
14 September 2001.
Home - Mail an den Webmaster - Impressum