1997 微芯 技术 公司
初步的
ds30264a-页 37
PIC17C75X
例子 6-1: 节省 状态 和 wreg 在 内存 (简单的)
; 这 地址 那 是 使用 至 store 这 cpusta 和 wreg 值 必须 是 在 这 数据 记忆
; 地址 范围 的 1ah - 1fh. 向上 至 6 locations 能 是 saved 和 restored 使用 这 movfp
; 操作指南. 这个 操作指南 neither affects 这 状态 位, 也不 corrupts 这 wreg 寄存器.
;
unbank1 equ 0x01a ; 地址 为 1st location 至 保存
unbank2 equ 0x01b ; 地址 为 2nd location 至 保存
unbank3 equ 0x01c ; 地址 为 3rd location 至 保存
unbank4 equ 0x01d ; 地址 为 4th location 至 保存
unbank5 equ 0x01e ; 地址 为 5th location 至 保存
; (label 不 使用 在 程序)
unbank6 equ 0x01f ; 地址 为 6th location 至 保存
; (label 不 使用 在 程序)
;
: ; 在 中断 vector 地址
推 movfp alusta, unbank1 ; 推 alusta 值
movfp bsr, unbank2 ; 推 bsr 值
movfp wreg, unbank3 ; 推 wreg 值
movfp pclath, unbank4 ; 推 pclath 值
;
: ; 中断 维护 routine (isr) 代号
;
流行音乐 movfp unbank4, pclath ; restore pclath 值
movfp unbank3, wreg ; restore wreg 值
movfp unbank2, bsr ; restore bsr 值
movfp unbank1, alusta ; restore alusta 值
;
retfie ; 返回 从 中断 (使能 中断)