Forum Index | FAQ | New User | Login | Search

Make a New PostPrevious ThreadView All ThreadsNext Thread*Show in Threaded Mode


SubjectAnother 68k question new Reply to this message
Posted byerikduijs
Posted on08/14/04 09:59 AM



Maybe this is a really dumb question so please bear with me :-)
With the "MOVE EA,EA" opcode, the documentation says the N and Z flags are affected by the result.
So what is the result here? The destination?
And if the size is byte or word, are the flags then affected by the sign extended result?




SubjectRe: Another 68k question new Reply to this message
Posted byRiff
Posted on08/14/04 01:55 PM



> Maybe this is a really dumb question so please bear with me :-)
> With the "MOVE EA,EA" opcode, the documentation says the N and Z flags are
> affected by the result.
> So what is the result here? The destination?
> And if the size is byte or word, are the flags then affected by the sign
> extended result?

Unless specified otherwise, flags are based on the value that gets written back to the destination. In this case, the value written back is the unmodified memory contents. This rule of thumb also applies to the size of the result as well. If you add to an 8-bit sub-register, the result is 8-bit and the carry and overflow flags are set according to the 8-bit intermediate results.

On the Nuon, bytes and words can be loaded, but not stored. A byte or word load will place the contents into the upper bits of a 32-bit register and zero out the lower bits. Addition is always 32 bit. It wouldn't surprise me if the 68K and other architectures use a similar internal shift mechanism allow all operations to be done using a single ALU using maximum operand bit length.



SubjectRe: Another 68k question Reply to this message
Posted byerikduijs
Posted on08/14/04 06:49 PM



Thanks! :-)





SubjectRe: Another 68k question new Reply to this message
Posted byJan_Klaassen
Posted on08/15/04 07:29 PM



> Maybe this is a really dumb question so please bear with me :-)
> With the "MOVE EA,EA" opcode, the documentation says the N and Z flags are
> affected by the result.
> So what is the result here? The destination?
> And if the size is byte or word, are the flags then affected by the sign
> extended result?

The flags are always set according to the result of the operation. That also means no sign extension unless it's explicitly part of the executed instruction. In the case of a move instruction, the result is the value fetched from the source location.





Subjectyay, my 68k is coming to life! :-D new Reply to this message
Posted byerikduijs
Posted on09/03/04 12:30 PM



I started with food fighter as suggested, and I have it now booting until the attract mode :-D
Now I have to implement some more instructions and add interrupt handling (have yet to figure out how it works).
Thanks for the help so far!




Previous ThreadView All ThreadsNext Thread*Show in Threaded Mode