Baixe o app para aproveitar ainda mais
Prévia do material em texto
Name: Pedro Otavio de Oliveira PreLab 08: Indexed Addressing and Control Flow in Assembly TASK 1 rawdata: ds.b $98,$54,$89,$73,$ A2,$20,$D7, $6F setA: ds.b 8 setB: ds.b 8 i: ds.b 1 TASK 2 ldy #0 sty i top: ldy i cmpy #8 bhs end ldd #0 std D,setA iny sty i bra top end: 1. Why did you choose the location that you did for your index variable? I used the registrer Y, because of the command of increment and to be able to use the array at D register. 2. Why did you choose the addressing mode that you did for accessing the array elements? 3. What value will your index variable have after exiting this loop? i = 8 TASK 3 j: ds.b 1 lds #0 sts j ldy #0 sty i top: ldy i cmpy #8 bge end ldaa Y,rawdata ldab #0 cab bge done ldx Y,rawdata stx SP,setA ins done: bra top bra top end: TASK 4 sty t3 ldx #0 stx i lds #0 sts j top: ldx i cmpx #8 bge end ldaa D,setA ldab #$01 stab t3 ANDA t3 cmpy 1 beq true true: ldd D,setA std SP,setB ins inx top: inx top: TASK 5 ldd #0 std i top: ldx D,setA stY setB cmpd #8 ind blt top TASK 6 ldd #0 sdd i ldx setA ldd 2,setA std i
Compartilhar