; You should have received a copy of the GNU General Public License
; along with avrcpm. If not, see <http://www.gnu.org/licenses/>.
;
-; $Id$
+; $Id: Z80int-jmp.asm 93 2014-01-03 16:32:32Z rapid $
;
#if EM_Z80
do_store_pcrel: ;add displacement to PC
#if EM_Z80
- clr oph
- tst opl ;sign extend
- brpl stpcr1
- com oph
-stpcr1:
+ mov oph,opl ;sign extend
+ lsl oph
+ sbc oph,oph
add z_pcl,opl
adc z_pch,oph
ret
opprxcb_1:
mem_read_s z_pc ;get displacement
adiw z_pcl,1 ;++z_pc
- clr temp2 ;sign extend
- tst temp
- brpl PC+2
- com temp2
+ mov temp2,temp ;sign extend
+ lsl temp2
+ sbc temp2,temp2
add xl,temp ;add displacement
adc xh,temp2
mem_read_d opl
fetchmxx1:
mem_read_ds opl, z_pc ;get displacement
adiw z_pcl,1
- clr oph ;sign extend
- tst opl
- brpl fetchmxx2
- com oph
-fetchmxx2:
+ mov oph,opl ;sign extend
+ lsl oph
+ sbc oph,oph
add xl,opl ;add displacement
adc xh,oph
mem_read_d opl ;get operand
storemxx1:
mem_read_s z_pc ;get displacement
adiw z_pcl,1
- clr temp2 ;sign extend
- tst temp
- brpl storemxx2
- com temp2
-storemxx2:
+ mov temp2,temp ;sign extend
+ lsl temp2
+ sbc temp2,temp2
add xl,temp ;add displacement
adc xh,temp2
mem_write_s opl ;store operand
mem_read_s z_pc ;get displacement
adiw z_pcl,1
adiw z_pcl,1
- clr temp2 ;sign extend
- tst temp
- brpl storemxx22
- com temp2
-storemxx22:
+ mov temp2,temp ;sign extend
+ lsl temp2
+ sbc temp2,temp2
add xl,temp ;add displacement
adc xh,temp2
mem_write_s opl ;store operand