3 ms·
How did your equivalent assembly program without a definition of _main to? You're doing that thing. I think it's called "trolling". It goes like "hurr durr, th
by direwolf20 9mo ago
How did your equivalent assembly program without a definition of _main to?
You're doing that thing. I think it's called "trolling". It goes like "hurr durr, they said take one, but they wouldn't let me take one plate" or "hurr durr, I filled my gas tank with nitrogen, which is a gas, but my car doesn't go" or "hurr durr, they said C++ features are all optional, but I don't want to use letters, how can I write C++ without using letters?"
At least when that guy asked Stack Overflow how to make gcc compile his .png, it was actually funny.
- 9rx 9mo ago> your equivalent assembly program Right now, hlt jmp $0 I intend to add more later, of course, but I until I get past this hurdle I am unable to start. Does that help narrow things down for you?
- direwolf20 9mo agoIt doesn't link. Something about undefined symbol _main. Can you help?
- 9rx 9mo agoIt doesn't need to link. That is the complete program. Are you suggesting I need to pass a flag to the C++ compiler to disable the linker? How do I do that?
- direwolf20 9mo agoOh, I see what you meant now. I don't think it works: ./test: line 1: hlt: command not found ./test: line 2: jmp: command not found Do you get a dopamine hit out of this?
- 9rx 9mo agoNo, that is right, assembly doesn't work in what looks like the output of a Unix shell. Assembly is intended to be input to an assembler. Easy mistake to make, I suppose.
- direwolf20 9mo agoBut I don't want to use an assembler. Well, fine. Doesn't build. Says somehow about undefined symbol _main
- 9rx 9mo agoFunny, I haven't told you anything about the architecture yet. But as you don't want to use the tools anyway and it is only a three byte program for the target machine, the good news is that it can quite easily be assembled by hand. Now, back to the C++ problem, any idea what the next step to get us past the issue?
- throwaway2046 9mo ago> that guy asked Stack Overflow how to make gcc compile his .png Do you have a link to this? All the search results I'm getting are related to libpng.
- direwolf20 9mo agoI can't find it with a more specific search on SO, maybe it was deleted. The question was like: I wrote "hello world" but I get some compile errors, followed by an image embed of a handwritten hello world program, followed by a compiler command where the input file had a .png extension and an error related to the compiler not being able to read PNG files, followed by quoting the part of the standard where it says the input file shall be readable text and this is obviously readable text because I can read it.
- 9rx 9mo agoI'll take things that never happened for $500, Alex
- direwolf20 9mo agoI searched harder, just for you. https://stackoverflow.com/questions/5508110/why-is-this-program-erroneously-rejected-by-three-c-compilers https://stackoverflow.com/questions/5508110/why-is-this-prog... How would you like to send the $500? Monero is acceptable.
- 9rx 9mo ago> I searched harder, just for you. I know this one! How did you waste your time? > How would you like to send the $500? Simpsons already did it. Well, at least it is a lot funnier than that PNG thing.