Re: [Ql-Users] Debugging nightmare

2012-05-26 Thread Ian Pine

 - Original Message - 
 From: John Alexander acontractor...@yahoo.co.uk
 To: ql-us...@q-v-d.com
 Sent: Wednesday, May 23, 2012 7:07 PM
 Subject: Re: [Ql-Users] Debugging nightmare


 Ian, I'm sure it's been doing this for the last 34 years or so ;)

 Encouraged me to rough up a 68K controller for old school kicks though 
 ..Cheers


 John A

I'm sure it has too, it would be most annoying if it just decided to 
spontaneously change ... ;o)
Trouble is I'd written the program on i386 then converted it to 68k; plus, it 
had been working for a while, then I broke it, but I'd convinced myself I 
hadn't made any changes to that bit of code. I must've changed it, then changed 
it back, and in the process switched the two instructions. Anyway, the good 
news is it's working now (on both CPUs).

cheers,
Ian.



___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


[Ql-Users] Debugging nightmare

2012-05-23 Thread Ian Pine
Damn damn damn ...

I've just spent nearly a day and a half trying to debug a simple bit of 
assembler code because I forgot that on m68k CPUs the MOVE instructions alter 
the flags and I was convinced all sorts of other problems might've been the 
cause, but in the end all I had to do was swap two instructions:

 move.l  d5,d0
 and.l   d6,d0-
 moveq   #'0',d1  -
 beq.s   sk1
 moveq   #'1',d1
sk1  ...

should've been:

 move.l  d5,d0
 moveq   #'0',d1  -
 and.l   d6,d0-
 beq.s   sk1
 moveq   #'1',d1
sk1  ...

That'll teach me not to try to develop the same program on two different 
platforms at the same time!

Damn damn fume blast ...

Never mind though, might be a little something for QL Today when I've tidied it 
all up.

Ian.
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] Debugging nightmare

2012-05-23 Thread Norman Dunbar

Hi Ian,

On 23/05/12 12:52, Ian Pine wrote:

Damn damn damn ...

... because I forgot that on m68k CPUs the MOVE instructions alter the flags ...


Well, it does alter the flags, unless:

* You specifically use the MOVEA instruction; or

* You specify MOVE with an address register as the destination AND your 
assembler quietly converts the MOVE to MOVEA.


Just to make things interesting.


Cheers,
Norm.

--
Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
Thorpe House
61 Richardshaw Lane
Pudsey
West Yorkshire
United Kingdom
LS28 7EL

Company Number: 05132767
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] Debugging nightmare

2012-05-23 Thread George Gwilt

On 23 May 2012, at 13:24, Norman Dunbar wrote:

 
 On 23/05/12 12:52, Ian Pine wrote:
 Damn damn damn ...
 
 ... because I forgot that on m68k CPUs the MOVE instructions alter the flags 
 ...
 
 Well, it does alter the flags, unless:
 
 * You specifically use the MOVEA instruction; or
 
 * You specify MOVE with an address register as the destination AND your 
 assembler quietly converts the MOVE to MOVEA.
 
 Just to make things interesting.
 

Just for fun. MOVE USP,An, MOVE An.USP MOVE SR,ea and MOVEC Rc,Rn also leave 
the condition codes alone.

George
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] Debugging nightmare

2012-05-23 Thread John Alexander
Ian, I'm sure it's been doing this for the last 34 years or so ;)

Encouraged me to rough up a 68K controller for old school kicks though ..Cheers


John A

--- On Wed, 23/5/12, Ian Pine ilp...@tesco.net wrote:

From: Ian Pine ilp...@tesco.net
Subject: [Ql-Users] Debugging nightmare
To: ql-us...@q-v-d.com ql-us...@q-v-d.com
Date: Wednesday, 23 May, 2012, 12:52

Damn damn damn ...

I've just spent nearly a day and a half trying to debug a simple bit of 
assembler code because I forgot that on m68k CPUs the MOVE instructions alter 
the flags and I was convinced all sorts of other problems might've been the 
cause, but in the end all I had to do was swap two instructions:

     move.l  d5,d0
     and.l   d6,d0    -
     moveq   #'0',d1  -
     beq.s   sk1
     moveq   #'1',d1
sk1  ...

should've been:

     move.l  d5,d0
     moveq   #'0',d1  -
     and.l   d6,d0    -
     beq.s   sk1
     moveq   #'1',d1
sk1  ...

That'll teach me not to try to develop the same program on two different 
platforms at the same time!

Damn damn fume blast ...

Never mind though, might be a little something for QL Today when I've tidied it 
all up.

Ian.
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm