Jozef Prokopovic

S12ZVL assembler loading 32 bit value to D6,D7

Discussion created by Jozef Prokopovic on Aug 15, 2016
Latest reply on Aug 18, 2016 by Jozef Prokopovic

Hi,

 

I am writing loader in assembler for S12ZVL device. I am trying to load 32bit registers D6 and D7 with address stored in RAM but without succes. Could you please help me?

 

definition of the comm. port:

ComPort   equ PTT

 

Here is how my variables are defined:

 

; variable/data section

MY_EXTENDED_RAM: SECTION

; Insert here your data definition.

StartAddr        ds.l 1

EndAddr          ds.l 1

ActualPageAddr   ds.b 1

WhichArea        ds.b 1

 

the variables are filled wit this procedure: hdsk is step, where the data are set to port T from the master.

 

  BSR hdsk

  MOV.B ComPort,StartAddr+1

  BSR hdsk

  MOV.B ComPort,StartAddr+2

  BSR hdsk

  MOV.B ComPort,StartAddr+3

  BSR hdsk

  MOV.B ComPort,EndAddr+1

  BSR hdsk

  MOV.B ComPort,EndAddr+2

  BSR hdsk

  MOV.B ComPort,EndAddr+3

 

and the next step I would like to do is to load 32 bit value StartAddr to D7 register.

I try:

LD D7,StartAddr

 

but when I do it this way, only one byte is loaded to D7... bits 0-7 of the D7 with value on StartAddr.

 

How to load whole 32 bit value stored in StarAddr variable?

Outcomes