Search:

Type: Posts; User: afflictedd2

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    2,265

    Thanks that worked. Ted.

    Thanks that worked.

    Ted.
  2. reading from beginning of file a second time

    Hi everyone,

    I am reading a binary file completely, but I would like to restart reading the file, by moving to the beginning of the file again. I have tried using file.seekg(0, ios::beg); but it...
  3. Replies
    2
    Views
    2,265

    going back to beginning of file

    Hi everyone,

    I am reading a binary file completely, but I would like to restart reading the file, by moving to the beginning of the file again. I have tried using file.seekg(0, ios::beg); but it...
  4. Replies
    2
    Views
    2,970

    trying to use forward declaration

    I am trying to declare a vector pointer, and an ifstream pointer in a class that I plan to use to read binary files. I have heard from someone that using #include in header is often not best (not...
  5. what if the buffer isn't completely full?

    How could I tell that the buffer is completely full or more like when it isn't completely full as there were no 1000 numbers, how can I prevent myself from accessing garbage locations?

    Ted.
  6. Reading a binary file like a matrix of ints

    Hi everyone,

    I would like to read a binary file as quickly as possible. Right now I am reading integer by integer, but that could end up being slow.. I imagine, it is probably best to put it all...
  7. hmm you mean something like this: int...

    hmm you mean something like this:


    int buf[BUF_SIZE];

    if(file.is_open())
    {
    while (file.read(reinterpret_cast<char*>(&buf[0]), BUF_SIZE))
    {
    for...
  8. Reading a binary file like a matrix of ints

    Hi everyone,

    I am trying to make a simple program that will read
    a file like a matrix of ints.
    The idea is that there is a binary file with ints:
    1 2 3 4 5 6 7 8 9

    and I want to read them in...
  9. Replies
    2
    Views
    1,997

    Help with interrupt handler

    Hi everyone,

    What does this attribute do?


    void __attribute__ ((interrupt)) context_switch (void)
    {
    ...
    }
  10. Replies
    1
    Views
    1,525

    Help with interrupt handler

    Hi everyone,

    What does this attribute do?


    void __attribute__ ((interrupt)) context_switch (void)
    {
    ...
    }
  11. Replies
    16
    Views
    2,280

    stackPointer is: unsigned char* stackPointer; ...

    stackPointer is:
    unsigned char* stackPointer;

    Yep, I'm dropping at the assembly level.
    I need to load the stack once I return from interrupt, and that's why I need to put the address of the...
  12. Replies
    16
    Views
    2,280

    That's not what I'm looking for though. I don't...

    That's not what I'm looking for though. I don't want a pointer to a function. I need to store the address of that function in the bytes (stackpointer) and (stackpointer -1).

    Ted
  13. Replies
    16
    Views
    2,280

    I'm not sure what command I need to execute to...

    I'm not sure what command I need to execute to get that information for you?
    I'm using the m6811-elf-gcc compiler. I was told it is really primitive and the sizeof an int is like 16 bits.

    Ted.
  14. Replies
    16
    Views
    2,280

    Yes, but how? the address has a size of two...

    Yes, but how? the address has a size of two bytes. If I assign it to one byte, it will only store part of the address?



    I'd have to write paragraphs to explain what I'm trying to do, and I...
  15. Replies
    16
    Views
    2,280

    Hmm that didn't work StackPointer =...

    Hmm that didn't work


    StackPointer = (&Myfunc & 0x0000FFFF);
    StackPointer - 1 = (&MyFunc & 0xFFFF0000) >> 16;

    I'm probably not using it correctly, I forgot to say.. the adress is only 16...
  16. Replies
    16
    Views
    2,280

    saving an address in two bytes

    Hi everyone I need to assign the address of my function to the
    first two bytes of my stackPointer.

    How do I do this?


    void function foo()
    {
    }
  17. Replies
    3
    Views
    972

    prining a register?

    Hi everyone,
    I have a flag defined like this:

    #define TMSK1 *(volatile char*)0x1022

    I would like to print its value but I'm not sure how to do this in GDB
    every time I try it, I get an...
  18. Replies
    4
    Views
    1,016

    Thank you so much, that shed some light into the...

    Thank you so much, that shed some light into the problem.. so if that's a function pointer.. then that is the interrupt handler hmmmmm.
  19. Replies
    4
    Views
    1,016

    what does this line do?

    Hi everyone,

    I am not sure what this line is doing...


    #define VECTOR_BASE 0xBFC0
    #define SWIV (*(volatile int *)(VECTOR_BASE + 0x36)) /* SWI */

    This is what I'm guessing it does....
  20. Replies
    1
    Views
    3,210

    Implementing Semaphores

    Hi everyone,

    I must implement my own semaphores for an operating systems project we're doing. I was wondering if someone here knows where I can find the algorithms or C code for semaphore...
  21. Replies
    1
    Views
    1,239

    Help with error

    Hi everyone,

    I'm trying to compile this program on my mac and I get this error:

    Naix:examples Naix$ g++ -o prodcon prodcon.c
    prodcon.c:129:32: error: empty character constant
    prodcon.c: In...
  22. Replies
    6
    Views
    1,262

    I can't post the code for the app though. Where I...

    I can't post the code for the app though. Where I am working they don't want any code exposed, I'm not sure how much is too much but I don't like to risk it. Most of the time I do if it's an example...
  23. Replies
    6
    Views
    1,262

    Oh.. I am using new to create the object and then...

    Oh.. I am using new to create the object and then push them in an array. However I do this in a sepparate function, could that be a problem.

    like this:


    Employee employee = NULL;
    for...
  24. Replies
    6
    Views
    1,262

    Why am I getting a SEGV?

    Hi everyone,

    I'm trying to erase an array of pointers, but I get a segmentation fault.. any ideas what is happening :\


    vector<employee*> arrayEmployees; // PostfixArray of functors that...
  25. Replies
    3
    Views
    1,230

    split space sepparated string

    Hi everyone,

    How do I split a string like this
    "500 57 - 33 + 17 * 22 -"

    into an array of strings
    "500" "57" "-" "33" ..

    What function can do that for me?
Results 1 to 25 of 52
Page 1 of 3 1 2 3