1

もう一度やりますが、今回は近いです。6502 チップでの作業。

アセンブリプリントバッファのプログラムを書いています。

私が抱えている 1 つの問題は、文字列が null かどうかを確認することです。

これまでの私のコードは次のとおりです:(人間が読める)

buffer = $03ff
x = $01

[START]: $0500

    LDX buffer      // load buffer (at safe memory address $03ff)
    LDY #$00        // loading the y register with 0 so that you can count up
                // checking for a null string; if null, branch to the break instruction
LOOP:   LDA buffer+1, y     // get byte using the buffer
    STA (x), y  // store the value at the pointer
    INY         // increment y
    DEX         // decrement x (counting down with the x register)
    BEQ $500?       // if x is equal to 0, program is done
    BNE LOOP:       // if x is not equal to 0, keep going
    BRK             // if brk, it’s null

文字列が null かどうかを確認するにはどうすればよいですか?

ありがとう!

4

2 に答える 2