hw7final - psha pulx bra cmp210 b done stx str s ldy #stl l...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
org $0000 locx rmb 2 r str rmb 2 stl fcc "you have entered :$" fcb 0 f Coins fcc "QQQQQQQQQQNDNDDDNNPPN" fcb 0 f org $c000 o start clra clrb std locx ldx #Coins count tst 0,x beq jump b ldab #'P cmpb 0,x beq addP b ldab #'N cmpb 0,x beq addN b ldab #'D cmpb 0,x beq addD b ldab #'Q cmpb 0,x beq addQ b addP ldd locx addd #1 std locx inx jsr count j addN ldd locx addd #5 std locx inx jsr count j addD ldd locx addd #10 std locx inx jsr count j addQ ldd locx addd #25 std locx
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
inx jsr count j jump jmp convert convert ldx locx ldy locx lt pshy pula pulb cpd #100 blo cmp210 subd #100 pshb psha puly p pshx pula pulb addd #156 pshb psha pulx bra lt b cmp210 pshy pula pulb cpd #10 blo done subd #10 pshb psha puly p pshx pula pulb addd #6 pshb
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: psha pulx bra cmp210 b done stx str s ldy #stl l jsr prtr %COMMENT: this subroutine passes the value of Y to prtr and rts returns to the next address r ldx #str prntnum pshx pula lsra lsra lsra lsra adda #$30 staa $1040 s pshx pula anda #$0F adda #$30 staa $1040 s ldaa #$2E l staa $1040 s pshx pula pulb lsrb lsrb lsrb lsrb addb #$30 stab $1040 s pshx pula pulb andb #$0F addb #$30 stab $1040 s lloop bra lloop b prtr ldaa #0 staa $1040 s loop tst 0,y beq prntnum ldaa 0,y staa $1040 iny bra loop rts r org $fffe fdb start...
View Full Document

Page1 / 3

hw7final - psha pulx bra cmp210 b done stx str s ldy #stl l...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online