Programming :: Byte At Memory Location 45 With Immediate Value 03

Jul 10, 2011

As 2.17
I want to code this:
and byte[45],03

In words, AND the byte at memory location 45 with immediate value 03. As reports "Ambiguous operand size for and". How could I code the instruction such that as understands my intention?

john: .byte 45
and byte[john],03
gives the same error.

View 8 Replies


ADVERTISEMENT

Programming :: Memcpy Fails To Copy Data / But Byte By Byte Assignment Work

Jul 6, 2011

I got across a peculiar problem with memcpy.History:writing a code which do flash/Read functionality for SPI Parts.

Implementation:
1.memory map the Flash chip registers to userspace. - fine
2.Issue block read command
3.Just print the data I got, using the memory mapped address - fine I got the correct data.
4.Copy the data to a local buffer from memory mapped address using memcpy - FAIL

UPDATE:
on SUSE 11.3 -32 bit the above code worked perfectly, but on SUSE 11.4 - 64bit , Ubantu, Fedora it failed.
I am using gcc compiler obviously. I am using i386/x86_64 OS. Processor: Intel core 2 duo, SNB after step 4 , when I dump the data from local buffer every thing is FF.But step 4, if i implement byte by byte copy using assignment operator, it worked.is there any known bug with memcpy? am I missing anything?

View 7 Replies View Related

Programming :: Write A Value From A Specific Memory Location In C?

Jul 13, 2010

How to write a value to a specific memory location in C language and how to access the same value ?
I am trying the same on fedora linux and i am trying to write the value to the 32-bit address.

View 2 Replies View Related

Networking :: Write Network Packets To Memory In Byte Format?

Feb 7, 2011

I'm sniffing network packets in ubuntu, I need to write these packets as raw bytes to memory but libpcap give packets in its special format. how can i save and recover packets in byte format?

View 2 Replies View Related

Programming :: Convert Gigabyte To Byte?

Nov 24, 2010

I'm learning C and trying to write a program to convert gigabyte into byte. It will take 50% of the value given and then convert that value into byte. But the problem is the output goes into minus / negative value. Like, if I enter 22, I get output: -2147483648.

Code:

