1

I am writing an assembly program, assembling it and replacing the kernel.img file on a SD card with raspbian installed on it. Will the memory address of the first instruction be zero? Either because the kernel.img file is the first thing loaded into memory (but this seems unlikely), or because the CPU will translate memory addresses relative to the start of the program into the real memory addresses?

Or will the first memory address be arbitrary?

I ask because if I have some data 4 bytes into the program, will the address of that data be 4 or will it be "address of the start of the program" + 4?

(I know I could use a label to reference the start of the data, but please assume I can't)

  • Do you need anything else in the card besides the booting code? – Marco Poli Jun 15 '14 at 14:12
  • What do you mean? the assembly I'm writing is simple flash an LED on and off so I don't load anything external to the one assembly files have – Jonathan. Jun 15 '14 at 14:14
  • Did you read this thread about how the boot process works? – Marco Poli Jun 15 '14 at 14:21
  • I just have, and it seems one of the posts says the kernel.img is loaded in at address 0, but another post says something about the addresses starting at 0x8000? – Jonathan. Jun 15 '14 at 14:25
  • Did you notice the github project with a bunch of examples of low level programs and particularly the main README file? That's probably the best take-off from that discussion. :) – Marco Poli Jun 15 '14 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.