[問題] 如何在C中使用asm label
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
TC
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
想要在C中寫ASM, 但是用到label時出現"Undefined label"的訊息,
請問該如何在C中使用asm的label呢?
餵入的資料(Input):
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
程式碼(Code):(請善用置底文網頁, 記得排版)
void func(word port)
{
asm{
push ax
push dx
push cx
start:
mov al, 0
mov dx, port
loop1:
out dx, al
in al, dx
inc al
cmp al, 0
jne loop1
mov cx, 0
mov al, 0FFh
loop2:
out dx, al
inc cx
cmp cx, 0
jne loop2
jmp start
pop cx
pop dx
pop ax
}
return ;
}
補充說明(Supplement):
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.210.106.78
推
04/24 13:52, , 1F
04/24 13:52, 1F
→
04/25 23:07, , 2F
04/25 23:07, 2F
→
04/30 13:03, , 3F
04/30 13:03, 3F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章