microcontoller ? made easy

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Post Reply
mikeb
Posts: 85
Joined: Fri Jul 12, 2002 1:01 am
Location: calif.
Contact:

microcontoller ? made easy

Post by mikeb » Fri Feb 21, 2003 10:54 pm

can anyone tell me what does this snipet of code means it came from a motorola source program file for verifying and reprogramming the configuration register of a hc11. this is only a partial listing.<p>this part i understand:<p>eelat equ $02
eepgm equ $01
byte equ $10
erase equ $04<p>this part of the code i dont understand its from 3 different lines in the code:<p>line 1: ldaa #(byte + erase +eelat
line 2: ldaa #(byte + erase +eelat +eepgm)
line 3: ldaa #(eelat + eepgm)

bodgy
Posts: 1044
Joined: Tue Dec 04, 2001 1:01 am
Location: Australia
Contact:

Re: microcontoller ? made easy

Post by bodgy » Fri Feb 21, 2003 11:42 pm

The + symbol is another way of binary or'ing.<p>In other words consider you have a binary byte such as 10100001, you then + 100 the byte will then equal 10100101.<p>Take the original byte of 10100001 and | 00000100 to it and you will have the same result.<p>So what your code is saying is Idaa= the value of byte Or'd with the value of Erase and Or'd with the value of Eelat.<p>After you have +/ or'd all those values Idaa line 1 will look like - 0x16 = 00010110 <p>Try it with the Windows calculator in scientific mode and you will see how plussing and Or'ing works.<p>Colin<p>[ February 22, 2003: Message edited by: bodgy ]</p>
On a clear disk you can seek forever.

josmith
Posts: 340
Joined: Tue Dec 04, 2001 1:01 am
Contact:

Re: microcontoller ? made easy

Post by josmith » Sun Feb 23, 2003 2:35 am

eelat equ $02
eepgm equ $01
byte equ $10
erase equ $04<p>These lines are setting constants. The assembeler sees eelat as $02. the $ tells what kind of number it is, hex dec and so forth but i don't know what the symbols are or if they are standardized in different assembelers.

Jus
Posts: 5
Joined: Sat Jan 25, 2003 1:01 am
Location: MI, USA
Contact:

Re: microcontoller ? made easy

Post by Jus » Mon Feb 24, 2003 4:17 am

The $ sign preceding the number indicates that the number is to be interpreted as hex.
-Jus
2+2=5 for extremely large values of 2

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 46 guests