簡體   English   中英

如果在 68k 中聲明,我該怎么做

[英]How can i do this if statement in 68k

在我的程序中,我輸入一個選項,如果輸入等於 1,我想做 d+1。 我查看了 EQ 條件語法,但無法理解它。 偽代碼:

if choice=1 do d+1

我做了什么:

 INPUT_FUNCTION:    
     MOVE.B #4,D0
     TRAP #15

所有結構化語句都使用 if-goto-label 樣式轉換為匯編。

對於 if 語句,條件 goto (if-goto) 用於在您不想做時跳過您不想做的事情,否則執行 then 部分。

    if choice != 1 goto endif1;
    d+1
endif1:

這個 if-goto 很容易翻譯成匯編:

    CMP.L #1,D1      is D1.L == 1 ?  (set flags with compare result)
    BNE endif1       no? then skip ahead to label endif1 (test flags)
    ...
    d+1
    ...
endif1

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM