Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DMA: strlen #7

Open
suzukiplan opened this issue Dec 29, 2023 · 2 comments
Open

DMA: strlen #7

suzukiplan opened this issue Dec 29, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@suzukiplan
Copy link
Owner

strlen相当のDMAが必要かもしれない。

メモリの特定番地から特定の値(8bit)を探索するもの

input:

  • A : 探索コード(strlen なら 0x00)
  • HL: 探索アドレス(RAMでもROMでもVRAMでも)

output:

  • HL: 見つかったアドレスに更新される
  • Z flag: 0 = not found, 1 = found
@suzukiplan suzukiplan added enhancement New feature or request WIP labels Dec 29, 2023
@suzukiplan
Copy link
Owner Author

長さがわかった方が良いかも?

LD HL, 0x9000   # 探索元アドレス
LD A, 0x00      # 探索値(文字終端コードなど)
IN A, (0xC4)    # strlen
JZ NOT_FOUND    # 0 = not found, 1 = found

# BC = 発見アドレス
# DE = BC - HL (strlen の戻り値に相当)

@suzukiplan suzukiplan removed the WIP label Dec 31, 2023
@suzukiplan
Copy link
Owner Author

とりあえず、使いどころが出てきたら実装する方向で(WIP対応を必須とはしない)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant