📄 main.lst
字号:
454 ;/* PROJECT : RF key demonstrator (ASK or FSK)
*/
455 ;/* Functions:
*/
456 ;/* Make_frame
457 ;/* Read_ID
458 ;/* Make_daytona_data
459 ;/* Calculate_checksum
460 ;/* Make_frame
461 ;/**************************************************
***************************/
462
463 ;/**************************************************
***************************/
464 ;/* Make_preamble
*/
465 ;/* Description : it reads the preamble & stores it
in Tx_byte */
466 ;/* In : Preamble in flash
*/
467 ;/* Out : Tx_byte, Tx_byte+1
*/
468 ;/* local variables :
*/
469 ;/**************************************************
***************************/
470
471 Make_preamble:
472
7945 [03] 45FB86 473 ldhx #Preamble ; Constant
7948 [04] 3597 474 sthx Tx_byte
794A [04] 81 475 rts
476
477 ;/**************************************************
***************************/
478 ;/* Make_device_ID
*/
479 ;/* Description : it reads the device ID & stores
it in Tx_byte */
480 ;/* In : Device_ID in flash
main.asm Assembled with CASM08Z 3/18/2003 3:17:52 PM PAGE 12
*/
481 ;/* Out : Tx_byte+2,3,4,5
*/
482 ;/* local variables :
*/
483 ;/**************************************************
***************************/
484
485 Make_device_ID:
486
794B [04] C67800 487 lda Device_ID
794E [03] B799 488 sta Tx_byte+2
7950 [04] C67801 489 lda Device_ID+1
7953 [03] B79A 490 sta Tx_byte+3
7955 [04] C67802 491 lda Device_ID+2
7958 [03] B79B 492 sta Tx_byte+4
795A [04] C67803 493 lda Device_ID+3
795D [03] B79C 494 sta Tx_byte+5
795F [04] 81 495 rts
496
497 ;/**************************************************
***************************/
498 ;/* Make_daytona_data
*/
499 ;/* Description : it stores Daytona data in Tx_byte
*/
500 ;/* In : daytona_output
*/
501 ;/* Out : Tx_byte+6,7
*/
502 ;/* local variables :
*/
503 ;/**************************************************
***************************/
504
505 Make_daytona_data:
506
7960 [03] B6B1 507 lda PRESSURE
7962 [03] B79D 508 sta Tx_byte+6
7964 [03] B6B0 509 lda TEMPERATURE
7966 [03] B79E 510 sta Tx_byte+7
7968 [04] 81 511 rts
512
513 ;/**************************************************
***************************/
514 ;/* Make_status_byte
*/
515 ;/* Description : Places the status byte in the
right place in the frame. */
516 ;/* In : parity
*/
517 ;/* Out : Tx_byte+8
*/
518 ;/* local variables :
*/
519 ;/**************************************************
***************************/
520
main.asm Assembled with CASM08Z 3/18/2003 3:17:52 PM PAGE 13
521 Make_status_byte:
522
7969 [03] B6B3 523 lda STATUS
796B [03] B79F 524 sta Tx_byte+8
796D [04] 81 525 rts
526
527 ;/**************************************************
***************************/
528 ;/* calculate_checksum
*/
529 ;/* Description : stores checksum data in Tx_byte.
Checksum is calculated */
530 ;/* by two's complementing the sum of the
following data: */
531 ;/* ID1, ID2, ID3, PRESSURE, TEMPERATURE
*/
532 ;/* such that the sum of these and the checksum
is zero. */
533 ;/* In : frame in Tx_byte
*/
534 ;/* Out : Tx_byte+9
*/
535 ;/* local variables :
*/
536 ;/**************************************************
***************************/
537
538 Calculate_Checksum:
796E [03] 450099 539 ldhx #Tx_byte+2 ; Preamble ($FFF6)
is not included
7971 [02] A607 540 lda #nb_tx_byte-4 ; Nor are the
checksum or junk bytes
7973 [03] B7A7 541 sta Chk_count
7975 [01] 4F 542 clra
543 Calculate_chk_next:
7976 [02] FB 544 add ,x
7977 [01] 5C 545 incx
7978 [05] 3BA7FB 546 dbnz Chk_count,Calculate_chk_next
547 ; repeat for each
byte of the frame
797B [01] 40 548 nega
797C [03] B7A0 549 sta Tx_byte+!9 ; store calculated
checksum
550
551
797E [04] 81 552 rts
553
554 ;/**************************************************
***************************/
555 ;/* Make_frame
*/
556 ;/* Description : it makes the frame to be transmitt
ed */
557 ;/* Preamble (2 bytes)
*/
558 ;/* Device ID (4 bytes)
*/
559 ;/* Daytona data (2 bytes)
main.asm Assembled with CASM08Z 3/18/2003 3:17:52 PM PAGE 14
*/
560 ;/* Checksum (1 byte)
*/
561 ;/* Junk (1 byte)
*/
562 ;/* In : Daytona output, Status info, Preamble + ID
in flash */
563 ;/* Out : Tx_byte data frame
*/
564 ;/* local variables :
*/
565 ;/**************************************************
***************************/
566
567 Make_frame:
797F [05] CD7945 568 jsr Make_preamble
7982 [05] CD794B 569 jsr Make_device_ID
7985 [05] CD7960 570 jsr Make_daytona_data
7988 [05] CD7969 571 jsr Make_status_byte
798B [05] CD796E 572 jsr Calculate_Checksum
573
574 ; This is a useless
byte, which is there only because it
798E [03] B7A1 575 sta Tx_byte+!10 ; will be corrupted
by the 33592 romeo receiver instead of
576 ; the real data.
7990 [04] 81 577 rts
7991 578 $Include 'check_battery.asm'
579 ;/* LVI status check routine */
580 ;/* V0.1 17 July, 2002 Jeff Burgess */
581 ;/* Called with: jsr SEND_BYTE */
582 ;/* Returns: STATUS[7,6] containing the data */
583 ;/* from LVISR[7,5] respectively. */
584 ;/* (c) 2002 Motorola */
585
586 Check_battery:
7991 [02] 87 587 psha
7992 [04] C6FE0F 588 lda LVISR
7995 [03] B7A9 589 sta T3
7997 [05] 0BA902 590 brclr LOWV,T3,Chk_dead
799A [04] 1CB3 591 bset 6,STATUS
592
593 Chk_dead:
799C [05] 0FA902 594 brclr LVIOUT,T3,Not_dead
799F [04] 1EB3 595 bset LVIOUT,STATUS
596
597 Not_dead:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -