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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/18/05 18:09
Read: times


 
#93580 - compare two bytes
Hi guys,

just writing a simple I2C programmer in asm for an 89C51, connected to a terminal.

I am trying to compare the dptr with a value from ram.

Basically I am trying to exit the program based on a variable in Ram, this being the size of the eeprom that is being programmed.

When the program starts, the user selects which device he would like to program. Then based on the users input, the eeprom size is loaded into ram(addr 4Eh, 4Fh)

for example the size for a 24c32 would be 10 00.
I am aware of the cjne instruction, however it must only use the acc.

the code goes like this:
sizeLow equ 04Eh (for 24C32 sizelow = 00)
sizeHigh equ 04Fh (for 24C32 sizehigh = 10)

mov a,dpl
cjne a,sizelow, continue
mov a,dph
cjne a,sizehigh, continue
sjmp stop_program

The above code does not work. I cannot free up the dptr.
Just wondering if there is an easier way to do this.

thanks for any help.

List of 9 messages in thread
TopicAuthorDate
compare two bytes            01/01/70 00:00      
   equ operator            01/01/70 00:00      
      re: equ operator            01/01/70 00:00      
         value v pointer            01/01/70 00:00      
   comparing two bytes            01/01/70 00:00      
      Is it like this?            01/01/70 00:00      
         bible time            01/01/70 00:00      
   A bit more            01/01/70 00:00      
      to Mehdi            01/01/70 00:00      

Back to Subject List