-
Notifications
You must be signed in to change notification settings - Fork 0
/
hello_world.asm
622 lines (617 loc) · 18.5 KB
/
hello_world.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
;--------------------------------------------------------
; File Created by C51
; Version 1.0.0 #1069 (Apr 23 2015) (MSVC)
; This file was generated Mon Feb 26 14:27:40 2018
;--------------------------------------------------------
$name hello_world
$optc51 --model-small
R_DSEG segment data
R_CSEG segment code
R_BSEG segment bit
R_XSEG segment xdata
R_PSEG segment xdata
R_ISEG segment idata
R_OSEG segment data overlay
BIT_BANK segment data overlay
R_HOME segment code
R_GSINIT segment code
R_IXSEG segment xdata
R_CONST segment code
R_XINIT segment code
R_DINIT segment code
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
public _main
public __c51_external_startup
;--------------------------------------------------------
; Special Function Registers
;--------------------------------------------------------
_ACC DATA 0xe0
_ADC0ASAH DATA 0xb6
_ADC0ASAL DATA 0xb5
_ADC0ASCF DATA 0xa1
_ADC0ASCT DATA 0xc7
_ADC0CF0 DATA 0xbc
_ADC0CF1 DATA 0xb9
_ADC0CF2 DATA 0xdf
_ADC0CN0 DATA 0xe8
_ADC0CN1 DATA 0xb2
_ADC0CN2 DATA 0xb3
_ADC0GTH DATA 0xc4
_ADC0GTL DATA 0xc3
_ADC0H DATA 0xbe
_ADC0L DATA 0xbd
_ADC0LTH DATA 0xc6
_ADC0LTL DATA 0xc5
_ADC0MX DATA 0xbb
_B DATA 0xf0
_CKCON0 DATA 0x8e
_CKCON1 DATA 0xa6
_CLEN0 DATA 0xc6
_CLIE0 DATA 0xc7
_CLIF0 DATA 0xe8
_CLKSEL DATA 0xa9
_CLOUT0 DATA 0xd1
_CLU0CF DATA 0xb1
_CLU0FN DATA 0xaf
_CLU0MX DATA 0x84
_CLU1CF DATA 0xb3
_CLU1FN DATA 0xb2
_CLU1MX DATA 0x85
_CLU2CF DATA 0xb6
_CLU2FN DATA 0xb5
_CLU2MX DATA 0x91
_CLU3CF DATA 0xbf
_CLU3FN DATA 0xbe
_CLU3MX DATA 0xae
_CMP0CN0 DATA 0x9b
_CMP0CN1 DATA 0x99
_CMP0MD DATA 0x9d
_CMP0MX DATA 0x9f
_CMP1CN0 DATA 0xbf
_CMP1CN1 DATA 0xac
_CMP1MD DATA 0xab
_CMP1MX DATA 0xaa
_CRC0CN0 DATA 0xce
_CRC0CN1 DATA 0x86
_CRC0CNT DATA 0xd3
_CRC0DAT DATA 0xcb
_CRC0FLIP DATA 0xcf
_CRC0IN DATA 0xca
_CRC0ST DATA 0xd2
_DAC0CF0 DATA 0x91
_DAC0CF1 DATA 0x92
_DAC0H DATA 0x85
_DAC0L DATA 0x84
_DAC1CF0 DATA 0x93
_DAC1CF1 DATA 0x94
_DAC1H DATA 0x8a
_DAC1L DATA 0x89
_DAC2CF0 DATA 0x95
_DAC2CF1 DATA 0x96
_DAC2H DATA 0x8c
_DAC2L DATA 0x8b
_DAC3CF0 DATA 0x9a
_DAC3CF1 DATA 0x9c
_DAC3H DATA 0x8e
_DAC3L DATA 0x8d
_DACGCF0 DATA 0x88
_DACGCF1 DATA 0x98
_DACGCF2 DATA 0xa2
_DERIVID DATA 0xad
_DEVICEID DATA 0xb5
_DPH DATA 0x83
_DPL DATA 0x82
_EIE1 DATA 0xe6
_EIE2 DATA 0xf3
_EIP1 DATA 0xbb
_EIP1H DATA 0xee
_EIP2 DATA 0xed
_EIP2H DATA 0xf6
_EMI0CN DATA 0xe7
_FLKEY DATA 0xb7
_HFO0CAL DATA 0xc7
_HFO1CAL DATA 0xd6
_HFOCN DATA 0xef
_I2C0ADM DATA 0xff
_I2C0CN0 DATA 0xba
_I2C0DIN DATA 0xbc
_I2C0DOUT DATA 0xbb
_I2C0FCN0 DATA 0xad
_I2C0FCN1 DATA 0xab
_I2C0FCT DATA 0xf5
_I2C0SLAD DATA 0xbd
_I2C0STAT DATA 0xb9
_IE DATA 0xa8
_IP DATA 0xb8
_IPH DATA 0xf2
_IT01CF DATA 0xe4
_LFO0CN DATA 0xb1
_P0 DATA 0x80
_P0MASK DATA 0xfe
_P0MAT DATA 0xfd
_P0MDIN DATA 0xf1
_P0MDOUT DATA 0xa4
_P0SKIP DATA 0xd4
_P1 DATA 0x90
_P1MASK DATA 0xee
_P1MAT DATA 0xed
_P1MDIN DATA 0xf2
_P1MDOUT DATA 0xa5
_P1SKIP DATA 0xd5
_P2 DATA 0xa0
_P2MASK DATA 0xfc
_P2MAT DATA 0xfb
_P2MDIN DATA 0xf3
_P2MDOUT DATA 0xa6
_P2SKIP DATA 0xcc
_P3 DATA 0xb0
_P3MDIN DATA 0xf4
_P3MDOUT DATA 0x9c
_PCA0CENT DATA 0x9e
_PCA0CLR DATA 0x9c
_PCA0CN0 DATA 0xd8
_PCA0CPH0 DATA 0xfc
_PCA0CPH1 DATA 0xea
_PCA0CPH2 DATA 0xec
_PCA0CPH3 DATA 0xf5
_PCA0CPH4 DATA 0x85
_PCA0CPH5 DATA 0xde
_PCA0CPL0 DATA 0xfb
_PCA0CPL1 DATA 0xe9
_PCA0CPL2 DATA 0xeb
_PCA0CPL3 DATA 0xf4
_PCA0CPL4 DATA 0x84
_PCA0CPL5 DATA 0xdd
_PCA0CPM0 DATA 0xda
_PCA0CPM1 DATA 0xdb
_PCA0CPM2 DATA 0xdc
_PCA0CPM3 DATA 0xae
_PCA0CPM4 DATA 0xaf
_PCA0CPM5 DATA 0xcc
_PCA0H DATA 0xfa
_PCA0L DATA 0xf9
_PCA0MD DATA 0xd9
_PCA0POL DATA 0x96
_PCA0PWM DATA 0xf7
_PCON0 DATA 0x87
_PCON1 DATA 0xcd
_PFE0CN DATA 0xc1
_PRTDRV DATA 0xf6
_PSCTL DATA 0x8f
_PSTAT0 DATA 0xaa
_PSW DATA 0xd0
_REF0CN DATA 0xd1
_REG0CN DATA 0xc9
_REVID DATA 0xb6
_RSTSRC DATA 0xef
_SBCON1 DATA 0x94
_SBRLH1 DATA 0x96
_SBRLL1 DATA 0x95
_SBUF DATA 0x99
_SBUF0 DATA 0x99
_SBUF1 DATA 0x92
_SCON DATA 0x98
_SCON0 DATA 0x98
_SCON1 DATA 0xc8
_SFRPAGE DATA 0xa7
_SFRPGCN DATA 0xbc
_SFRSTACK DATA 0xd7
_SMB0ADM DATA 0xd6
_SMB0ADR DATA 0xd7
_SMB0CF DATA 0xc1
_SMB0CN0 DATA 0xc0
_SMB0DAT DATA 0xc2
_SMB0FCN0 DATA 0xc3
_SMB0FCN1 DATA 0xc4
_SMB0FCT DATA 0xef
_SMB0RXLN DATA 0xc5
_SMB0TC DATA 0xac
_SMOD1 DATA 0x93
_SP DATA 0x81
_SPI0CFG DATA 0xa1
_SPI0CKR DATA 0xa2
_SPI0CN0 DATA 0xf8
_SPI0DAT DATA 0xa3
_SPI0FCN0 DATA 0x9a
_SPI0FCN1 DATA 0x9b
_SPI0FCT DATA 0xf7
_SPI0PCF DATA 0xdf
_TCON DATA 0x88
_TH0 DATA 0x8c
_TH1 DATA 0x8d
_TL0 DATA 0x8a
_TL1 DATA 0x8b
_TMOD DATA 0x89
_TMR2CN0 DATA 0xc8
_TMR2CN1 DATA 0xfd
_TMR2H DATA 0xcf
_TMR2L DATA 0xce
_TMR2RLH DATA 0xcb
_TMR2RLL DATA 0xca
_TMR3CN0 DATA 0x91
_TMR3CN1 DATA 0xfe
_TMR3H DATA 0x95
_TMR3L DATA 0x94
_TMR3RLH DATA 0x93
_TMR3RLL DATA 0x92
_TMR4CN0 DATA 0x98
_TMR4CN1 DATA 0xff
_TMR4H DATA 0xa5
_TMR4L DATA 0xa4
_TMR4RLH DATA 0xa3
_TMR4RLL DATA 0xa2
_TMR5CN0 DATA 0xc0
_TMR5CN1 DATA 0xf1
_TMR5H DATA 0xd5
_TMR5L DATA 0xd4
_TMR5RLH DATA 0xd3
_TMR5RLL DATA 0xd2
_UART0PCF DATA 0xd9
_UART1FCN0 DATA 0x9d
_UART1FCN1 DATA 0xd8
_UART1FCT DATA 0xfa
_UART1LIN DATA 0x9e
_UART1PCF DATA 0xda
_VDM0CN DATA 0xff
_WDTCN DATA 0x97
_XBR0 DATA 0xe1
_XBR1 DATA 0xe2
_XBR2 DATA 0xe3
_XOSC0CN DATA 0x86
_DPTR DATA 0x8382
_TMR2RL DATA 0xcbca
_TMR3RL DATA 0x9392
_TMR4RL DATA 0xa3a2
_TMR5RL DATA 0xd3d2
_TMR0 DATA 0x8c8a
_TMR1 DATA 0x8d8b
_TMR2 DATA 0xcfce
_TMR3 DATA 0x9594
_TMR4 DATA 0xa5a4
_TMR5 DATA 0xd5d4
_SBRL1 DATA 0x9695
_PCA0 DATA 0xfaf9
_PCA0CP0 DATA 0xfcfb
_PCA0CP1 DATA 0xeae9
_PCA0CP2 DATA 0xeceb
_PCA0CP3 DATA 0xf5f4
_PCA0CP4 DATA 0x8584
_PCA0CP5 DATA 0xdedd
_ADC0ASA DATA 0xb6b5
_ADC0GT DATA 0xc4c3
_ADC0 DATA 0xbebd
_ADC0LT DATA 0xc6c5
_DAC0 DATA 0x8584
_DAC1 DATA 0x8a89
_DAC2 DATA 0x8c8b
_DAC3 DATA 0x8e8d
;--------------------------------------------------------
; special function bits
;--------------------------------------------------------
_ACC_0 BIT 0xe0
_ACC_1 BIT 0xe1
_ACC_2 BIT 0xe2
_ACC_3 BIT 0xe3
_ACC_4 BIT 0xe4
_ACC_5 BIT 0xe5
_ACC_6 BIT 0xe6
_ACC_7 BIT 0xe7
_TEMPE BIT 0xe8
_ADGN0 BIT 0xe9
_ADGN1 BIT 0xea
_ADWINT BIT 0xeb
_ADBUSY BIT 0xec
_ADINT BIT 0xed
_IPOEN BIT 0xee
_ADEN BIT 0xef
_B_0 BIT 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T5XCLK1 BIT 0xc1
_TR5 BIT 0xc2
_T5SPLIT BIT 0xc3
_TF5CEN BIT 0xc4
_TF5LEN BIT 0xc5
_TF5L BIT 0xc6
_TF5H BIT 0xc7
_RIE BIT 0xd8
_RXTO0 BIT 0xd9
_RXTO1 BIT 0xda
_RFRQ BIT 0xdb
_TIE BIT 0xdc
_TXHOLD BIT 0xdd
_TXNF1 BIT 0xde
_TFRQ BIT 0xdf
;--------------------------------------------------------
; overlayable register banks
;--------------------------------------------------------
rbank0 segment data overlay
;--------------------------------------------------------
; internal ram data
;--------------------------------------------------------
rseg R_DSEG
;--------------------------------------------------------
; overlayable items in internal ram
;--------------------------------------------------------
rseg R_OSEG
;--------------------------------------------------------
; indirectly addressable internal ram data
;--------------------------------------------------------
rseg R_ISEG
;--------------------------------------------------------
; absolute internal ram data
;--------------------------------------------------------
DSEG
;--------------------------------------------------------
; bit data
;--------------------------------------------------------
rseg R_BSEG
;--------------------------------------------------------
; paged external ram data
;--------------------------------------------------------
rseg R_PSEG
;--------------------------------------------------------
; external ram data
;--------------------------------------------------------
rseg R_XSEG
;--------------------------------------------------------
; absolute external ram data
;--------------------------------------------------------
XSEG
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
rseg R_IXSEG
rseg R_HOME
rseg R_GSINIT
rseg R_CSEG
;--------------------------------------------------------
; Reset entry point and interrupt vectors
;--------------------------------------------------------
CSEG at 0x0000
ljmp _crt0
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
rseg R_HOME
rseg R_GSINIT
rseg R_GSINIT
;--------------------------------------------------------
; data variables initialization
;--------------------------------------------------------
rseg R_DINIT
; The linker places a 'ret' at the end of segment R_DINIT.
;--------------------------------------------------------
; code
;--------------------------------------------------------
rseg R_CSEG
;------------------------------------------------------------
;Allocation info for local variables in function '_c51_external_startup'
;------------------------------------------------------------
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:7: char _c51_external_startup (void)
; -----------------------------------------
; function _c51_external_startup
; -----------------------------------------
__c51_external_startup:
using 0
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:10: SFRPAGE = 0x00;
mov _SFRPAGE,#0x00
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:11: WDTCN = 0xDE; //First key
mov _WDTCN,#0xDE
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:12: WDTCN = 0xAD; //Second key
mov _WDTCN,#0xAD
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:14: VDM0CN |= 0x80;
orl _VDM0CN,#0x80
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:15: RSTSRC = 0x02;
mov _RSTSRC,#0x02
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:18: SFRPAGE = 0x00;
mov _SFRPAGE,#0x00
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:19: CLKSEL = 0x00;
mov _CLKSEL,#0x00
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:20: CLKSEL = 0x00;
mov _CLKSEL,#0x00
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:21: while ((CLKSEL & 0x80) == 0);
L002001?:
mov a,_CLKSEL
jnb acc.7,L002001?
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:23: P0MDOUT |= 0x10; // Enable UART0 TX as push-pull output
orl _P0MDOUT,#0x10
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:24: XBR0 = 0x01; // Enable UART0 on P0.4(TX) and P0.5(RX)
mov _XBR0,#0x01
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:25: XBR1 = 0X00;
mov _XBR1,#0x00
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:26: XBR2 = 0x40; // Enable crossbar and weak pull-ups
mov _XBR2,#0x40
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:29: SCON0 = 0x10;
mov _SCON0,#0x10
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:30: CKCON0 |= 0b_0000_1000 ; // Timer 1 uses the system clock.
orl _CKCON0,#0x08
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:31: TH1 = 0x100-((SYSCLK/BAUDRATE)/2L);
mov _TH1,#0x96
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:32: TL1 = TH1; // Init Timer1
mov _TL1,_TH1
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:33: TMOD &= ~0xf0; // TMOD: timer 1 in 8-bit auto-reload
anl _TMOD,#0x0F
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:34: TMOD |= 0x20;
orl _TMOD,#0x20
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:35: TR1 = 1; // START Timer1
setb _TR1
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:36: TI = 1; // Indicate TX0 ready
setb _TI
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:38: return 0;
mov dpl,#0x00
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'main'
;------------------------------------------------------------
;------------------------------------------------------------
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:41: void main (void)
; -----------------------------------------
; function main
; -----------------------------------------
_main:
; C:\Users\carso\Documents\1. School\0. Spring 2018\Elec 292\lab4\hello_world.c:43: printf( "Hello, world!\r\n" );
mov a,#__str_0
push acc
mov a,#(__str_0 >> 8)
push acc
mov a,#0x80
push acc
lcall _printf
dec sp
dec sp
dec sp
ret
rseg R_CSEG
rseg R_XINIT
rseg R_CONST
__str_0:
db 'Hello, world!'
db 0x0D
db 0x0A
db 0x00
CSEG
end