Fizz Buzz in Asm
Our colleague Ashish Padalkar suggested that we should have famous Fizz-Buzz in some form - so here it comes!
This exercise on Intel 4004 Assembly language could be solved with the knowledge you already have, but probably information about few Special Instructions could help to reduce the efforts and code size (so it would be wise to read this article).
FizzBuzz program probably came to fame after an article Why can't programmers program which stated that of many applicants at programming job interviews only few can code this simple task:
You are to print numbers from
N, but instead of numbers which are multiples of
3 the word
Fizz should be printed - and instead of multiples of
5 - the word
Buzz. If value is the multiple
of both - print
So your goal is to write this in Intel 4004 Assembly language.
Input data consist of a single two-digit decimal
N in range from
Answer should give the sequence as described. All integers should be two-digit decimals also and every element should be followed by single space (the last leading space is allowed).
input data: 02 answer: 01 02 input data: 16 answer: 01 02 Fizz 04 Buzz Fizz 07 08 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16