Strange assembly program behaviour on HP-9817

François Lanciault

Hi group,

I am seeing a very strange behaviour in one of my assembly program on the 9817. I am using the writeio basic 5.1 command to call the program that is loaded in a integer number array.

WRITEIO 9827, array_addr ; d0 start value

The programs ends like this:

(There is some value in d0)

LEA somelocation,a0
move.l d0,(a0)
moveq #0,d0
rts    <---- this is the final 'rts' of the program.

The problem is that a value of 0 is always written at the location "somelocation" whatever is in d0 to star with.

However, if I replace the 'moveq #0,d0' by a 'nop'

LEA somelocation,a0
move.l d0,(a0)

then the correct value ends up written at 'somelocation'

I don't understand. It looks like the code is executed out of order (which, to my knowledge, the 68010 cannot do). The only other explanation is that the system writes to (a0) when doing the post processing of the writeio command...

What am I doing wrong ??


Join to automatically receive all group messages.