jj2.asm

来自「C语言和汇编语言的相互调用实现一定运算功能」· 汇编 代码 · 共 121 行

ASM
121
字号

	.mmregs             ; 将存储器影射寄存器存入符表
    .global _and
    .global _or
    .global _xor
    .global _not
    .global _function
	.global _d          ; 定义为外部变量
	.bss _d,1           ; 定义变量d
	.global _c
	.bss _c,1	
	.global _gvar          ;定义为外部变量
	.bss _gvar,1           ; 定义变量d
	.global _test_and          
	.bss _test_and,1
	.global _test_or          
	.bss _test_or,1           
	.global _test_xor          
	.bss _test_xor,1
	.global _test_not          
	.bss _test_not,1
	.global _test_function
	.bss _test_function,1	
	.text 
		

_and:
        AND *(_d),A
        nop
        nop
        nop
        nop
        stl A,*(_test_and)
        nop
        nop
        nop
        nop
        nop
        nop
        ret
_or:
        OR *(_d),A
        nop
        nop
        nop
        nop
        nop
        stl A,*(_test_or)
        nop
        nop
        nop
        nop
        nop
        nop
        ret
        
_xor:  
        XOR *(_d),A
        nop
        nop
        nop
        nop
        nop
        stl A,*(_test_xor)
        nop
        nop
        nop
        nop
        nop
        nop
        ret
                                                   
_not:  
       CMPL A
       nop
       nop
       nop
       nop
       nop
       stl A,*(_test_not)
       nop
       nop
       nop
        nop
        nop
        nop
        ret
_function:
       ADD A,*(_b)
       nop
       nop
       nop
       nop
       CMPL B
       nop
       nop
       nop
       nop
       AND  *(_c),A
       nop
       nop
       nop
       nop
       XOR A,B
       nop
       nop
       nop
       nop
       STL B,*(_test_function)
       nop
       nop
       nop
       nop
       nop
       nop
       ret

             
         
       .end                 ;结束程序
		

⌨️ 快捷键说明

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