Title | Hw6ECE - Lecture notes 6 |
---|---|
Course | Microprocessor Systems and Interfacing |
Institution | Indiana University - Purdue University Indianapolis |
Pages | 4 |
File Size | 47.3 KB |
File Type | |
Total Downloads | 91 |
Total Views | 212 |
18/19...
HW 6 ECE 362
Problem 6.1 Entry:
read:
equal: unequal:
Section cmpb beq ldaa cmpa bne ldab rts ldab rts
#0 equal 1,x+ 1,y+ unequal #$22 #$33
Problem 6.2 Entry: loop:
unequal:
Section ldd cmpd bne cmpd bne ldab rts ldab rts
1,x+ 1,y+ unequal #0 loop #$44 #$55
Problem 6.3 Variables: name1: name2:
Section dc.b dc.b
Entry:
Section ldx ldy jsr end
“Lisa”,0 “Mark”,0
#name1 #name2 loop
Problem 6.4 Variables: portS: portSDDR: LED
Section equ equ dc.b
Entry: check:
Section pshd pshy ldd addd dey bne puly edivs tfr bitb bne bset bclr bra bset bclr bita beq bset bra bclr movb puld rts
inc:
even:
odd: skip: negative: positive: skipagain:
$248 $24A 0
#0 2,x+ inc
y,d #1 odd LED, #1 LED, #0 skip LED, #0 LED, #1 #$80 positive LED, #$80 skipagain LED, #$80 LED, portS
Problem 6.5 Variables: portS: portSDDR: number: array:
Section equ equ equ dc.b
Entry:
Section movb ldx ldy bsr end
$248 $24A 5 1,2,3,4,5
#$FF,portSDDR #array #number check
Problem 6.6 Variables: name1: name2:
Section dc.b dc.b
Entry: compare:
Section pshd pshx pshy leas ldx ldy ldaa cmpa bne cmpa bne ldab bra ldab stab leas puly pulx puld rts
loop:
unequal: quit:
“Lisa”,0 “Mark”,0
6,sp 2,sp 4,sp 1,x+ 1,y+ unequal #0 loop #$66 quit #$77 -1,sp -6,sp
Problem 6.7 Variables: name1: name2:
Section dc.b dc.b
Entry:
Section ldx pshx ldx pshx bsr leas end
“Lisa”,0 “Mark”,0
#name1 #name2 compare +4,sp
Problem 6.8 Entry: stackpractice:
Section pshd leas bset bclr ldaa anda staa leas puld rts
-1,sp 4,sp,#%00100100 3,sp,#%01001000 4,sp 3,sp 0,sp +1,sp
Problem 6.9 Variables: number1: number2:
Section equ equ
Entry:
Section ldaa psha ldaa psha bsr ldaa leas
$43 $5A
number1 number2 stackpractice -3,sp +2,sp...