Re: char=int





bvermeersch@xxxxxxxxx wrote:

> Hello,
>
> I found this in some else's code:
> ...
> void write_E2(unsigned int address, unsigned char data)
> {
> EEADR = address;
> EEADRH = (address >> 8);
> //The EEADRH:EEADR register pair is used to address
> //the data EEPROM for read and write operations.
> //EEADRH holds the two MSbits of the address; the
> //upper 6 bits are ignored. The 10-bit range of the pair
> //can address a memory range of 1024 bytes (00h to
> //3FFh).
> ...
> Is this a correct way of doing if you know:
> ...
> extern volatile near unsigned char EEADR;
> ...
>
> This means putting an int into a char.
> will it choose the right byte, where can i find info about this?
>
> Kind regards, Jef

No

AChar = (char)AnInt; // It is called a "Cast"

The code you have says it writes to an EEPROM (Memory chip)


.



Relevant Pages

  • [2.6 patch] i2c/busses/ : make some code static
    ... -unsigned int amd_ec_write(struct amd_smbus *smbus, unsigned char address, unsigned char data) ... +static unsigned int amd_ec_write(struct amd_smbus *smbus, unsigned char address, unsigned char data) ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: [PATCH] I2C update for 2.6.10-rc1
    ... -unsigned int amd_ec_write(struct amd_smbus *smbus, unsigned char address, unsigned char data) ... +static unsigned int amd_ec_write(struct amd_smbus *smbus, unsigned char address, unsigned char data) ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • [NT] Ipswitch Instant Messaging Multiple Vulnerabilities
    ... unsigned char key) ... des_crypt_ecb(ctx, output, output); ... int tcp_recv(int sd, u8 *buff, int len); ...
    (Securiteam)
  • [Full-disclosure] Some small noday XD
    ... Microsoft Windows tcpip.sys IGMP local stack buffer overrun ... unsigned char tos; // Type of service ... unsigned int destIP; // Destination IP ...
    (Full-Disclosure)
  • Re: [Winbond] flash memory reader SCSI device drivers [headers]
    ... u16 physical_address; ... unsigned char registers; ... unsigned int page_pre_block; ... static int wbmspro_read_attribute(unsigned int page_address, ...
    (Linux-Kernel)