3.2.1. , ( ), - , . - , MS DOS ASCII-, , Norton Commander, Multi-Edit, .
(source language), , , . Micro Series 8051 Assembler ( 8051) IAR Systems ( 1.80/MD2).
3.2.2. , , (pseudoinstruction) , , :
: ();.
, , .
, - , , (. . 3.2.7 ¸ 3.2.10).
3.2.3. , ( ) . . _. 31 . . , .
3.2.4. , , , . DB, (. . 3.2.9), EQU, (. . 3.2.7).
3.2.5. () , . (NOP, RET, RETI), . . -, -. - .
MCS-51 6 : , , , , (. 2.8).
|
|
.
@ .
# . , #2+3, , , L. , a ASCII .
, .
, , . : D , B , Q , . .
, , (. . 3.2.7). , 8051 ( PCON) .
3.2.6. . ; , . 8051 .
3.2.7. EQU, :
CONST EQU number,
CONST , number .
, , , (external), :
EXTERN LABEL1,
(public), :
PUBLIC LABEL1.
3.2.8. , , . (. 3.4).
(segment) ()
ORG addr,
addr ,
()
RSEG name,
name .
3.2.9. DB (define byte), , , :.
DB 1FH,2FH,3FH.
3.2.10. END, .
3.2.11. ( ) msa s03, 8051. (source module).
3.3.1. (translation) (object module), . -. . ( ), ( ).
|
|
3.3.2. ., - , MS-DOS :
a8051.exe *.msa [*.lst] [*.r03],
a8051.exe ,
*.msa ,
*.lst ,
*.r03 .
* .
.
. , , , , r03. , ,
A8051.exe program.msa,
program.r03.
. .
3.3.3. (. 3.2), , (errors), (bytes) (CRC).
, , , , , , , , (. 3.3).
Micro Series 8051 Assembler V1.80/MD2
Copyright IAR Systems 1985
Errors: None #########
Bytes: 36 #program#
CRC: 1C97 #########
3.2.
Micro Series 8051 Assembler V1.80/MD2
Copyright IAR Systems 1985
Error in 8: Invalid instruction
MOVB A,R3
End of pass 1
Errors: 1 #########
Bytes: 36 #program#
CRC: 32EE #########
3.3.
3.4.
3.4.1. (linking) , , . -. , , ,. .
Micro Series Linking Loader IAR Systems, , hex- (. . 3.4.2). hex- , .
3.4.2. hex- (Intel standard format) . 3.4. , 5 37 , : 1- ,
2- ( ), 3- , 4- (00 , , 01 ), , 4- .
|
|
3.4.3. :
xlink.exe <CPU> <Input file(s)> [<Segment definition(s)>] [/<Options>],
< > , . <Input file(s)> <Options>, , <Segmentdefinition(s)> . , .
. 3.4. hex- (Intel Standard Format)
<CPU> (8051).
<Input file(s)> .
<Segment definition(s)> . :
(SEGA,SEGB...) ,
(SEGA,SEGB...)=2000
(hex) .
(SEGA)=+100
SEGA 100 (hex).
<Options>, / , , :
O=absfile hex-,
, O=program.hex,
X=listfile ,
, X=cros_ref.lst,
M=listfile ,
, =load_map.lst,
S=listfile ,
, S=segm_map.lst,
V,symbol=value , , V,EXTDAT=22 ,
EXTDAT
22 (hex).
, program.r03 mylib.r03, , MAIN, , 100, DELAY, MAIN, hex- program.hex, program.lst, :
xlink 8051 program mylib (MAIN,DELAY)=100 /O=program.hex M=program.lst
3.4.4. , , , .
3.4.5.