Page 1 of 1
a really newbie question...
Posted: Tue Mar 16, 2010 5:19 pm
by ehguacho
just to be sure: in the instruction ASL A (ASL accumulator) the operation is:
1) A = ASL accumulator
...or just
2) ASL accumulator
...???
the result of the ASL operation is stored into the accumulator? or the ASL instruction is just used to set/reset flags?
Posted: Tue Mar 16, 2010 5:26 pm
by BigEd
Result is stored in the Accumulator. Some assemblers allow 'ASL' as a legal opcode, some 'ASL A'
Cheers
Ed
Posted: Tue Mar 16, 2010 5:40 pm
by ehguacho
Result is stored in the Accumulator. Some assemblers allow 'ASL' as a legal opcode, some 'ASL A'
Cheers
Ed
thanks Ed! i suppose it is also valid for "ASL Zero Page" and all the others ASL's... i mean that the result of any kind of ASL is always stored into the accumulator. is that right?
Posted: Tue Mar 16, 2010 5:54 pm
by leeeeee
The result of an ASL always overwrites the original data.
Lee.
Posted: Tue Mar 16, 2010 6:19 pm
by ehguacho
The result of an ASL always overwrites the original data.
Lee.
that means that it may ovewrite memory address... thanks Lee!
Posted: Tue Mar 16, 2010 6:41 pm
by GARTHWILSON
Only
ASL A leaves the result in the accumulator. ASL done to a memory address does not affect the accumulator. If you don't want it to affect the memory address, then first do LDA then ASL A.
There's a ton of great information in the WDC programming manual downloadable at their website at
http://www.westerndesigncenter.com/wdc/ ... manual.pdf .
Posted: Tue Mar 16, 2010 7:40 pm
by ehguacho
Only ASL A leaves the result in the accumulator. ASL done to a memory address does not affect the accumulator.
but it affects the value in the memory address. isn't it? i.e.:
assume $FE is #AA (170 in decimal)
ASL $FE
...after that $FE is #54 (84 in decimal)
Posted: Tue Mar 16, 2010 7:45 pm
by GARTHWILSON
Yes, and also affects the N, Z, and C flags the same as ASL A.
Posted: Tue Mar 16, 2010 9:44 pm
by ehguacho
ok thanks!
