Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- eight_digits: mov #digit0,digit_pointer ;Start digit_pointer at digit0
- eight_loop: lda display_pointer ;Load LSD
- sec
- rora ;Convert to actual mem address
- tax ;and load into h:x register
- clrh
- lda ,x ;to get data at display_pointer
- bcc isolate_nibble ;If accessing lower nibble don't nsa
- nsa
- isolate_nibble: and #$0F
- jsr ascii_7seg ;Convert to ASCII
- ldx digit_pointer ;Load the digit pointer
- sta ,x ;and store ASCII value
- ;at where x points to
- inc display_pointer
- inc digit_pointer
- lda digit_pointer
- cmp #{digit7 + 1} ;Check to see if all eight
- bne eight_loop ;digits have been filled
- rts
- addition: mov #sum,display_pointer ;After the operation is applied
- lsl display_pointer ;display_pointer will have to
- bclr 0,display_pointer ;point to sum -- display_pointer
- ;is not needed for the rest
- ;of operation
- clc ;Clear carry for first digit
- ldx #in_1
- add_loop: lda ,x
- adc max_digits,x ;Add the first 2 numbers together
- ;which are spaced apart by max_digits
- daa
- sta {max_digits + max_digits},x ;Sum is spaced 2*max_digits
- ;away from in_1
- incx
- cbeqx #{in_1 + max_digits},display
- bra add_loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement