Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/06/08 04:01
Read: times


 
#154460 - I found the solution, Andy , Neil please comment
Responding to: ???'s previous message
I found few answers for my question while i tried these concept in programming. Please see and comment

So many ways to print the size of the processor.

Logic 1:
======
1. Remember the stack point address.
2. Push accumulator content in to stack. (In Assemble PUSH A will do this)
3. Get the new stack pointer location. Check how many bytes stack pointer has moved because of this push inst. That is the processor size.

Logic 2:
======

1. Store 1 in Acc.
2. Keep shift left the ACC content till CARRY flag is set. For every shift, get it counted.
3. Once carry flag is set, get the counter value. That is processor size.

Logic 3:
======

Minimum size of the processor would be 8 bit. Right.

1. Move FF into Accumulator.
2. Add 1. If carry flag is not set, then the processor is not 8 bit. If it is set, processor is of 8 bit.
3. Else Move FFFF and repeat the steps from 2.


List of 22 messages in thread
TopicAuthorDate
find the size of processor            01/01/70 00:00      
   C is not that portable!            01/01/70 00:00      
      thanks but could u clarify            01/01/70 00:00      
         I think you missed the point            01/01/70 00:00      
      Various compilers different results            01/01/70 00:00      
         Word size - not code size?            01/01/70 00:00      
            u r correct            01/01/70 00:00      
   Determining object sizes - at run time            01/01/70 00:00      
      Not quite            01/01/70 00:00      
         Correct !            01/01/70 00:00      
         not sure what you would do with the information            01/01/70 00:00      
            This was an interview question            01/01/70 00:00      
               More trick interview questions            01/01/70 00:00      
   I found the solution, Andy , Neil please comment            01/01/70 00:00      
      Great! Now do it in C            01/01/70 00:00      
         Same logic for C and asm            01/01/70 00:00      
            No, it isn't.            01/01/70 00:00      
      What would be the point?            01/01/70 00:00      
         It is worse than that            01/01/70 00:00      
   the whole question is silly            01/01/70 00:00      
      It can even get this silly...            01/01/70 00:00      
      It is an interview question            01/01/70 00:00      

Back to Subject List