Microprocessor

Status
Not open for further replies.
Register A of a hypothetical CPU contains a binary value 10011001. A programmer needs to make all the bits zero. Is it possible to achieve this without using MOVE or SUBTRACT instructions? If yes , how?
 
Register A of a hypothetical CPU contains a binary value 10011001. A programmer needs to make all the bits zero. Is it possible to achieve this without using MOVE or SUBTRACT instructions? If yes, how?
 
horsley, do not forget it is a hypothetical CPU. He will need to use hypothetical instructions.
 
Register A of a hypothetical CPU contains a binary value 10011001. A programmer needs to make all the bits zero. Is it possible to achieve this without using MOVE or SUBTRACT instructions? If yes, how?
You could AND the register with a 0b00000000 mask. Since the mask is all zeroes the register would be zeroed as well.
 
I would call my hypothetical instruction
CLR
Since he doesn't say it has to be done in a single instuction I'll call my hypothetical instruction LSR - logical shift right

LSR A
LSR A
LSR A
LSR A
LSR A
LSR A
LSR A
LSR A


but if program memory is tight, go for

ADD b'01100111'

 
Last edited:
Are you sure, it looks suspiciously like 6502 (unless motorola made the 6502).

Mark

Honestly that was plucked from a brain memory cell thats not been accessed in quite a few years so it's prone to some level of corruption. I'd have to consult the little grey book of 6809 instructions to be sure. And it wasn't just and 09 either. We used the 09"E" version. Lots of good projects- back in the day.

Is it a bad sign that I still actually have the grey book of instructions in the top shelf of my bedroom closet, tucked away like an old Playboy??
 
And yes, Motorola made the 6502 originally. They used to be great chip makers, now they're a just crappy mass consumer electronics maker.

I'm wrong. Originally by MOS technology, which was the team that designed the 6800 series at motorola. Got fed up and left en-masse.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…