FIZZBUZZ
Re: FIZZBUZZ
Hi guys !
I take the comment of Rich and made the decision to fix my version in order to meets the rules, I think that the program is correct now but I a new problem arise. Now I can't find the secret image of the ULA can you see something ?
Gus
I take the comment of Rich and made the decision to fix my version in order to meets the rules, I think that the program is correct now but I a new problem arise. Now I can't find the secret image of the ULA can you see something ?
Gus
- Attachments
-
- fizzbuzz-4.rar
- FizzBuzz by Guzz, bugzz free version :)
- (326 Bytes) Downloaded 232 times
Re: FIZZBUZZ
No image of the ULA - but I see an army marching past the screen....
Rich Mellor
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module
Also Involved in:
Icephorm
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module
Also Involved in:
Icephorm
Re: FIZZBUZZ
The links to the PROGs are broken,
could anybody repost them here?
Thanks Paul
could anybody repost them here?
Thanks Paul
In theory, there is no difference between theory and practice. But, in practice, there is.
Re: FIZZBUZZ
Hi paul,
My version is attached.
Be well,
Gus
My version is attached.
Be well,
Gus
- Attachments
-
- fizzbuzz-4.rar
- FizzBuzz by Guzz, bugzz free version :)
- (326 Bytes) Downloaded 183 times
Last edited by gus on Tue Jun 21, 2011 3:16 pm, edited 1 time in total.
Re: FIZZBUZZ
Thanks GUS!
Any chance for the source?
Any chance for the source?
In theory, there is no difference between theory and practice. But, in practice, there is.
Re: FIZZBUZZ
Paul,
Here is the source code, maybe a dirty source, because I write it on a record time
I normally use PASMO for all my cross assembler works.
Gus
Here is the source code, maybe a dirty source, because I write it on a record time
I normally use PASMO for all my cross assembler works.
Gus
Code: Select all
;-------------------------------------------------
;
; FIZZBUZZ
;
; By Gus gdeldago@gmail.com
;
;-------------------------------------------------
FIZZBUZZ:
LD B, $64
LD A, 0
LD (FIZZ), A
LD (BUZZ), A
LOOP
INC A
PUSH AF
PUSH BC
CALL PRINT_A_DEC
LD A, 0
RST $10
LD A, (FIZZ)
INC A
LD (FIZZ), A
CP 3
JP NZ, NO_3
LD A, 0
LD (FIZZ), A
CALL PRINT_FIZZ
NO_3:
LD A, (BUZZ)
INC A
LD (BUZZ), A
CP 5
JP NZ, NO_5
LD A, 0
LD (BUZZ), A
CALL PRINT_BUZZ
NO_5:
LD A, (FIZZ)
CP 0
JP NZ, SIGUE
RST $10
SIGUE:
POP BC
POP AF
DJNZ LOOP
RET
PRINT_FIZZ:
LD A, _F
RST $10
LD A, _I
RST $10
LD A, _Z
RST $10
LD A, _Z
RST $10
RET
PRINT_BUZZ:
LD A, _B
RST $10
LD A, _U
RST $10
LD A, _Z
RST $10
LD A, _Z
RST $10
LD A, __
RST $10
RET
;-------------------------------------------------
;
; PRINT REGISTER A IN DECIMAL
;
; Si quiero suprimir los ceros a la izquierda
; descomento las lineas comentadas.
;-------------------------------------------------
PRINT_A_DEC:
LD E, 0
LD D, $64 ; 100
DEC81 LD C, $1B ; "0" - 1
DEC82: INC C
SUB D
JP NC, DEC82
ADD A, D
LD B, A
LD A, C
CP $1D ; "1"
JP NC, DEC84
LD A, E
OR A
LD A, C
JP Z, DEC85
DEC84:
PUSH AF
RST $10
POP AF
LD E, $FF ; SET 0 FLAG
DEC85: LD A, D
SUB $5A ; 90
LD D, A
LD A, B
JP NC, DEC81 ; AGAIN
ADD A, $1C ; "0"
PUSH AF
RST $10
POP AF
RET
FIZZ DB 0
BUZZ DB 0
DB $76 ;N/L
Re: FIZZBUZZ
I made a small version in Basic without IF and without FOR
It has to be started by goto 10, as the Variables are predefined
It looks a bit funny, but does something similar.
Its still 307 Bytes and I wonder how I could save some more bytes...
any suggestions?
It has to be started by goto 10, as the Variables are predefined
It looks a bit funny, but does something similar.
Its still 307 Bytes and I wonder how I could save some more bytes...
any suggestions?
- Attachments
-
- Programm.jpg (6.88 KiB) Viewed 5927 times
-
- fizz1k.P
- FIZZBUZZ_FUNNY_1K
- (307 Bytes) Downloaded 186 times
In theory, there is no difference between theory and practice. But, in practice, there is.
Re: FIZZBUZZ
OK stupid me,
eliminate the numbers!!!
Its down to 292 Bytes
eliminate the numbers!!!
Its down to 292 Bytes
- Attachments
-
- fizz1k_1.P
- (292 Bytes) Downloaded 188 times
-
- Programm.jpg (6.79 KiB) Viewed 5922 times
In theory, there is no difference between theory and practice. But, in practice, there is.
Re: FIZZBUZZ
It's a nice version
How are you checking the used memory ?
Gus
How are you checking the used memory ?
Gus
Re: FIZZBUZZ
I take the size of the .P file
In theory, there is no difference between theory and practice. But, in practice, there is.