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: 1153
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: 1153
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
t0m3000/ibex-crew
aegis/ascraeus/r3turn
celticdesign/G★P/M..
krissz
FABS/HF
kbs/Pht/Lxt
K-reator/CMS/F4CG
chromemag
Guests online: 103
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Bromance  (9.6)
10 Memento Mori  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.8)
4 Acidchild  (9.7)
5 Starlight  (9.6)

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