📄 swap.s
字号:
; swap.s: assembly "swap" function for Bubble Sort example: 68K target.;; Equivalent C code:;; void swap (int array[]); {; int temp = array[0];; array[0] = array[1];; array[1] = temp;; } .name "swap.s" .section .text2,,c ; Locate the code in the ".text2" section. .align 4 .xdef _swap_swap: link a6,#-0 ; Maintain stack frame for debugging. move.l 8(a6),a0 ; address of "array" to a0 move.l (a0),d0 ; "array[0]" to d0 ("temp") move.l 4(a0),(a0) ; "array[1]" to "array[0]" move.l d0,4(a0) ; d0 ("temp") to "array[1]" unlk a6 ; Match for "link" above. rts
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -