Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6593919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:44:39+00:00 2026-05-25T17:44:39+00:00

here is a code i wrote to create the symtab of a sic/xe .asm

  • 0

here is a code i wrote to create the symtab of a sic/xe .asm file….

 #include<iostream>
 #include<fstream>
 #include<iomanip>
 #include"aviasm.h"
 using namespace std;

 void aviasm::crsymtab()
{

ofstream outs("symtab.txt",ios::out);//creating the symtab
ofstream outi("intermfile.txt",ios::out);//creating the intermediate file
ifstream in("asmfile.txt",ios::in);//opening the asmfile which i have already written
in.seekg(0,ios::beg);


char c;
string str[3];
string subset;
long locctr=0;
int i=0;


while((c=in.get())!=EOF)
{
    in.putback(c);
    while((c=in.get())!='\n')
    {
        in.putback(c); //putting back the first encountered letter
        in>>str[i++];  //the asm file has three or less fields in every row
    }

    if(str[0].size()!=0 && str[1].size()!=0 && str[2].size()!=0)//if all 3 are there
    {

        if(str[1]=="start")
        {
            outi<<hex<<locctr;
            outs<<str[1]<<" "<<locctr<<"\n";
            outs<<resetiosflags(ios::hex);
            outi<<" "<<str[0]<<" "<<str[1]<<" "<<str[2]<<"\n";
            locctr=stol(str[2],0,16);
        }//str[1]=start
     }//end of all the three fields
}
in.close();
outi.close();
outs.close();
}//end of crsymtab

…..here is a sample sic/xe .asm file…..note that in the above code i have not included the entire coded because the problem occurs even if i comment out the entire portion of the code except the above…the problem that occurs is whenever i run the code:

  1. A message box with: 'Unhandled exception at 0x00ba7046 in aviasm.exe: 0xC0000005:
    Access violation writing location 0xcccccccc.'
    appears and my program enters
    debugging mode…also a file named iosfwd(std::char_traits<char>) appears with an
    arrow at the line
    _Left=_Right; of the following function:

    static void __CLRCALL_OR_CDECL assign(_Elem& _Left, const _Elem& _Right)
    { // assign an element
    _Left = _Right;
    }

  2. Also, I output a few words to the console at the start and end of the block
    str[1]="start" to check whether this function was working…although both lines were
    working and I am also sure that input is being successfully taken by the program from
    the asm file(I have checked this),no lines are being output to intermfile and symtab…plz help??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:44:40+00:00Added an answer on May 25, 2026 at 5:44 pm

    You should run your program inside a debugger. If you are using Windows, then MSVC provides a debug environment. If you are using Linux, compile your program with -g, and run the gdb debugger: gdb ./myprog. You would immediately discover that on this line:

    in>>str[i++];  //the asm file has three or less fields in every row
    

    i has a value of 4, which exceeds the size of the str array.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I create another post but I didn't wrote exactly the proper code and what
I am using directions from here: http://msdn.microsoft.com/en-us/library/ms257351(VS.80).aspx to create a managed event class. Here's
Here's the code I wrote in the Application controller: class ApplicationController < ActionController::Base protect_from_forgery
Here is the code I wrote, but it does not work. I don't know
Here's my code: sentenceToTranslate = raw_input(Please write in the sentence you want to translate:
I want to write a simple web proxy, for exercise. Here's the code I
Ok the error is showing up somewhere in this here code if($error==false) { $query
Here is code from MSDN . I don't understand why the work isn't just
Here a code to demonstrate an annoying problem: class A { public: A(): m_b(1),
enter code here I have a table on SQL server 2005 with bigint primary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.