18.11.2014 Views

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

into memory in the 8052-BASIC system. <strong>The</strong> following sections describe each of these in<br />

more detail.<br />

Programming Reference<br />

This book concentrates on BASIC-52 programming. I’ve included enough information<br />

about assembly language to get you started programming, plus what you need to know to<br />

interface assembly-language routines to BASIC-52. But there is much more to assemblylanguage<br />

programming than I can cover here.<br />

If you are an experienced assembly-language programmer, Intel’s Embedded <strong>Microcontroller</strong>s<br />

handbook, or a similar reference from another 8052 vendor, may be all you need as a<br />

reference. <strong>The</strong> handbook includes a programmer’s guide and describes each of the 8052’s<br />

instructions.<br />

If you’re just starting out with assembly language, you might want to invest in a more<br />

complete text that includes examples and explanations of how to put together a program.<br />

Examples can be extremely useful for seeing how to do common tasks like generating a<br />

timing delay or handling an interrupt. Appendix A lists several books on the 8051 family<br />

that include programming examples and tutorials.<br />

Text Editor<br />

Calling Assembly-language Routines<br />

<strong>The</strong> text editor is the software that you use to create your source files. <strong>The</strong> editor program<br />

must be able to create files in straight ASCII format, without adding any formatting<br />

codes. Just about all word processors have this ability, as do simpler text editors like MS-<br />

DOS’s EDIT.<br />

Assembler<br />

<strong>The</strong> assembler is the program that creates an object, or executable, file from your source<br />

file. If you write assembly-language programs for your personal computer, you use an assembler,<br />

such as MASM for 80x86 microprocessors. MASM creates files that will execute<br />

on 80x86 systems, using the 80x86’s instruction set.<br />

To assemble a program for an 8052 microcontroller, you need a special type of assembler<br />

called a cross assembler. <strong>The</strong> cross assembler runs on your personal, or host, computer, but<br />

creates programs to run on a different chip, such as the 8052. Assemblers for 8051-family<br />

chips, which you can use for 8052 programming, are widely available. Appendix A lists<br />

vendors of assemblers and BBS’s from which you can download free and shareware<br />

assemblers.<br />

<strong>The</strong> <strong>Microcontroller</strong> <strong>Idea</strong> <strong>Book</strong> 219

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!