Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

209 lines
12 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. AX51 MACRO ASSEMBLER STARTUP 02/07/08 21:06:48 PAGE 1
  2. MACRO ASSEMBLER AX51 V3.01
  3. OBJECT MODULE PLACED IN STARTUP.OBJ
  4. ASSEMBLER INVOKED BY: C:\Keil\C51\BIN\AX51.EXE STARTUP.A51 CASE SET(SMALL) EP
  5. LOC OBJ LINE SOURCE
  6. 1 $nomod51
  7. 2 ;------------------------------------------------------------------------------
  8. 3 ; This file is part of the C51 Compiler package
  9. 4 ; Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc.
  10. 5 ;------------------------------------------------------------------------------
  11. 6 ; STARTUP.A51: This code is executed after processor reset.
  12. 7 ;
  13. 8 ; To translate this file use A51 with the following invocation:
  14. 9 ;
  15. 10 ; A51 STARTUP.A51
  16. 11 ;
  17. 12 ; To link the modified STARTUP.OBJ file to your application use the following
  18. 13 ; BL51 invocation:
  19. 14 ;
  20. 15 ; BL51 <your object file list>, STARTUP.OBJ <controls>
  21. 16 ;
  22. 17 ;------------------------------------------------------------------------------
  23. 18 ;
  24. 19 ; User-defined Power-On Initialization of Memory
  25. 20 ;
  26. 21 ; With the following EQU statements the initialization of memory
  27. 22 ; at processor reset can be defined:
  28. 23 ;
  29. 24 ; ; the absolute start-address of IDATA memory is always 0
  30. 0080 25 IDATALEN EQU 80H ; the length of IDATA memory in bytes.
  31. 26 ;
  32. 0000 27 XDATASTART EQU 0H ; the absolute start-address of XDATA memory
  33. 0000 28 XDATALEN EQU 0H ; the length of XDATA memory in bytes.
  34. 29 ;
  35. 0000 30 PDATASTART EQU 0H ; the absolute start-address of PDATA memory
  36. 0000 31 PDATALEN EQU 0H ; the length of PDATA memory in bytes.
  37. 32 ;
  38. 33 ; Notes: The IDATA space overlaps physically the DATA and BIT areas of the
  39. 34 ; 8051 CPU. At minimum the memory space occupied from the C51
  40. 35 ; run-time routines must be set to zero.
  41. 36 ;------------------------------------------------------------------------------
  42. 37 ;
  43. 38 ; Reentrant Stack Initilization
  44. 39 ;
  45. 40 ; The following EQU statements define the stack pointer for reentrant
  46. 41 ; functions and initialized it:
  47. 42 ;
  48. 43 ; Stack Space for reentrant functions in the SMALL model.
  49. 0000 44 IBPSTACK EQU 0 ; set to 1 if small reentrant is used.
  50. 0100 45 IBPSTACKTOP EQU 0FFH+1 ; set top of stack to highest location+1.
  51. 46 ;
  52. 47 ; Stack Space for reentrant functions in the LARGE model.
  53. 0000 48 XBPSTACK EQU 0 ; set to 1 if large reentrant is used.
  54. 00010000 49 XBPSTACKTOP EQU 0FFFFH+1; set top of stack to highest location+1.
  55. 50 ;
  56. 51 ; Stack Space for reentrant functions in the COMPACT model.
  57. 0000 52 PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.
  58. 00010000 53 PBPSTACKTOP EQU 0FFFFH+1; set top of stack to highest location+1.
  59. 54 ;
  60. 55 ;------------------------------------------------------------------------------
  61. 56 ;
  62. 57 ; Page Definition for Using the Compact Model with 64 KByte xdata RAM
  63. 58 ;
  64. AX51 MACRO ASSEMBLER STARTUP 02/07/08 21:06:48 PAGE 2
  65. 59 ; The following EQU statements define the xdata page used for pdata
  66. 60 ; variables. The EQU PPAGE must conform with the PPAGE control used
  67. 61 ; in the linker invocation.
  68. 62 ;
  69. 0000 63 PPAGEENABLE EQU 0 ; set to 1 if pdata object are used.
  70. 64 ;
  71. 0000 65 PPAGE EQU 0 ; define PPAGE number.
  72. 66 ;
  73. 00A0 67 PPAGE_SFR DATA 0A0H ; SFR that supplies uppermost address byte
  74. 68 ; (most 8051 variants use P2 as uppermost address byte)
  75. 69 ;
  76. 70 ;------------------------------------------------------------------------------
  77. 71
  78. 72 ; Standard SFR Symbols
  79. 00E0 73 ACC DATA 0E0H
  80. 00F0 74 B DATA 0F0H
  81. 0081 75 SP DATA 81H
  82. 0082 76 DPL DATA 82H
  83. 0083 77 DPH DATA 83H
  84. 78
  85. 79 NAME ?C_STARTUP
  86. 80
  87. 81
  88. ------ 82 ?C_C51STARTUP SEGMENT CODE
  89. ------ 83 ?STACK SEGMENT IDATA
  90. 84
  91. ------ 85 RSEG ?STACK
  92. 000000 86 DS 1
  93. 87
  94. 88 EXTRN CODE (?C_START)
  95. 89 PUBLIC ?C_STARTUP
  96. 90
  97. 000000 91 CSEG AT 0
  98. 000000 020000 F 92 ?C_STARTUP: LJMP STARTUP1
  99. 93
  100. ------ 94 RSEG ?C_C51STARTUP
  101. 95
  102. 000000 96 STARTUP1:
  103. 97
  104. 98 IF IDATALEN <> 0
  105. 000000 787F 99 MOV R0,#IDATALEN - 1
  106. 000002 E4 100 CLR A
  107. 000003 F6 101 IDATALOOP: MOV @R0,A
  108. 000004 D8FD 102 DJNZ R0,IDATALOOP
  109. 103 ENDIF
  110. 104
  111. 105 IF XDATALEN <> 0
  112. MOV DPTR,#XDATASTART
  113. MOV R7,#LOW (XDATALEN)
  114. IF (LOW (XDATALEN)) <> 0
  115. MOV R6,#(HIGH (XDATALEN)) +1
  116. ELSE
  117. MOV R6,#HIGH (XDATALEN)
  118. ENDIF
  119. CLR A
  120. XDATALOOP: MOVX @DPTR,A
  121. INC DPTR
  122. DJNZ R7,XDATALOOP
  123. DJNZ R6,XDATALOOP
  124. ENDIF
  125. 119
  126. 120 IF PPAGEENABLE <> 0
  127. MOV PPAGE_SFR,#PPAGE
  128. ENDIF
  129. 123
  130. 124 IF PDATALEN <> 0
  131. AX51 MACRO ASSEMBLER STARTUP 02/07/08 21:06:48 PAGE 3
  132. MOV R0,#LOW (PDATASTART)
  133. MOV R7,#LOW (PDATALEN)
  134. CLR A
  135. PDATALOOP: MOVX @R0,A
  136. INC R0
  137. DJNZ R7,PDATALOOP
  138. ENDIF
  139. 132
  140. 133 IF IBPSTACK <> 0
  141. EXTRN DATA (?C_IBP)
  142. MOV ?C_IBP,#LOW IBPSTACKTOP
  143. ENDIF
  144. 138
  145. 139 IF XBPSTACK <> 0
  146. EXTRN DATA (?C_XBP)
  147. MOV ?C_XBP,#HIGH XBPSTACKTOP
  148. MOV ?C_XBP+1,#LOW XBPSTACKTOP
  149. ENDIF
  150. 145
  151. 146 IF PBPSTACK <> 0
  152. EXTRN DATA (?C_PBP)
  153. MOV ?C_PBP,#LOW PBPSTACKTOP
  154. ENDIF
  155. 150
  156. 000006 758100 F 151 MOV SP,#?STACK-1
  157. 152 ; This code is required if you use L51_BANK.A51 with Banking Mode 4
  158. 153 ; EXTRN CODE (?B_SWITCH0)
  159. 154 ; CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
  160. 000009 020000 E 155 LJMP ?C_START
  161. 156
  162. 157 END
  163. AX51 MACRO ASSEMBLER STARTUP 02/07/08 21:06:48 PAGE 4
  164. SYMBOL TABLE LISTING
  165. ------ ----- -------
  166. N A M E T Y P E V A L U E ATTRIBUTES
  167. ?C_C51STARTUP. . . C SEG 00000CH REL=UNIT, ALN=BYTE
  168. ?C_START . . . . . C ADDR ------- EXT
  169. ?C_STARTUP . . . . C ADDR 0000H R SEG=?CO?STARTUP?3
  170. ?STACK . . . . . . I SEG 000001H REL=UNIT, ALN=BYTE
  171. ACC. . . . . . . . D ADDR 00E0H A
  172. B. . . . . . . . . D ADDR 00F0H A
  173. DPH. . . . . . . . D ADDR 0083H A
  174. DPL. . . . . . . . D ADDR 0082H A
  175. IBPSTACK . . . . . N NUMB 0000H A
  176. IBPSTACKTOP. . . . N NUMB 0100H A
  177. IDATALEN . . . . . N NUMB 0080H A
  178. IDATALOOP. . . . . C ADDR 0003H R SEG=?C_C51STARTUP
  179. PBPSTACK . . . . . N NUMB 0000H A
  180. PBPSTACKTOP. . . . N NUMB 00010000H A
  181. PDATALEN . . . . . N NUMB 0000H A
  182. PDATASTART . . . . N NUMB 0000H A
  183. PPAGE. . . . . . . N NUMB 0000H A
  184. PPAGEENABLE. . . . N NUMB 0000H A
  185. PPAGE_SFR. . . . . D ADDR 00A0H A
  186. SP . . . . . . . . D ADDR 0081H A
  187. STARTUP1 . . . . . C ADDR 0000H R SEG=?C_C51STARTUP
  188. XBPSTACK . . . . . N NUMB 0000H A
  189. XBPSTACKTOP. . . . N NUMB 00010000H A
  190. XDATALEN . . . . . N NUMB 0000H A
  191. XDATASTART . . . . N NUMB 0000H A
  192. REGISTER BANK(S) USED: 0
  193. ASSEMBLY COMPLETE. 0 WARNING(S), 0 ERROR(S).