سؤال

I have a binary file codes.bin that I want to 'include' in my NASM assembly program's .data segment.

I know I can hexdump the binary and add it as initialized data in the usual way by copying and pasting, but I was hoping there was a better way

هل كانت مفيدة؟

المحلول

Ah, I was looking for the incbin pseudo-instruction. I should have RTM

Here is a sample code:

incbin 'file.bin'

نصائح أخرى

For do that you can use this syntax:

incbin "codes.bin"
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top