|
|
About the course
Downloads
Introduction to DSM51ASS
Exercises
Top
| Parent
| Home
About the course
Exercise topics: Atchitecture of the 8051 microcontroller
Equipment:
System Design Kit DSM51
Software:
- dsm51ass.exe - The 8051 Cross Assembler for IBM PC
- the DSM-51 manager software compatible witch Windows 95/98, 2000, XP
References:
- Short architecture description of the of the 8051 is contained in the 8051 presentation, detailed in [3].
- P.Gałka, P.Gałka "Podstawy programowania mikrokontrolera 8051", Wydawnictwo MIKOM, Warszawa 2002 (In polish)
- T. Starecki. "Mikrokontrolery 8051 w praktyce". Wydawnictwo BTC Warszawa 2002 (In polish)
- Rydzewski A. "Mikrokomputery jednoukładowe rodziny MCS-51", WNT Warszawa 1992 (In polish)
- "80C51 - based 8-bit Microcontrollers", Data Handbook, PHILIPS 1992
- a large number of the Internet publications
Top
| Up
| Home
Downloads
- 8051 Assembler and documentation
- Hardware Documentation of 80C51
- Program DSM-51.exe 3.02 (Windows) used to run programs on the DSM-51 training kit is also available on the manufacturer's website.
Information for sympathizer with the course:
Under the www.rigelcorp.com link you can find software simulator program the processor 8051 (setupreads51.exe), and documentation. The free user licence for students is availlable. The usefull DSM-51 simulator JAGODA is also available with the free licence.
[dsm51ass.zip
]
[80c51.zip
]
[DSM-51.zip
]
Top
| Up
| Home
- dsm51ass.zip
- 8051 Assembler and documentation.
- 80c51.zip
- Hardware Documentation of 80C51.
- DSM-51.zip
- DSM-51.exe 3.02 (Windows) package used to run programs on the DSM-51 training kit is also available at the manufacturer's website.
Top
| Up
| Home
Introduction to DSM51ASS
Preparation and compilation of programs for the microcontroller is done on a PC. You can prepare a program using any text editor, such as notepad.
A typical line of the program is as follows:
<symbol> <instruction> [<operand>] [;<comment>]
Each pair of fields in a program line must be separated with at least one character spaces (or tabs). Field labels may be empty but must occur, which means that you can not start writing the command mnemonics from the beginning of the line, it must be preceded by at least one space of the individual fields is as follows:
- <symbol>
-
Symbols are alphanumeric representations of numeric constants, addresses, macros, etc. Symbol must be placed from the start of the line (the first character of the symbol must be the first character in the line).
To ensure that the Cross Assembler can distinguish between a symbol and a number, all symbols must start with either a letter or an underscore '_' and can contain any combination of letters, digits and underscores. Symbols can be defined only once. The following are examples of legal symbols:
PI
Serial_Port_Buffer
LOC_4096
Labels are special cases of symbols. Labels are used only before statements that have
physical addresses associated with them. Examples of such statements are assembly
language instructions, data storage directives (DB and DW), and data reservation
directives (DS and DBIT). Labels must follow all the rules of symbol creation with the
additional requirement that they be followed by a colon. The following are legal examples
of label uses:
TABLE_OF_CONTROL_CONSTANTS:
DB 0,1,2,3,4,5 (Data storage)
MESSAGE: DB 'HELP' (Data storage)
VARIABLES: DS 10 (Data reservation)
BIT_VARIABLES: DBIT 16 (Data reservation)
START: MOV A,#23 (Assembly language instruction)
- <instruction>
-
Mnemonic processor machine code, assembler directive, or macro.
- <operand>
-
The information required by the mnemonic, directive, or macro assembler. Individual operands are separated by commas.
- <comment>
- All the characters after the semicolon are treated as comments and ignored by the assembler.
Example (a few instructions, without the sense).
;10ms = 36*256 cykli
;Mod 1 - przestawiam tylko starszy bajt
TMOD_SET EQU 00010000B
TH0_SET EQU 256-30
TH1_SET EQU 256-36
IE_SET EQU 10001010B ;przerwania T0 i T1
IP_SET EQU 00001000B ;wyższy priorytet T1
MOV DISPLAY+4,#0
INC DISPLAY+5
MOV A,#6
CJNE A,DISPLAY+5,INTT1_END
MOV DISPLAY+5,#0
INTT1_END:
POP PSW
POP ACC
To execute the program, it must be assembled, that menas translated into machine language. For this, the assembler DSM51ASS is usefull. Invoke it from the command line system
DSM51ASS <name>
<name> path to the file containing the program.
Assembler creates two files:
<name>. hex - contains the object code in Intel HEX format
<name>. lst - Program listing
Top
| Up
| Home
Exercises
[Exercise 1a
]
[Exercise 2a
]
[Exercise 3a
]
Top
| Up
| Home
- Exercise 1a
- Exercise 2a
- Exercise 3a
Top
| Up
| Home
|
|