Private string inside C code.
After a lot of messing around, time consumption and jiggery-pokery I finally got a common piece of code for this thread working:
The OP wanted the string to be alone and as close to the top of the code as possible and not inside the data section.
Well, I wanted to make it possible for AMIGA users to have the same as we UNIX users, and upload to AMINET to suit.
But when it compiled in gcc 2.95.3 i got some warnings and errors, etc... When the warnings and errors went the test code similar to the URL above inverted everything and the data section was at the top and the private string was below the data section. After much thought this was the demo code that worked for the platforms tested on.
The assembly code does not need to be changed at all as the 2 instructions are the same for both architectures.
Results for OSX 10.14.x:
It looks much the same on all three OSes even though it was originally inverted on the AMIGA A1200.
It took wime to get it working, but this might be a better bet for drew77 as it is consistent on differing platforms and compiles on differing versions of gcc.
Have fun...
EDIT:
Off to give this to the AMINET site soon...
Last edited by wisecracker; 02-20-2019 at 01:07 PM..
Reason: See above...
These 2 Users Gave Thanks to wisecracker For This Post:
As a grand finale to this and the other thread, this I never realised; comments, jokes, passing remarks and function characteristics inside any and every function inside the executable itself.
I knew that the idea would work but not to this extent...
I consider this finalised now...
This User Gave Thanks to wisecracker For This Post:
I was trying the below statement if
It is working fine if I run it in a test file.
but not working, when I am trying in my actual script.
Error:
: "${FXML_line:1129:1}": bad substitution
Thanks in advance :)
PS: Above if block I have a while loop which is reading a... (4 Replies)
Hi,
I have a very large file that contains a listing of all files on the system. I need to create a listing from that file of all files that start with the following format: s???_*, whereas the '?' represents characters, so the file name begins with an 's' followed by three other characters and... (4 Replies)
hello,
anyone knows how to do this:
given a=0, i want to print in next line that a=1 so how do I do that inside the string?
ex.
a=0
b="value of a=$((a+1))"? <- Because this is incorrect..
Thanks! (1 Reply)
I have umpteen number of files containing HTML A tags in the below format
or
I want to find all the lines that contain the word Login=
I used this command
grep "Login=" *
This gave me normal lines as well which contain the word Login= for example, it returned lines which... (2 Replies)
Hi All,
I am comparing two strings inside an if condition if the strings are same then it should go inside the loop else it should execute code given in else part.
But there is a but inside my script
Even if the if condition is true
it is not going inside the loop also it is executing... (4 Replies)
Hi
I need to update a string inside a file which looks like the following:
PX_LIST=" 4119 2390 2294 2776 2897 4099 "
Is there a way to get rid of the blanks after the first quote mark and before the last quote mark.
This needs to be done ONLY for the string named PX_LIST (there are some... (4 Replies)
Hello,
I barely know the basics, but I am very determined to learn. I want to parse a few characters from each row, use that string to search another file and display the line number where I found the value in the file. I don't know if this can all be done on the command line, so I am creating a... (2 Replies)