I have C Code that I am converting to arm assembly on a Raspberry Pi 3
How would I pass in a bmp image into a register to be used for reading, before branching into fopen of a file?
C Code that I am converting -
char ifile[80] = "rainbow2.bmp";
char ofile[80] = "rainbow_out.bmp";
FILE *fpin, *fpout;
fpin = fopen(ifile, "rb");
fpout = fopen(ofile, "wb");
I was thinking something similar to this
mov r0, ifile @ r0 = rainbow2.bmp
mov r1, rb @ r1 = read ?
bl fopen @ fopen returns in r0/r1/fpin?
mov r4, r0 @ r4 = fpin
mov r0, ofile @ r0 = output file rainbow_out.bmp
mov r1, wb @ r1 = write ?
bl fopen @ fopen returns *fp?
mov r5, r0 @ r5 = fpout
I think the values ifile/ofile,rb/wb are wrong. I am unsure of what I need to pass into the registers for opening a bmp image in the same folder?