Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Binary coded decimals
2003-02-01 12:41
Blackspawn
Account closed

Registered: Jun 2002
Posts: 11
Binary coded decimals

Hi folks!

I'm just reading "Escape From New York dissected" by Lasse Öörni. I'm curious to know why he uses binary coded decimals all the time, e.g. for hiscores, time counter etc. I don't see the real advantage of them here. Any ideas?

Regards,
Blackspawn
2003-02-01 12:50
cadaver

Registered: Feb 2002
Posts: 1160
Yeah, in complex programs it's much more flexible to use non-BCD numbers for all calculations, to make arbitrary arithmetic operations possible, AND only convert them when displaying.

But EFNY is an oldschoolish game where there's only simple addition & subtraction to the values, so in that case using BCD arithmetic makes the printing a bit more straightforward, and faster.
2003-02-01 12:54
cadaver

Registered: Feb 2002
Posts: 1160
Btw. then there's also Richard's way, to store scores etc. directly on screen memory (!) and handle them one digit (0-9) at a time :))))))
2003-02-02 18:44
Graham
Account closed

Registered: Dec 2002
Posts: 990
including BCD into the assembler language is rather stupid i think. all calculations and stuff are way easier to do in binary. for example a BCD-multiplication would be rather complicated and slow. i think BCD only made its way into assembler languages due to very lame cobol compiler programmers...
2003-09-17 15:47
Dbug

Registered: Aug 2003
Posts: 5
Quote: including BCD into the assembler language is rather stupid i think. all calculations and stuff are way easier to do in binary. for example a BCD-multiplication would be rather complicated and slow. i think BCD only made its way into assembler languages due to very lame cobol compiler programmers...


Ok, multiplication and divides are not straightforward in BCD mode, but additions, subtractions and comparisons work perfectly in that mode, and it's a lot easier to handle things supposed to be displayed in decimal in BCD than in binary.

I'm currently writing a game for the Minigame compo 2003, and for displaying scores I'm simply storing them in BCD and then use a standard hexadecimal display routine.

RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Andy/AEG
Alta
MWR/Visdom
rambo/Therapy/ Resou..
Icon/TRIAD
cba
Twilight/Excess/Arcade
Twoflower/ΤRIΛD
grennouille
Guests online: 132
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.7)
4 Acidchild  (9.7)
5 Cash  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.038 sec.