Understanding Packed BCD

Packed BCD (Binary Coded Decimal) is a numeric format that was directly supported on cpu's almost from the beginning, and still is today. Simply put, it relies on the fact that 4 bits are more than sufficient to represent decimal numbers. Therefore, two decimal numbers can be held in each byte, a 32 bit register can hold 8 such numbers, and a 64 bit register can of course hold 16. Many cpu's can do BCD math - it's just a matter of having the half bytes carry when their value exceeds 9, conceptually not a lot different than ordinary binary math. It also isn't very hard to write programs to do math on BCD numbers of arbitrary length.

Title  Last Comment
Unix and Linux startup scripts Part 4, Systemd  
- Systemd is gaining favor in Linux distributions. This is a big change from inittab and everything else -

Being confused can sometimes help  
- If my customer's email hadn't been confused, I wouldn't have called him to help and he would have waited for something that was never going to happen. -

Trapping errors in Bash  
- While I think you need to avoid getting too clever in shell scripts, trapping errors can be useful. -

'ps' and 'grep'  
- Grepping lines out of ps is a common task. Unfortunately, it's also easy to go terribly wrong and not get what you expected at all. -

tput and stty  
- tput and stty are related in the sense that they both have to do with how a Unix terminal behaves. Tput is perhaps less important than it used to be, but still useful -

Basic software firewall introduction for home users  
- You almost certainly have a software firewall on your Windows or Mac computer. You also probably have a hardware firewall. Understanding just a little bit about them can save you trouble. -

Removing empty directories  
- Follow along as we segue and digress, dive deep and reverse ourselves all while trying to avoid the pedantic spoilers who would surely ruin our fun emptying our directories. -

All about ping   2013/09/10 TonyLawrence
- Ping is a useful network diagnostic, but it can have its own issues - timeouts, duplicate packets, intermittent issues and more. -

Is rm final? Can I get my files back?   2013/08/07 BigDumbDinosaur
- Is rm final? Are the files gone forever? It depends on what you mean by really gone and also depends upon your file system, your OS, and rm itself. -

Run a script every other day but not on weekends  
- While this became much easier with Vixie cron, there are still circumstances that need some extra help in the script. -

Sparse Files  
- Sparse files are a result of the way systems allocate storage space. Sparse files appear to take up much more disk space than they actually do. -

View large files without more or less  
- I have a rescue disk that doesn't include "more" or "less" - how can I examine large files? -

Computer basics - Right Click your way to Computer Happiness   2013/07/21 TonyLawrence
- One thing I really recommend is right-clicking. You can really learn a lot about your computer by exploring the options available with a right-click. -

Computer basics - cut and paste and beyond   2013/07/18 Bryson
- There are few things that have surprised me more than finding people who do not know how to copy text from one place to another. If that's you, read on.. -

All about Telnet  
- A collection of telnet related information and links. Telnet is seldom used today except for network troubleshooting. -

Here files (shell scripting) 2012/10/09 TonyLawrence
- Once again, I've been bitten by not having read the manual recently. This bite really annoyed me. -

No clobber scp - scp without overwriting   2012/10/07 TonyLawrence
- Although you usually want scp to update files, there are times when you definitely do not. I wrote this script to avoid overwriting existing files. -

Capture and report (Bash Scripting)
- You've been asked to copy some jpg files to a USB disk overnight. That's easy enough - a cron job and a simple 'cp -a' will do that. But there is so much that could go wrong, isn't there? There might not be any files to copy or there might not be room on the USB disk. Somebody might have changed permissions on files or directories alreasdy in place, preventing overwrite with updated images. -

Do you hate your computer?   2011/09/15 BigDumbDInosaur
- I knew someone who became so frustrated with a computer printer that he threw it down on the floor and jumped up and down on it until it was smashed to pieces. That's a bit extreme (and damaging to your bank account), but technology can make us feel like that, can't it? -


Death of the command line revisited   2011/09/10 TonyLawrence
- Five years ago I wrote a little blurb called Death of the command line. As it happened, that article was misunderstood by many who read it - I don't know if it was my fault or theirs, but somehow many readers ended up thinking I was either predicting the demise of CLI's (Command Line Interfaces) or hoping for that demise or both. Nothing could have been farther from the truth. I remain a big fan of CLI's and use them daily. And yet, just five years later and still at risk of angering yet another batch of folk who won't read carefully, I'm going to suggest that predicting the death of the CLI may not be such a bad bet after all. -