#include <stdio.h>
#include <math.h>
main (int argc, char* argv[])
{

[Code]....

View 5 Replies View Related

Programming :: Calculate The Number Of - Necessary - Bits In A Byte ?

Jun 11, 2010

E.g. 98 is represented as 1100010 (number of valid bits is 7)

What is the formula to calculate the number of valid bits in a byte ?

View 14 Replies View Related

Programming :: C Function To Reverse The Byte Order In A Double?

Aug 12, 2010

I'm trying to write an extension to PHP which means coding in C. I'm really really rusty at C coding and was never very good at it.

Can anyone propose an efficient, safe, and [hopefully] future-proof way of reversing a double? Keep in mind that it should work on as many systems as possible and on 32- and 64-bit systems (and on ???-bit systems in the future?). Will the size of a 'double' ever change or will it always be 8 bytes?

I've tried this and it doesn't work...the compiler complains about "invalid operands to binary" because I'm trying bitwise shiftw on a non-integer.

Code:
x = (x>>56) |
((x<<40) & 0x00FF000000000000) |
((x<<24) & 0x0000FF0000000000) |
((x<<8) & 0x000000FF00000000) |

[Code]....

View 3 Replies View Related

Programming :: How To Convert Negative Integer To Byte Array?

Oct 26, 2010

I need to convert an integer to a byte array of size 2 and vice versa. The code shown below works well for positive values but not for negative values. Also, using an array of size four makes the conversion works. However, I am limited to an array of size 2.

View 5 Replies View Related

Programming :: Traverse Byte Array In Assembly Using Nasm As Assembler?

Jun 16, 2010

I am trying to learn assembly using nasm as assembler. I did not found example related to string operation. I had following example code,

global asm_strlen
section .data
section .bss
section .text

[code].....

my problem is at highlighted line, I am not getting how to copy a byte into 4 byte reg. rather what is syntax of mov instruction to mov byte to WORD DWORD etc.

View 3 Replies View Related

Debian Programming :: How To Find Total Size Of A List Object In Byte

Jan 11, 2013

Assuming there are two list objects a1, a2.

a1 = ['
']
a2 =['hi
']

len() built-in function gives total number of elements in the list object.
len(a1) gives 1. len(a2) gives 1 also.

Code: Select all$ python
Python 2.7.3 (default, SepĀ  9 2012, 17:41:34)
[GCC 4.7.1] on linux2

[Code]......

I thought there exists a built-in function that gives total size of a list object in byte. So using the function produces 1 for a1, 3 for a2. I haven't found such function or module yet.

View 3 Replies View Related

Programming :: Serial Port Communication Program Always Lose One Byte Data: 0x00?

Dec 13, 2009

I wrote a serial port communication program to access a equipment.

int main(void)
{
int fd = 0;
int nread = 0,i = 0,nwrite = 0, tmpread = 0, m = 0, n = 0 ;

[code]....

View 2 Replies View Related

Security :: Change The Sys_call_address To Another Location In Memory?

Jan 4, 2010

Quote:

alexander@osiris:~$ uname -a
Linux osiris 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686 GNU/Linux

I tried to change the sys_call_address to another location in memory. The result was an OOPS!

sys_call_address is of course not exported, so I found it using:

Quote:

grep sys_call_table /boot/System.map-2.6.31-14-generic
c0577150 R sys_call_table

My kernel prog looks like:

Code:
#include <linux/string.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <linux/module.h>

[Code].....

View 5 Replies View Related

Software :: Writing Data Into A Memory Location?

Feb 1, 2010

I am using ARM9(S3C2440) board in which linux kernel 2.6.30.4 is ported and i need to write some 8-bit data(say 0xAA) into the memory location 0x08000000 and i need to trace the data written into the location is correct or not how to do this in linux.

View 3 Replies View Related

Ubuntu :: VBOX Setup Location & Memory Settings?

Jan 5, 2010

I have a few questions about VBOX.

My system now is a dual boot computer with Ubuntu and Winxp each on there own HD. The system has 4gb memory with a 512mb Nvidia video card.

1. If I understand it correctly, VBOX installs it's own copy of Windows to a directory. I can't piont it to the Winxp that I already have installed on the other HD?

2. VBOX has a two sliders for Memory, one for System and the other for Video. Do any of you have a system such as mine and would you have any suggestions for the two sliders settings?

View 3 Replies View Related

Red Hat / Fedora :: Read Or Write At Specified Memory Location On SD Card

Dec 10, 2010

I am new to linux at driver level. I want to read/write at specified memory location in microSD card in linux. I do not want to used SD card with any file system. How to do that. My linux distribution is Fedora13.

View 3 Replies View Related

Programming :: Memory Leaks - Glibc Detected - ./SuffixTree: Malloc() - Memory Corruption - 0x00

Mar 21, 2011

I am new to C and linux. My code below does arbitary writes but I cant figure out where or how it does it.

I am calling the insertNode() function with seq = 'MISSISSPPI$' and alphabets = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ$'

Code:

Weird behaviour I should mention is that when I check for NULL pointer in node->child[index], the unassigned values are not null anymore, they point to arbitary memory.

View 12 Replies View Related

Programming :: Write A Script That Can Show Me Total Memory Vs Used Memory?

Apr 13, 2010

How do I write a script for my Linux that can show me total memory vs used memory and have it email me results if it's over 70 percent?

View 2 Replies View Related

Programming :: SHM Memory Counted As Cache Memory With Kernel 2.6.18?

Aug 25, 2010

Is that possible that SHM shared memory is counted as cache memory on Linux with kernel 2.6.18?If find it really odd since this memory is not file backed, but I have a piece of code that loads data using shm_open+mmap, and it generates an amount of cache memory in /proc/meminfo that corresponds exactly to the amount of shared memory (I load that data from a file but I am using posix_fadvise(fd,0,0,POSIX_FADV_DONTNEED) to ensure this file is not cached and I made sure that it is working as expected). As far as I know SHM memory was not tagged as cache memory with kernel 2.6.9.If it is the case it is really unfortunate since normally cache memory can be considered to be part of the "available" memory since it can be flushed promptly but this is clearly not the case with SHM memory... Is there an easy way to get the total amount of used SHM memory on a system?

View 4 Replies View Related

Debian Hardware :: Cannot Access External Hdd, Memory Stick, Mp3 Player - Unable To Mount Location

Jul 22, 2011

usb devices, such as external hdd, memory stick and mp3 player, when I connect them to USB, they show up in Nautilus, but when I click on them, Nautilus is unable to mount them and returns the following error: Unable to mount location Error mounting: mount exited with exit code 1: helper failed with:mount: wrong fs type, bad option, bad superblock on /dev/sdc1, missing codepage or helper program, or other error in some cases useful info is found in syslog - try dmesg | tail or so

View 3 Replies View Related

Programming :: Location Of - Gnu - C++ Standard Library

Jul 21, 2010

Where is the location of the header files for the c++ standard library?

I assume that they were installed by gnu g++, please correct me if i'm wrong.

I'm running ubuntu 10.04 with g++ 4.4.

I looked in /usr/lib/gcc/i486-linux-gnu/4.4/include, but this directory contains only the following:

Code:

Which doesnt seem to include the really basic things like iostream, for example.

Where can I take a look at the header files for these standard c++ libraries?

View 2 Replies View Related

Programming :: Manipulate Application To Look In Different Location For File?

Aug 23, 2010

I have an application which looks in a particular directory for it's settings. For example varsetting.txt. These settings are stored in a text format and can be edited easily. I would prefer to keep this setting.txt file on a USB stick rather than the HDD for portability so that I can easily use the same settings on two linux PC's without having to redit them everytime. I have tried but cannot manipulate the application to look in a different location for this file, do you know if it is possible to "point" linux to another location when looking for the file?

View 2 Replies View Related

Programming :: CreateProcess() In C \ Specify The Location Of The File As An Argument?

Aug 31, 2010

am coding a chat program in C (win32), where I need both the client and the server to communicate, without waiting for a reply from the other side, like the way we chat in any messenger. Is there any way of accomplishing it? I tried out CreateProcess() function, but am not clear how to specify the location of the file as an argument.If there are better techniques than CreateProcess(), then

View 13 Replies View Related

Programming :: Finding Location Of Duplicate Directories

Jan 8, 2011

This simple task is proving harder then imagined. I have a multi-level directory that I'm trying to clean of duplicates, but I can't get 'find' to print what I need to see. To give an illustrative example, here is a dir:

Code:
stuart@stuart:~/testdir$ ls *
dir1:
level2:
dir1

So the output of find as i'd like it to work would show the two locations of dir1, which would be ./dir1 and ./level2/dir1. But no:

Code:
stuart@stuart:~/testdir$ ls -d */ | head -1 | find . "`cat`" -type d
.
./level2
./level2/dir1
./dir1
dir1/

View 2 Replies View Related

Programming :: Codeblocks Plugins And Header Files Location?

Jan 29, 2010

I installed Codeblocks and build some programs, but I have two questions:1. Where are my header files placed, since I don't know where codeblocks is installed. Soemetimes I have to remove header file extension (.h) to be able to compile some source. I use gcc as setting for codeblocks to compile and build programs.2. Plugins for Codeblocks can be installed, but when browse codeblocks's wiki I can't find download links neither developer pages

View 3 Replies View Related

Programming :: Use Gtk_window_set_gravity Function To Init Window Location On Screen?

Oct 18, 2010

I use gtk_window_set_gravity function to init window location on screen. I use different parameter value in Gravity,window location always at top left of screen.I use ubuntu 10.04. Code by follow:

GtkWidget * window, *label;
gtk_init(p_argc, p_argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

[code]....

View 2 Replies View Related

Programming :: Source Code To Get The Location Of Installed Files After Rpm Installation

Jul 25, 2011

The rpm command to get all the list of all installed file location after rpm installation is rpm -ql <rpm file-name>

View 7 Replies View Related

Ubuntu :: OpenMotif : Create Network Location Link As Local Filesystem Location?

Apr 26, 2011

I'm working with a program that uses Open Motif to create all of the widgets, including the Open File dialog box (obviously). However, Open Motif being kinda old-timey, 80's vintage, and for the most part now an abandoned project, it is quite clunky. So, actually what I need to do is to open some files located on my work server. I have already successfully connected to the relevant server directories with Samba, and with programs built with GTK+ (such as GIMP) I can open files across the network because I have created a bookmark in Nautilus, and those bookmarks appear in the Open File dialog box created by GTK+. Now, Open Motif is different: it doesn't see network locations, orNautilus shortcuts. When I type "smb://serveripyadayada" in the search folder, it really doesn't like it and complains. So, what do I do? Can I get somehow Open Motif to open a network location? Or can I do a run-around and place a shortcut in the file system that points to the network location?

View 2 Replies View Related

Programming :: Shell Script To Delete Files Which Location Should Be Read From Log File

Jun 26, 2010

I have 2 external hdd in wich I have all my files. yesterday, I have copied all the files from hdd2 to hdd1 and I want to eliminate duplicates so I used FSLint to find them,now I want to make a shell script to delete all the files/entries (read from the log file) that begin with.

View 14 Replies View Related

Programming :: Finding A Shell Script To Delete Files Which Location Should Be Read From A Log File?

Jul 16, 2011

I have 2 external hdd in wich I have all my files.... yesterday, I have copied all the files from hdd2 to hdd1 and I want to eliminate duplicates so I used FSLint to find them, now, I have a txt file that looks like this:

Code: /media/My Book/!!!MIS DOCUMENTOS/Documentos/2 sep2003-jun2009 USB/!TESIS/TESIS/TESIS CVT LABVIEW Y CODEWARRIOR/LabVIEW85RuntimeEngineFull.exe /media/My Book/HDD_Toshiba/Borrable/Pen_Drive_4GB/Tesis/Super CD de la tesis/LabView/LabVIEW85RuntimeEngineFull.exe multiplied by millions of entries...

now I want to make a shell script to delete all the files/entries (read from the log file) that begin with:

Code:

/media/My Book/HDD_Toshiba/**** Since HDD_Toshiba is the folder in hdd1 (MyBook) that contains all the files from hdd2

View 1 Replies View Related

Ubuntu :: Nautilus Location Bar: How To Write Manually Location

Oct 30, 2010

I have been testing ubuntu 10.10 maverick, it has some nice features. Anyway I am missing the possibility of writing manually the folder you want to go on nautilus using the Location bar. It was used to have some kind of icon which you can click and it switched between graphich breadcrumbs or the location of the folder and you could changed it manually, you know what I mean?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved