assembly - pdp-11 上的时钟

标签 assembly pdp-11

我对我写的简单程序有点困惑,你可以吗? 请解释为什么它只打印一个字符后就退出,我预料到了 每 5 秒打印一次字符,提前致谢

tks = 177560
tkb = 177562
tps = 177564
tpb = 177566
lcs = 177546
. = torg + 2000

main:   mov #main, sp

        mov #clock, @#100  ; vector interrupt of the clock 100-102
        mov #300, @#102    ; 

        mov #100, @#lcs    ; here I enable interrupt-enable of the clock

prog:   clr r0             ; here endless loop
        beq prog
        halt

clock:  inc count
        cmp count, timeout
        bne clk_end
        clr count
        mov #'*, @#tpb
clk_end:rti

. = torg + 3000
timeout: .word 300000
count: .word 0

最佳答案

这肯定是一个与模拟器相关的问题,因为我尝试运行你的代码,并且它工作正常!

您是以色列理工学院的学生吗?

关于assembly - pdp-11 上的时钟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3087618/

相关文章:

c - x86_64 ASM - 指令的最大字节数?

assembly leal 和 movl 的区别

c - 内存栅栏如何工作?

assembly - 在32位保护模式下使用变量偏移文本

assembly - 无法在 NASM 中打印数字

c - 汇编中的子程序

assembly - pdp-11 打印机