Cranky Old Newsgroup Guys   2011/10/22 BigDumbDinosaur
- People new to the Internet may not even understand the difference between a forum and a Newsgroup. Indeed, many may never have participated in any Newsgroup discussions at all. If you have, it may have only been thorough Google Groups, and if your only exposure to the Usenet Newsgroups (with a capital N, yes) has been through that, it can be a little hard to tell the difference between those and a discussion forum. They both have people discussing things, arguing, calling each other idiots and so on. What's the difference? -

Email addresses still matter (for now)  
- Email: it has helped kill the post office, is the primary source of spam, is critical to many businesses and, after malware, is probably the single largest source of user difficulties. Every internet user has at least one email address and many of us have several. Email is ubiquitous and very important. It's also threatened: many people use services like Facebook and Google+ for most of their daily communication. Somewhat ironically, you typically need an email address to sign up for these services, but the deficiencies of email have even caused some to try to eschew it completely and only use alternatives like those. That trend may continue; in a decade or so, "email" may be as antiquated as "gopher" and "uucp" are today. -

Why defragging your computer may be a waste of time   2012/12/03 BigDumbDinosaur
- In fact, defragmenting may be a total waste of time. It's unlikely to be harmful (though it can be if interrupted by a sudden power failure), but it may actually accomplish nothing worth even the minor effort it takes to run it. -

Common email problems   2011/09/02 ed
- Yesterday I talked about why you shouldn't send Word attachments in email. Today I'll continue with more attachment related issues and also touch on some other common email glitches. -

Why you shouldn't send Word attachments   2011/08/31 BigDumbDinosaur
- As I continued my walk, I thought about how email issues are likely the most common mysteries my neighbors have with their computers. Notice that I said "mysteries" and not "problems". That's because most email issues are from misunderstanding and confusion, not necessarily any real problem. A virus infection is a problem. A dead hard drive is also a problem, but email is usually simple confusion or lack of knowledge. -

10 things - no, 11 things - you say that drive your computer tech person crazy   2011/09/20 anonymous
- Yes, of course people sometimes say or do silly things, even outright stupid things. We all do. Look me straight in the eye and tell me you have never done anything like that with a computer and I'll look you straight in the eye and tell you the same thing and then we'll both try not to laugh. -

A non-technical guide to understanding and fixing TCP/IP problems on a network   2011/08/14 BigDumbDinosaur
- The title is a bit incorrect in the .non-technical. claim, because we are dealing with a geekish subject here and I can't avoid being a little "techie". -

Getting Started with Amazon Web Services   2011/04/12 TonyLawrence
- Getting a web site up and running on Amazon Web Services is much easier than it looks. -

Tips on Hard Drive Problems   2011/03/02 BigDumbDinosaur
- Back in the 1980's, I could count on earning a few hundred dollars every month from hard disk failures. -

Why would I even want a computer?  
- Why do you want a computer? Presentation for seniors: This is a preliminary outline for a very basic presentation to seniors. Some of you may want to use this yourselves and of course I appreciate any suggestions or additions. -

Simple XML POST and reply   2010/03/24 TonyLawrence
- A customer has an app that needs to post and get XML data from a website. This task was being handled by .asp scripts on a Windows box, but now they want it moved to Linux and Perl. -

Network Troubleshooting   2010/03/16 AndrewSmallshaw
- As it turned out, the problem was very physical: a light fixture had fallen down and loosened some connections to a long forgotten ethernet switch. -

What does a leading colon (:) mean in a script?  
- Bash and sh use colons as a separator ($PATH, for example), as a modifier (${n:="foo"}) and as a null operator ("while :"). -

Basic TrueCrypt Usage   2010/01/12 TonyLawrence
- People have said that they installed TrueCrypt, but have no idea what to do next. OK, maybe the interface isn't all that user friendly. -

Unix and Linux startup scripts, Part 1  
- In the beginning, there was "init". If you had a Unix system, you had "init" and it was almost certainly process id 1. -

Unix and Linux startup scripts, Part 2   2009/12/11 TonyLawrence
- The rc.d system is used on NetBSD, FreeBSD and DragonFly (and possibly a few other systems) to launch daemon processes when the system goes multiuser. -

Unix and Linux startup scripts, Part 3  
- We have looked at both System V and BSD methods; until fairly recently that would hav e been the end of the discussion. -

