⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 thresholdtrans.asm

📁 DSP学习讲座
💻 ASM
字号:

k_threshold  .set 128;设定域值
k_white      .set 255
k_black      .set 0
             .data
output       .space 0x10000;分配输出空间
input        .copy Lenna;拷贝图像数据
bos          .usect"stack",8
             .text
             .def thres_int
             .def end
             .def thresholdtrans
thres_int:        
             mvk  k_threshold,a2
             mvk  k_white,a3
             mvk  k_black,a4
             mvkl input,b2
             mvkh input,b2
             mvkl output,b3
             mvkh output,b3
             mvkl 65535,b0
             mvkh 65535,b0
thresholdtrans:  
             ldbu *b2++,a5
             nop  
             nop
             nop
             nop
             nop
             ;cmpgtu a5,a2,a6
             cmpltu a5,a2,a6;灰度变换
             mpyu a6,a3,a7
             nop
             stb  a7,*b3++ 
             sub  b0,1,b0            
         [b0]b    thresholdtrans
             nop  
             nop
             nop
             nop
             nop
end:         b    end
             nop 5
             .end
             
        

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -