[cc65] Read bytes (program load address) from a file?

From: Raj Wurttemberg <rajw1c64.us>
Date: 2006-09-26 00:17:31
 
Hi All,
 
I'm trying to write a simple program to read the load address of a C64
program. I tried the cbm_read function but the wrong bytes come up. Is there
another function I should use?

I'm still learning C... so I'm sure I've done something wrong. I know there
is no error checking. :) (code below)

Thanks,
/*Raj*/

---------------------------------------

#include <cbm.h>
#include <stdio.h>

int main()
{
  unsigned char device = 8;
  unsigned char s, b ;
  unsigned char buff[2];

    s = cbm_open(15, device, 15, "name");

    printf("\ncommand: open15,%d,15 staus: %d\n", device, s);

    b = cbm_read(15, &buff, 2);

	printf("\nbytes read: %d\n", b);
	printf("\ndata read: %d %d\n", buff[0], buff[1]);

	cbm_close(15);
	return(0);

}

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Sep 26 00:17:16 2006

This archive was generated by hypermail 2.1.8 : 2006-09-26 00:17:19 CEST