Using color in shell scripts (Linux, Mac OS X)   2010/01/03 BigDumbDInosaur
- Color is tricky. Displays can be bad at it, people can be color blind... using colors can make text hard to read - I don't like using color in scripts. -

Sort -u vs. uniq  
- Don't tie yourself in pipeline knots with either of them; learn to use each of them appropriately and your scripts will be easier. -

Freeing disk space with >  
- I wrote this up after a forum discussion in which several posters didn't really understand why '>' can free disk space when 'rm' cannot. -

Network Time Protocol - get atomic clock's precision from the Internet  
- It is ridiculous that a computer that we buy for several hundred dollars cannot be as accurate as a watch that be bought for less than 10$. That does not have to be the case once you read and understand this article. -

X hotkeys with xbindkeys  
- xbindkeys is very easy to use when you wish to bind hotkey presses on X sessions -

The amazing tool called netcat  
- netcat with its simple and yet incredibly powerful command line constructs has helped me innumerable times -

Concepts in Cryptography  
- Basic cryptography has wide application. Understanding the basic concepts isn't difficult. -

Some fun tools in the UNIX ecosystem  
- Some fun tools in the UNIX ecosystem include 'randtype', which pretends to be a human typist. -

A refreshing web programming tutorial  
- Creating drag and drop elements, animations of various forms used in a photo slideshow or image processing tool are straight forward. -

Creating screencast video tutorials for the web   2012/07/06 TonyLawrence
- Basic Linux video: Creating video tutorials is a novel method of web based tutoring. Nowadays right from product demos for marketing/sales to technical talks, everything is found in youtube. Videos are a powerful medium to get your idea across and your audience can quickly understand what you are trying to convey when they see a video. -

What is p2p?  
- The moment you hear the term p2p, the first thing that comes to your mind will mostly be BitTorrent. It is a fantastic file sharing protocol and in a way it rewrote the way we have always understood file transfers on the Internet. Curious geeks can refer to this detailed specification to understand how the protocol works. It is advanced technology and a brilliant way to solve the age old problem of scalability and web traffic overloads which have crashed the best of web servers. -

Basic (very basic) TCP/IP  
- I recently had to explain TCP/IP to a non-technical person. What follows is basically what I came up with, though it doesn't have any of the hand waving, pointing or any of the other dramatic gestures and facial expressions I used to fill in the gaps. -

Fear of fsck   2011/06/02 KenPorter
- They were afraid to run fsck for several months - were their fears justified or were they being foolish? -

Samepage - Redefining how people create and share information
Windows Performance Boosts  
- This is about speeding up your Windows computer. I'm assuming that you have sufficient disk space, RAM and that you don't have viruses or spyware running . -

Breaking out of a script  
- Sometimes you just want to bail out of a script when something happens. Let's say we're testing the output of some "chk" command and want to exit if it says "No". That's easy: we just add "chk | grep -q "No" && exit 0" to our script. If that "chk" spits out "No", our script is done right then and there - no more of it will be executed. -

Email Basics  
- Basics of Email: Before we get started, what's the first word you think of when I say "email"? -

Why use that primitive Vi?  
- With Vi I can control what happens and where it happens very specifically. If I need exactly seven characters deleted, I can say "Type 7 and then x". -

Bash Brace Expansion  
- Simple Bash Brace Expansion. The new tricks Bash has picked up in 3.0 are exciting and useful, but simple brace expansion has been available for some time now, and yet we seldom see it used. I suppose that's because the need doesn't come up too often. -

Cables and switches basics  
- Basic Network Hardware Most networks use RJ45 connectors plugged in hubs or switches - usually switches today. -

Perl Reporting  
- It's been so long since I have used any of these reporting features that I had to drag out my big Camel Book to review the whole subject. -

How do you do X in Unix (Linux,Solaris..)?  
- Understanding the difference between the OS and your interface:: One of the paradigm shifts Windows users (and even some Unix users) have to get by is often seen in a "How do I do X in Y?" question, for example "How do I repeat commands in Unix?". Of course that can be a perfectly legitimate question, but often the person asking is missing an important concept: Unixish systems do not tightly bind the user interface to the system. -

But I'm not a programmer!  
- You should learn something about programming - it's really not hard:: Consider this: you start up your computer and check your email. If you see something from one of your friends, you probably look at it right away. If you see spam, you delete it or mark it as junk. If you see something business related, you read it and respond as needed. -

More Basics articles

Have you tried our Tests?