📄 putvector.dsp
字号:
/* PUT Interrupt Vector Subroutine
INPUTS: MR0 = desired vector
I4 = address where desired vector will go
DMPG2 must be equal to zero
destroyed registers: ar, af, ax0, ay0, SR, PX */
.section/pm seg_pmcode;
.global PUT_VECTOR;
PUT_VECTOR: // dis int; // disable interrupts
ar = I4;
ar = mr0 - ar; // calculate offset for jump instruction
sr=LSHIFT ar BY 2 (LO); // SR0 contains 14 bits in [15:2] and SR1 contains 2 MSBs of vector in [1:0]
ax0 = sr1;
sr = LSHIFT sr0 by 10 (LO); // SR0 contains 4 bits in [15:12], SR1 contains 10 Bits of vector in [9:0], ax0 contains 2MSBs
ay0= 0x1C00; // opcode bits for PC relative jump
af = sr1 or ay0; // af contains upper 16 bits of instruction word
sr = LSHIFT sr0 by -8 (LO); // sr0 contains 4 bits in [7:4]
ar = sr0 or ax0;
PX=ar; // Now PX contains 8 LSBs of instruction word
ar = pass af;
PM(I4,M4)=ar; // replaces instruction at I4
// ena int; // enable interrupts
RTS;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -