Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
Name:
Anonymous2008-04-25 23:27
whoops
FIZBUZ LDA #0
STA DIV3
STA DIV5
STA FLAG
TAX
NEXT LDA #13
JSR CHROUT
INX
CMP #101
BEQ DONE
INC DIV3
LDA DIV3
CMP #2
BNE SKPFIZ
JSR FIZZ
SKPFIZ INC DIV5
CMP #4
JSR SKPBUZ
JSR BUZZ
SKPBUZ LDA FLAG
BEQ NEXT
TXA
JSR NUMOUT
LDA #0
STA FLAG
JMP NEXT
DONE RTS
FIZZ LDA >FIZTXT
STA >STRPTR
LDA <FIZTXT
STA <STRPTR
MERGE JSR STROUT
SETFLG LDA #$FF
STA FLAG
RTS
BUZZ LDA >BUZTXT
STA >STRPTR
LDA <BUZTXT
STA <STRPTR
JMP MERGE