amit.kumar wrote:but still I am searching for IF else loop because somewher i found that.MODE : equ 0IFNE MODE---do somethingELSEdo something
lda PORT ; Read current input port status and #%00000011 ; Mask bits to be tested cbeqa #%00000011,lab1 ; Branch if first value cbeqa #%00000001,lab2 ; Branch if second value
; Default case: ... bra continue
lab1: ; First value code: ... bra continue
lab2: ; Second value code: ... continue: ; Further code here
Regards, Mac
lda PORT ;get current input port status and #%00000011 ;mask out irrelevant bits bne lab1 ;branch if other than 00 do something when 00 bra lab3 lab1 cmp #%00000001 ;test for bit 0 only on bne lab2 ;branch if not so do something when 01 bra lab3 lab2 cmp #%00000010 ;test for bit 1 only on bne lab3 ;branch if not so do something when 10lab3 .....