📄 pwm_01int.lst
字号:
472 00EB ECO_TR: equ 0EBh ; External Oscillator Trim Register (W)
473
474 00FA FLS_PR1: equ 0FAh ; Flash Program Register 1 (RW)
475 0003 FLS_PR1_BANK: equ 03h ; MASK: Select Active Flash Bank
476
477 00FD DAC_CR: equ 0FDh ; Analog Mux DAC Control Register
478 0008 DAC_CR_IRANGE: equ 08h ; MASK: Sets the DAC Range low or high
479 0006 DAC_CR_OSCMODE: equ 06h ; MASK: Defines the reset mode for AMux
480 0001 DAC_CR_ENABLE: equ 01h ; MASK: Enable/Disable DAC function
481
482 ;;=============================================================================
483 ;; M8C System Macros
484 ;; These macros should be used when their functions are needed.
485 ;;=============================================================================
486
487 ;----------------------------------------------------
488 ; Swapping Register Banks
489 ;----------------------------------------------------
490 macro M8C_SetBank0
491 and F, ~FLAG_XIO_MASK
492 1C5C endm
493
494 macro M8C_SetBank1
495 or F, FLAG_XIO_MASK
496 1C5C endm
497
498 ;----------------------------------------------------
499 ; Global Interrupt Enable/Disable
500 ;----------------------------------------------------
501 macro M8C_EnableGInt
502 or F, FLAG_GLOBAL_IE
503 1C5C endm
504
505 macro M8C_DisableGInt
506 and F, ~FLAG_GLOBAL_IE
507 1C5C endm
508
509 ;----------------------------------------------------
510 ; Enable/Disable Interrupt Mask
511 ;
512 ; Use the following macros to enable/disable
513 ; bits in the Interrupt mask registers,
514 ; INT_MSK0, INT_MSK1 or INT_MSK3.
515 ;
516 ; Usage: M8C_DisableIntMask INT_MSKN, MASK
517 ; M8C_EnableIntMask INT_MSKN, MASK
518 ;
519 ; where INT_MSKN is INT_MSK0, INT_MSK1 or INT_MSK3
520 ; and MASK is the bit set to enable or disable
521 ;----------------------------------------------------
522 ; Disable Interrupt Bit Mask(s)
523 macro M8C_DisableIntMask
524 and reg[@0], ~@1 ; disable specified interrupt enable bit
525 1C5C endm
526
527 ; Enable Interrupt Bit Mask(s)
528 macro M8C_EnableIntMask
529 or reg[@0], @1 ; enable specified interrupt enable bit
530 1C5C endm
531
532 ;----------------------------------------------------
533 ; Clear Posted Interrupt Flag Mask
534 ;
535 ; Use the following macros to clear the
536 ; bits in the Interrupt Clear registers,
537 ; INT_CLR0, INT_CLR1 or INT_CLR3.
538 ; Usage: M8C_ClearIntFlag INT_CLRN, MASK
539 ;
540 ; where INT_MSKN is INT_CLR0, INT_CLR1 or INT_CLR3
541 ; and MASK is the bit set to enable or disable
542 ;----------------------------------------------------
543 macro M8C_ClearIntFlag
544 mov reg[@0], ~@1 ; clear specified interrupt enable bit
545 1C5C endm
546
547 ;----------------------------------------------------
548 ; Power-On Reset & WatchDog Timer Functions
549 ;----------------------------------------------------
550 macro M8C_EnableWatchDog
551 and reg[CPU_SCR0], ~CPU_SCR0_PORS_MASK
552 1C5C endm
553
554 macro M8C_ClearWDT
555 mov reg[RES_WDT], 00h
556 1C5C endm
557
558 macro M8C_ClearWDTAndSleep
559 mov reg[RES_WDT], 38h
560 1C5C endm
561
562 ;----------------------------------------------------
563 ; Sleep, CPU Stop & Software Reset
564 ;----------------------------------------------------
565 macro M8C_Sleep
566 or reg[CPU_SCR0], CPU_SCR0_SLEEP_MASK
567 ; The next instruction to be executed depends on the state of the
568 ; various interrupt enable bits. If some interrupts are enabled
569 ; and the global interrupts are disabled, the next instruction will
570 ; be the one that follows the invocation of this macro. If global
571 ; interrupts are also enabled then the next instruction will be
572 ; from the interrupt vector table. If no interrupts are enabled
573 ; then the CPU sleeps forever.
574 1C5C endm
575
576 macro M8C_Stop
577 ; In general, you probably don't want to do this, but here's how:
578 or reg[CPU_SCR0], CPU_SCR0_STOP_MASK
579 ; Next instruction to be executed is located in the interrupt
580 ; vector table entry for Power-On Reset.
581 1C5C endm
582
583 macro M8C_Reset
584 ; Restore CPU to the power-on reset state.
585 mov A, 0
586 SSC
587 ; Next non-supervisor instruction will be at interrupt vector 0.
588 1C5C endm
589
590 ;----------------------------------------------------
591 ; ImageCraft Code Compressor Actions
592 ;----------------------------------------------------
593 ; Suspend Code Compressor
594 ; Must not span a RET or RETI instruction
595 ; without resuming code compression
596 macro Suspend_CodeCompressor
597 or F, 0
598 1C5C endm
599
600 ; Resume Code Compression
601 macro Resume_CodeCompressor
602 add SP, 0
603 1C5C endm
604
605 ; end of file m8c.inc
32 00C0 FLAG_PGMODE_MASK: equ 0C0h ; Paging control for > 256 bytes of RAM
33 0000 FLAG_PGMODE_0: equ 00h ; Direct to Page 0, indexed to Page 0
34 0040 FLAG_PGMODE_1: equ 40h ; Direct to Page 0, indexed to STK_PP page
35 0080 FLAG_PGMODE_2: equ 80h ; Direct to CUR_PP page, indexed to IDX_PP page
36 00C0 FLAG_PGMODE_3: equ 0C0h ; Direct to CUR_PP page, indexed to STK_PP page
37 0000 FLAG_PGMODE_00b: equ 00h ; Same as PGMODE_0
38 0040 FLAG_PGMODE_01b: equ 40h ; Same as PGMODE_1
39 0080 FLAG_PGMODE_10b: equ 80h ; Same as PGMODE_2
40 00C0 FLAG_PGMODE_11b: equ 0C0h ; Same as PGMODE_3
41 0010 FLAG_XIO_MASK: equ 10h ; I/O Bank select for register space
42 0008 FLAG_SUPER: equ 08h ; Supervisor Mode
43 0004 FLAG_CARRY: equ 04h ; Carry Condition Flag
44 0002 FLAG_ZERO: equ 02h ; Zero Condition Flag
45 0001 FLAG_GLOBAL_IE: equ 01h ; Glogal Interrupt Enable
46
47
48 ;;=============================================================================
49 ;; Register Space, Bank 0
50 ;;=============================================================================
51
52 ;------------------------------------------------
53 ; Port Registers
54 ; Note: Also see this address range in Bank 1.
55 ;------------------------------------------------
56 ; Port 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -