Sponsored Content
Full Discussion: Embed text in C code
Top Forums Programming Embed text in C code Post 303025224 by Corona688 on Sunday 28th of October 2018 01:33:29 PM
Old 10-28-2018
Quote:
Originally Posted by Marck
Embedding a text file in C code.
The C language, the C preprocessor, and the linker do not work that way.

Besides, altering what you stuff into a pair of double quotes doesn't move it into the code segment. It will be in the data segment, just like before, when he couldn't find it.

To stuff non-code content into the code segment, assembly language might be required.
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to embed shell script in a awk code

I have written a code to extract comma seperated values from a file and assign them to a variable inside awk code.i want to use one of these variable to be used in wget function i.e to pass the siteurl.How i can implement the shell command wget inside the awk for loop.code snippet is shown below. ... (8 Replies)
Discussion started by: rajbal
8 Replies

2. UNIX for Dummies Questions & Answers

How To Embed Image In output file

hello everyone, i am not well-versed with unix programming, but could you help me on how to embed an image(maybe a bitmap) to the output file? how about animations(avi, etc)? can this also be embeded to the output? thanks (0 Replies)
Discussion started by: minut
0 Replies

3. Web Development

php youtube style embed code

I'm looking to have a embed code for people be as short as possible. I'm trying to figure out how to do this. So something like... <EMBED SRC="http://www.website.com/myembedscript.php?id=1" HEIGHT=60 WIDTH=144> I'm looking to figure out what "myembedscript.php" should do. I have it... (0 Replies)
Discussion started by: mainegate
0 Replies

4. Shell Programming and Scripting

Why can't embed commands like fg or bg in a shell script ?

Hi Can someone explain in an easy way that why can't embed commands like fg or bg in a shell script ? (4 Replies)
Discussion started by: qiulang
4 Replies

5. Shell Programming and Scripting

Embed function in if statement

Hey everyone, I am just trying to figure out how to embed a function in an if statement. I have the following test script so far: PRIMARY=192.168.1.2 SECONDARY=192.168.1.1 function checkAlive { ping -c 1 -q $1 } if then echo "equaled 0" fi This... (1 Reply)
Discussion started by: msarro
1 Replies

6. Shell Programming and Scripting

embed a separator after each word in a text file

Folks, can anyone throw a code snippet here to insert a comma " , " after each word in a line when doing a file read and output the delimited text to a file. Appreciate your help Venu (9 Replies)
Discussion started by: venu
9 Replies

7. Shell Programming and Scripting

How to embed commands in awk search

Hello; When I try: awk '/$(date "+%y\/%m\/%d")/,0' It errors with: awk: There is a regular expression error. Invalid pattern. Is there anyway to make this work ?? Thank you (2 Replies)
Discussion started by: delphys
2 Replies

8. UNIX for Advanced & Expert Users

Embed tcl in ksh93 script

Hello everyone, I am trying to embed some tcl code inside a ksh93 script but I am not having any success. I even tried the simplest of code, something like this: . . jk=$(echo $(tcl << | write_file junkme "test"' | )) just to see if a file gets written. When I run there are no errors, but ... (3 Replies)
Discussion started by: gio001
3 Replies

9. Shell Programming and Scripting

How to embed sql query into our shell script?

Hi I would like to embed a sql query in my shell script. Also, before any the sql query is executed, i would like to validate username and password. (1 Reply)
Discussion started by: arghadeep adity
1 Replies

10. Shell Programming and Scripting

Embed image to the html script

hi, trying to embed an image to the html file to send out as an email. img src="data:image/jpeg;base64,$(base64 /home/test/abc.jpg but getting error as file not found after it aplies base64 on the file. (8 Replies)
Discussion started by: ATWC
8 Replies
Dis88 disassembles 8088 object code to the assembly language for-
mat used by It makes full use of symbol table  information,  sup-
ports separate instruction and data space, and generates synthet-
ic labels when needed.	It does not support 8087 mnemonics,  sym-
bolic  data segment references, or the ESC mnemonic.  The program
is invoked by: The -o flag causes object code to be  listed.   If
no  outfile is given, stdout is used.  The text segment of an ob-
ject file is always padded to an even address.	In  addition,  if
the  file has split I/D space, the text segment will be padded to
a paragraph boundary (i.e., an address divisible by 16).  Due  to
padding,  the  disassembler may produce a few spurious, but harm-
less, instructions at the end of the text segment.   Because  the
information  to which initialized data refers cannot generally be
inferred from context, the data  segment  is  treated  literally.
Byte  values  (in  hexadecimal) are output, and long stretches of
null data are represented by appropriate .zerow pseudo-ops.  Dis-
assembly  of  the  bss	segment,  on  the  other  hand,  is quite
straightforward, because uninitialized data is all zero by  defi-
nition.   No  data is output in the bss segment, but symbolic la-
bels are output as appropriate.  The output of operands  in  sym-
bolic  form is complicated somewhat by the existence of assembler
symbolic constants and segment override opcodes. Thus,	the  pro-
gram's	symbol	lookup routine attempts to apply a certain amount
of intelligence when it is asked to find a symbol. If  it  cannot
match  on  a symbol of the preferred type, it may output a symbol
of some other type, depending on preassigned (and somewhat  arbi-
trary)	rankings within each type. Finally, if all else fails, it
will output a string containing the address sought as a hex  con-
stant.	For  user  convenience,  the targets of branches are also
output, in comments, as  hexadecimal  constants.   Various  error
messages  may  be  generated  as a result of problems encountered
during the disassembly.  They are listed below
   Cannot access input file   - Input file cannot  be  opened  or
				read
   Cannot open output file    - Output file cannot be created
   Input file not in object format-Bad magic number
   Not an 8086/8088 object file -CPU ID of the file header is in-
				correct
   Reloc table overflow       - Relocation table exceeds 1500 en-
				tries
   Symbol table overflow      - Symbol table exceeds 1500 entries
   Lseek error		      - Input file corrupted (should nev-
				er happen)
   Warning: no symbols	      - Symbol table is missing (use ast)
   Cannot reopen input file   - Input file was removed during ex-
				ecution
Dis88	was  written  and copyrighted by G. M. Harding and is in-
cluded here by permission. It may be freely redistributed provid-
ed  that complete source code, with all copyright notices, accom-
panies any redistribution. This provision  also  applies  to  any
modifications  you  may  make.	You  are  urged  to  comment such
changes, giving, as a minimum, your name and complete address.
All times are GMT -4. The time now is 09:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy