Emacs尝试在汇编中注释时的怪异

Emacs尝试在汇编中注释时的怪异,emacs,nasm,Emacs,Nasm,假设我有一个这样的代码块: ;; outut mov eax, 4 mov ebx, 1 ; stdout mov ecx, [ans] ; move biggest element to accumulator add ecx, 30h ; convert to ascii representation mov [buff], ecx ; move to memory mov ecx, buff ; put p

假设我有一个这样的代码块:

;;  outut
mov eax, 4          
mov ebx, 1          ; stdout
mov ecx, [ans]      ; move biggest element to accumulator
add ecx, 30h        ; convert to ascii representation
mov [buff], ecx     ; move to memory
mov ecx, buff       ; put pointer in ecx for printing
mov edx, 4          ; size, 4 bytes
int 80h             ; system call.
当我尝试在前面添加注释以注释出一行时:

;;  outut
;mov eax, 4          
mov ebx, 1          ; stdout
mov ecx, [ans]      ; move biggest element to accumulator
add ecx, 30h        ; convert to ascii representation
mov [buff], ecx     ; move to memory
mov ecx, buff       ; put pointer in ecx for printing
mov edx, 4          ; size, 4 bytes
int 80h             ; system call.
它不是出现在我想要它去的地方,而是跳到这里:

;;  outut
mov eax, 4          ;
mov ebx, 1          ; stdout
mov ecx, [ans]      ; move biggest element to accumulator
add ecx, 30h        ; convert to ascii representation
mov [buff], ecx     ; move to memory
mov ecx, buff       ; put pointer in ecx for printing
mov edx, 4          ; size, 4 bytes
int 80h             ; system call.
无论我做什么,我都无法对任何事情做出评论

我怎样才能解决这个问题?它不记得它总是这样做,所以我觉得我一定是按了一些组合键,然后它就发生了;在汇编模式下绑定到asm注释。您可以使用C-q进行带引号的插入;根据具体情况,或移除绑定并仅使用M-;评论dwim,供爱好者评论。如果你想做后者,设置;在本地执行自插入命令:

(defun my-hook ()
  (local-set-key ";" 'self-insert-command))

(add-hook 'asm-mode-hook 'my-hook)
);在汇编模式下绑定到asm注释。您可以使用C-q进行带引号的插入;根据具体情况,或移除绑定并仅使用M-;评论dwim,供爱好者评论。如果你想做后者,设置;在本地执行自插入命令:

(defun my-hook ()
  (local-set-key ";" 'self-insert-command))

(add-hook 'asm-mode-hook 'my-hook)

我在学校的服务器上做汇编nasm的工作,所以我认为我不能定义自己的命令,或者我可以这样做吗?你可以把上面的代码放在你的.emacs文件中,或者在scratch缓冲区中计算它。如果所有其他操作都失败,在nasm缓冲区中,点击M-:调用eval表达式并输入local set key;'自我插入命令。M-:?是ALT+:?是的,没错。M是指meta键,实际上是普通非Mac键盘上的alt键。我在学校的服务器上组装nasm,所以我认为我不能定义自己的命令,或者我能做到吗?你可以将上述代码放在.emacs文件中,或者在临时缓冲区中对其进行计算。如果所有其他操作都失败,在nasm缓冲区中,点击M-:调用eval表达式并输入local set key;'自我插入命令。M-:?是ALT+:?是的,没错。M指元键,实际上是普通非Mac键盘上的alt键。