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

Back to Subject List

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


 
#152819 - Same value - different address
Responding to: ???'s previous message
I wondered this too...

Look at the instruction mnemonics for example SETB and MOV.
(http://en.wikipedia.org/wiki/Mnem...mnemonics)

SETB it bit orientated... and MOV is byte orientated

Example assembler code

mov a,#90h      ; Load immediate value of 90hex into a regsiter
mov a,90h       ; load memory contents of 90hex in to a register
setb 90h        ; set bit P1.0
setb p1.0       ; Set bit P1.0
end


Here's a summary from the LST file created from the assembled code

Line I Addr Code Source

1: 0000 74 90 mov a,#90h
2: 0002 E5 90 mov a,90h
3: 0004 D2 90 setb 90h ; set bit P1.0
4: 0006 D2 90 setb p1.0 ; Set bit P1.0
5: end

L I S T O F S Y M B O L S
=============================
SYMBOL TYPE VALUE LINE
------------------------------------------------------------
P0 DATA 80
P1 DATA 90
P2 DATA A0
P3 DATA B0


When the 80c51 sees

74 90, it knows to "load immediate 90h value in to A register"

E5 90, it knows to "load contents of memory address 90h in to A"

D2 90, it know to "set bit port 1.0"


IE the Opcode 74, E5 and D2 tell the 80c51 what to do..
(http://en.wikipedia.org/wiki/Opcode)

Regards
Joe



List of 6 messages in thread
TopicAuthorDate
SFR question            01/01/70 00:00      
   Address Spaces            01/01/70 00:00      
   SFR as a byte or bit address            01/01/70 00:00      
      what exception            01/01/70 00:00      
         Same value - different address            01/01/70 00:00      
            SFR's and bit Addressable SFR's            01/01/70 00:00      

Back to Subject List