They had to add the shadow space for debugging on x86-64 because most debuggers wouldn't correctly show parameters that were passed in registers. So you only need as much space as for the first four arguments, and only when they're passed. Which means if you don't pass any arguments to a function you don't need any, and if you only pass one you only need enough for one, et cetera. For main, since you're using gcc to link, you only need to account for two arguments. It should also be noted that you don't need shadow space if you pass arguments via the stack instead of registers, and you only need to worry about it if your code is being called externally, which main would be.
Might also be interesting to take a look at ANTLR (java) to build compilers like the industry does. Really interesting topic and so many resources out there to understand all sides of a compiler (check out the book Engineering a Compiler). Having built my own compiler for my selfmade language for a project of mine I can definitely say there's so much to learn on this topic!
Great idea! I am planning to do that at some point. The playlist from Immo Landwerth in the description is a really in-depth on industry (microsoft) compiler design series. I think it would be nice to then compile a c-like language, instead of the current stack based language. Thanks for you comment and suggestion :)
it would be cool to do this for a more complex grammar, rather than simple opcodes and instructions like PUSH, POP, READ, etc. take for instance c++, it compiles to an executable and there are lots of complicated things like classes, inheritance, etc.
I can really recommend the sources in the description if you are interested in learning about those things right now :) Especially this one: th-cam.com/play/PLRAdsfhKI4OWNOSfS7EUu5GRAVmze1t2y.html
I would highly recommend the book “crafting interpreters” it’s available for free in website format and features a more complex language with lots of detail. There are also lots of playlists of people working through the book on TH-cam.
I have a problem when writing the code in the video. Around 16:05 where the print function is supposed to run, I tried running the code, it would print linking and running, it will stop for a while, and it prints nothing. It does not print "Hello, World." Nothing appears. Is there any problem with my NASM configurations?
Hey! at 13:31 , I get a error in command prompt that says " [CMD] Parsing [CMD] Assembling 'nasm' is not recognized as an internal or external command, operable program or batch file. [CMD] Linking gcc: error: program0.o: No such file or directory gcc: fatal error: no input files compilation terminated. [CMD] Running 'program0.exe' is not recognized as an internal or external command, operable program or batch file." Kindly help me in this regard.
@@bvdlio Hey! tried that...now I am getting an error in the linking part dude [CMD] Parsing [CMD] Assembling [CMD] Linking program0.o: file not recognized: File format not recognized collect2.exe: error: ld returned 1 exit status [CMD] Running 'program0.exe' is not recognized as an internal or external command, operable program or batch file.
Also at 1:22, did you mean to have “windows 10” and “13th gen intel CPU” in that order? I think it would look better if they were swapped so that the columns would all line up.
I was having trouble with the print function when combined with the JE function. The solution I eventually found with chatGPT was to modify it as follows: elif opcode == "PRINT": string_literal_index = program[ip] ip += 1 out.write(f"; --- PRINT --- ") out.write(f"SUB rsp, 8 ") # added line out.write(f"LEA rcx, string_literal_{string_literal_index} ") # out.write(f"XOR eax, eax ") # removed out.write(f"CALL printf ") out.write(f"ADD rsp, 8 ") # added ChatGPT says "In the x86-64 ABI (Application Binary Interface), the stack must be aligned to a 16-byte boundary before making a function call." I don't know why this is the case but it seems to have fixed the problem. Do you have any ideas why I would've had to do this when you didn't have to do it? I'm also running windows on an intel cpu.
Interesting. I don't know the exact reason why it would be like that on your system. But I know that the "XOR eax, eax" was part of the calling convention for my system. So most likely your system just expects slightly different assembly (calling conventions). I also knowticed later that I am using the elf64 format, which is actually a Linux format, so it was surprising to see that I had no issues. Perhaps it has to do with that... Idk. Maybe mine ran using WSL somehow :p Glad you managed to fix it on your end, Great job!
Hey, nice idea! Which on of these do you mean? Would you like to see the interpreter written in Java or C. or. Would you like to see an interpreter written to interpret Java or C?
Hey im getting this error, can u help me out [CMD] Parsing [CMD] Assembling [CMD] Linking program0.o: file not recognized: File format not recognized collect2.exe: error: ld returned 1 exit status [CMD] Running 'program0.exe' is not recognized as an internal or external command, operable program or batch file.
Yea sure. Can you give me a link to the repository containing your code? I'll make sure to add a link to my code at the end of the day. So you can compare them aswell :)
Thanks! Unfortunately, as far as I know, Apple uses the ARM instruction set. Meaning, that it requires a different assembly language. You would need to look at the equivalent arm instructions to the x86 ones in the video and replace them. So unfortunately it's not as simple as changing the command arguments. Hope it helps :)
For (win 11 +amd ryzen 7) (or) (win11 + i7 10thgen) how do i figure out what cmds to use and is there anything else u need to know the current error screen: [CMD] Parsing [CMD] Assembling [CMD] Linking program0.o: file not recognized: File format not recognized collect2.exe: error: ld returned 1 exit status [CMD] Running 'program0.exe' is not recognized as an internal or external command, operable program or batch file.
Use the intel CPU. You can find nasm formatting arguments by using Google. Like: "nasm formatting arguments" "nasm win 11 formats" etc. So the error is the same as you shared before, so my previous reply is what I would suggest you do, in order to resolve the problem. If you are sure you have the correct nasm command, try finding out if the linker is being called with the correct arguments. Good luck
we're stuck with the same error (device: win11 i7 10th gen) and don't know how to proceed. we have our project submission in 2 days. can you please help us out?
I've replied to your previous comments. Please try keep our conversation going in just one comment thread. (so please reply to those, and don't create a new comment thread each time. Your comments are very similar each time, so i dont know if you are reading my response. Thanks.) I will gladly help over the next 2 days to help you guys complete your project :) Keep in mind though, if your assignment is to make a simple compiler, that if your project is the code you shared in the repository (VasPar1211/Proj1). I am fine with you using it, but your school will consider it copy-paste/plagiarism.
@@bvdlio we're sorry we created different comment threads. we are a team of 3 and yes we did read all of your responses and went through nasm formatting arguments, win 11 formats and all those. but we're still not able to rectify the error. and yeah we thought of working on the project further by adding more syntaxes for our own language but we thought of executing yours first and are stuck.
@@upasanal7663 No problem. Since I can't reproduce the error on my end, here are some more suggestions: 1. Try using the following format with nasm: win64 so: nasm -f win64 {asm_filepath} 2. Remove (since they are not used): extern printf extern scanf It can be that the external functions are not properly exposed, and the linker can not find them, after they were added to the .o file. Possibly the same goes for 'extern ExitProcess', but that one is necessary to properly exit. However you can try remove it see if at least linking will work. 3. File Extensions: Ensure that the file extensions are correctly used in your commands. For example, check if the output file from NASM actually matches the input file expected by GCC for linking. 4. Path Issues: Verify that the paths used in the script are correct and the files exist at those paths. Relative paths can sometimes cause issues depending on where the script is run from. 5. Permissions and Environment: Make sure you have the necessary permissions to execute these commands and that your environment is set up correctly for running NASM and GCC. Try using name and gcc on some something that you know should work. 6. Use Docker: Try using a docker container, to create the exact environment that you want, or try WSL2. Hope that gets you somewhere :) Good luck!
@@bvdlio thank you so much!! but its still the same😭😭 we tried win64 win32 elf64 elf32 but none of them are working, tried by removing the external functions, all the files are in the same path, set up the environment variables, but none of them are working for us. the object file is not being created and thus linking and running are not working. but we really appreciate your effort, thanks!!
Thats too bad to hear. It is strange that you mention that the object file is not being created. Since the first printed error: "program0.o: file not recognized: File format not recognized collect2.exe: error: ld returned 1 exit status" Seems to suggest that the file exists, but is not readable or in the wrong format. If it is the case that the object file is not created, then it must the that its an issue with nasm, or even the steps before. There are dubug methods for nasm which can give you more insight on what is going wrong, check out this stackoverflow thread or similar directions: stackoverflow.com/questions/27747556/how-can-i-include-debug-information-with-nasm A final suggestion to maybe get something running, would be to look for an online asm "interpreter/compiler", so you can use the output .asm file that you generate and check it in there, and perhaps get it running in there. Like this one: www.mycompiler.io/new/asm-x86_64 Best of luck!
It's a very simple stack based language, that doesn't support variables. Just pushing and popping from a stack, and operations on things on the stack. In the near future there will be a video on how to create an interpreter for higher level language. With variables, ifs, loops, etc.
So I ran your code, and it works fine on my machine. So most likely, your assembly step (with nasm) is assembling to a format (elf64) that is not meant for your system. In the video, I state some of the requirements, like being on windows 10 64 bit, intel cpu, etc. If that is not identical to your setup, nasm will assemble the program to a object file (.o file) in a way that your system does not support, resulting in: "program0.o: file not recognized: File format not recognized." Try figure out what nasm commands are suited for your system. Good Luck!
You mean when you run it yourself? in the video? or where? what is 'test two'? are you on windows? do you link the c libraries? If you want me to fix or help with something, i need a little more info :)
Not quite :3 An assembler is a program that takes assembly code and converts it to machine code. This program takes .oll code and converts it to assembly code, so it compiles the code to assembly. Hope this makes sense :3
Unless we write our compiler in assembly, we need a compiler or interpret to compiler/interpret our own compiler to use it. If you are talking about gcc. gcc started out as a compiler, but these days it is a collection of tools. In our case we use it as the linker. It is indeed a funny cycle of using compilers on compilers. I recommend tsoding dailys Porth playlist in the description. He eventually makes his language self hosted. Meaning he wrote the compiler for his own programming language using his own programming language. It's great fun :)
You don't *need* to. You can use an assembler but it will be a lot harder. You can hand-assemble by outputting the binary bytes directly but it will be a lot harder again. As a bare minimum you need something that can edit a text files and something that can create a binary executable file. In the beforetimes you could write the machine code directly into RAM and execute it but modern operating systems wouldn't allow that for security reasons. You could of course use an old operating system or old computer from the beforetimes. I would definitely watch such a video, but these days almost nobody other than maybe malware researches would go lower level than as assembler and even then almost never.
I would argue no, since the output (compiled program) is the same no matter what language the compiler is written in. Be that interpreted or compiled. It does not affect the compiled program/it's execution speed. (since the compiler is not responsible for running the programming). Personally I just chose Python for educational purposes, since most people understand python.
@@bvdliook make sense but still curious whether it does effect the compile speed. Say if you have an IDE written in python vs C. Which would compile faster? Also when pressing run to test code, a compiler written in C would run faster than python? I'm curious. This needs to be tested.
It's just a choice-it could have been any language. Python is handy for this video since it's beginner-friendly and widely known. It's best to gain an understanding in a programming language-agnostic way.
I'm getting this error: [CMD] Parsing [CMD] Assembling program3.asm:27: error: symbol `L2' not defined program3.asm:30: error: symbol `L0' not defined program3.asm:43: error: symbol `L1' not defined program3.asm:46: error: symbol `L0' not defined [CMD] Linking C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find program3.o: No such file or directory collect2.exe: error: ld returned 1 exit status [CMD] Running 'program3.exe' is not recognized as an internal or external command, operable program or batch file.
Hi there. I treid to recreate your project, and am getting the following errors. Can you please help me with this? [CMD] Parsing [CMD] Assembling [CMD] Linking /usr/bin/ld: program0.o: warning: relocation against `ExitProcess' in read-only section `.text' /usr/bin/ld: program0.o: relocation R_X86_64_PC32 against symbol `printf@@GLIBC_2.2.5' can not be used when making a PIE object; recompile with -fPIE /usr/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status [CMD] Running sh: 1: program0.exe: not found
Did you try re-compile with -fPIE like the error suggests? What output do you get then? It also seems to suggest you have the ExitProcess imported/used in the wrong section of your assembly.
@@bvdlio I did, but I was getting some other error. And I am not sure how I imported it wrong, as another friend of mine suggested it might be the case, but I used the same code as you and have an intel cpu.
Thanks for this guide! I followed along and customized this to my own needs, very simple and straight forward to follow
Love from Sweden
That is great to hear!
That was a great little process demystifier! Thanks for taking the time to share.
That is great to hear! I appreciate your kind words.
Never thought I could look at some compiler building code...was always curious about it! Thanks!
Funny how you made a language 1000x faster than python in python! Great vid.
Glad you liked it!
@spider3515 still the python file has to run
@@rohithbhandari7836 The compiling speed doesn't matter, what matters is the speed of the program itself
@@SDZeeAy rust users be like:
you're seriously under-rated
Thank you!
agree
You need more subs, these are quality vids!
Thank you :)
They had to add the shadow space for debugging on x86-64 because most debuggers wouldn't correctly show parameters that were passed in registers. So you only need as much space as for the first four arguments, and only when they're passed. Which means if you don't pass any arguments to a function you don't need any, and if you only pass one you only need enough for one, et cetera. For main, since you're using gcc to link, you only need to account for two arguments. It should also be noted that you don't need shadow space if you pass arguments via the stack instead of registers, and you only need to worry about it if your code is being called externally, which main would be.
Cool thanks this and the intrepreter one gimme more ideas to experiment making more language.
Work on the "Not a Little Language" interpreter has started 🤙
Very well explained!
Wow that was really cool.. can you also go through how assembler works??
Might also be interesting to take a look at ANTLR (java) to build compilers like the industry does. Really interesting topic and so many resources out there to understand all sides of a compiler (check out the book Engineering a Compiler). Having built my own compiler for my selfmade language for a project of mine I can definitely say there's so much to learn on this topic!
Great idea! I am planning to do that at some point. The playlist from Immo Landwerth in the description is a really in-depth on industry (microsoft) compiler design series.
I think it would be nice to then compile a c-like language, instead of the current stack based language.
Thanks for you comment and suggestion :)
it would be cool to do this for a more complex grammar, rather than simple opcodes and instructions like PUSH, POP, READ, etc. take for instance c++, it compiles to an executable and there are lots of complicated things like classes, inheritance, etc.
I can really recommend the sources in the description if you are interested in learning about those things right now :) Especially this one: th-cam.com/play/PLRAdsfhKI4OWNOSfS7EUu5GRAVmze1t2y.html
Work on the "Not a Little Language" interpreter has started 🤙
I would highly recommend the book “crafting interpreters” it’s available for free in website format and features a more complex language with lots of detail. There are also lots of playlists of people working through the book on TH-cam.
I loved it! Thanks!
I have a problem when writing the code in the video. Around 16:05 where the print function is supposed to run, I tried running the code, it would print linking and running, it will stop for a while, and it prints nothing. It does not print "Hello, World." Nothing appears.
Is there any problem with my NASM configurations?
Hey! at 13:31 , I get a error in command prompt that says "
[CMD] Parsing
[CMD] Assembling
'nasm' is not recognized as an internal or external command,
operable program or batch file.
[CMD] Linking
gcc: error: program0.o: No such file or directory
gcc: fatal error: no input files
compilation terminated.
[CMD] Running
'program0.exe' is not recognized as an internal or external command,
operable program or batch file." Kindly help me in this regard.
'nasm' is not recognized as an internal or external
This means you need to install nasm :) Make sure to add it to your environment variables.
@@bvdlio Hey! tried that...now I am getting an error in the linking part dude
[CMD] Parsing
[CMD] Assembling
[CMD] Linking
program0.o: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
[CMD] Running
'program0.exe' is not recognized as an internal or external command,
operable program or batch file.
@@SreenidhiRamprasath
either it doesnt exist
or
use .\program0.exe
@@SreenidhiRamprasathyou need to be on linux or WSL
@@SreenidhiRamprasath did u forgot nasm -f win64? it needs a format to be linkable if ur on linux nasm -f elf64
Also at 1:22, did you mean to have “windows 10” and “13th gen intel
CPU” in that order? I think it would look better if they were swapped so that the columns would all line up.
Good suggestion! It would have been a better organization of the columns. Thanks :)
I was having trouble with the print function when combined with the JE function. The solution I eventually found with chatGPT was to modify it as follows:
elif opcode == "PRINT":
string_literal_index = program[ip]
ip += 1
out.write(f"; --- PRINT ---
")
out.write(f"SUB rsp, 8
") # added line
out.write(f"LEA rcx, string_literal_{string_literal_index}
")
# out.write(f"XOR eax, eax
") # removed
out.write(f"CALL printf
")
out.write(f"ADD rsp, 8
") # added
ChatGPT says "In the x86-64 ABI (Application Binary Interface), the stack must be aligned to a 16-byte boundary before making a function call." I don't know why this is the case but it seems to have fixed the problem. Do you have any ideas why I would've had to do this when you didn't have to do it? I'm also running windows on an intel cpu.
Interesting. I don't know the exact reason why it would be like that on your system. But I know that the "XOR eax, eax" was part of the calling convention for my system.
So most likely your system just expects slightly different assembly (calling conventions).
I also knowticed later that I am using the elf64 format, which is actually a Linux format, so it was surprising to see that I had no issues. Perhaps it has to do with that... Idk. Maybe mine ran using WSL somehow :p
Glad you managed to fix it on your end, Great job!
They should do one of these for Java or C, that would be very useful
Hey, nice idea!
Which on of these do you mean?
Would you like to see the interpreter written in Java or C.
or.
Would you like to see an interpreter written to interpret Java or C?
Hey im getting this error, can u help me out
[CMD] Parsing
[CMD] Assembling
[CMD] Linking
program0.o: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
[CMD] Running
'program0.exe' is not recognized as an internal or external command,
operable program or batch file.
Yea sure. Can you give me a link to the repository containing your code?
I'll make sure to add a link to my code at the end of the day. So you can compare them aswell :)
@@bvdlio VasPar1211/Proj1
Hey, what font do you use in your videos?
I'll look it up for you :)
The name of the font is: Baloo 2
I use it inside of: Figma
please make more
Work on the "Not a Little Language" interpreter has started 🤙
Great Video ♥How can I make this compiler work for MacOS M1 Chip. What should I replace os.system(f"nasm -f elf64 {asm_filepath}") with?
Thanks!
Unfortunately, as far as I know, Apple uses the ARM instruction set. Meaning, that it requires a different assembly language.
You would need to look at the equivalent arm instructions to the x86 ones in the video and replace them.
So unfortunately it's not as simple as changing the command arguments.
Hope it helps :)
Got it! Thanks for replying 🙂
Do you have git repo for this?
For (win 11 +amd ryzen 7) (or) (win11 + i7 10thgen) how do i figure out what cmds to use
and is there anything else u need to know
the current error screen:
[CMD] Parsing
[CMD] Assembling
[CMD] Linking
program0.o: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
[CMD] Running
'program0.exe' is not recognized as an internal or external command,
operable program or batch file.
Use the intel CPU.
You can find nasm formatting arguments by using Google. Like:
"nasm formatting arguments"
"nasm win 11 formats"
etc.
So the error is the same as you shared before, so my previous reply is what I would suggest you do, in order to resolve the problem.
If you are sure you have the correct nasm command, try finding out if the linker is being called with the correct arguments.
Good luck
I was strongly suggest, to make it in arm64 assembly + linux, because it is very easy.
we're stuck with the same error (device: win11 i7 10th gen) and don't know how to proceed. we have our project submission in 2 days. can you please help us out?
I've replied to your previous comments. Please try keep our conversation going in just one comment thread. (so please reply to those, and don't create a new comment thread each time. Your comments are very similar each time, so i dont know if you are reading my response. Thanks.)
I will gladly help over the next 2 days to help you guys complete your project :)
Keep in mind though, if your assignment is to make a simple compiler, that if your project is the code you shared in the repository (VasPar1211/Proj1). I am fine with you using it, but your school will consider it copy-paste/plagiarism.
@@bvdlio we're sorry we created different comment threads. we are a team of 3 and yes we did read all of your responses and went through nasm formatting arguments, win 11 formats and all those. but we're still not able to rectify the error.
and yeah we thought of working on the project further by adding more syntaxes for our own language but we thought of executing yours first and are stuck.
@@upasanal7663
No problem.
Since I can't reproduce the error on my end, here are some more suggestions:
1. Try using the following format with nasm: win64
so: nasm -f win64 {asm_filepath}
2. Remove (since they are not used):
extern printf
extern scanf
It can be that the external functions are not properly exposed, and the linker can not find them, after they were added to the .o file.
Possibly the same goes for 'extern ExitProcess', but that one is necessary to properly exit. However you can try remove it see if at least linking will work.
3. File Extensions: Ensure that the file extensions are correctly used in your commands. For example, check if the output file from NASM actually matches the input file expected by GCC for linking.
4. Path Issues: Verify that the paths used in the script are correct and the files exist at those paths. Relative paths can sometimes cause issues depending on where the script is run from.
5. Permissions and Environment: Make sure you have the necessary permissions to execute these commands and that your environment is set up correctly for running NASM and GCC. Try using name and gcc on some something that you know should work.
6. Use Docker: Try using a docker container, to create the exact environment that you want, or try WSL2.
Hope that gets you somewhere :)
Good luck!
@@bvdlio thank you so much!! but its still the same😭😭
we tried win64 win32 elf64 elf32 but none of them are working, tried by removing the external functions, all the files are in the same path, set up the environment variables, but none of them are working for us. the object file is not being created and thus linking and running are not working.
but we really appreciate your effort, thanks!!
Thats too bad to hear.
It is strange that you mention that the object file is not being created. Since the first printed error: "program0.o: file not recognized: File format not recognized collect2.exe: error: ld returned 1 exit status"
Seems to suggest that the file exists, but is not readable or in the wrong format.
If it is the case that the object file is not created, then it must the that its an issue with nasm, or even the steps before.
There are dubug methods for nasm which can give you more insight on what is going wrong, check out this stackoverflow thread or similar directions: stackoverflow.com/questions/27747556/how-can-i-include-debug-information-with-nasm
A final suggestion to maybe get something running, would be to look for an online asm "interpreter/compiler", so you can use the output .asm file that you generate and check it in there, and perhaps get it running in there.
Like this one: www.mycompiler.io/new/asm-x86_64
Best of luck!
Vs code theme please?
PawelBorkar.jellyfish
im not an expert but how can i declare variables?
It's a very simple stack based language, that doesn't support variables. Just pushing and popping from a stack, and operations on things on the stack.
In the near future there will be a video on how to create an interpreter for higher level language. With variables, ifs, loops, etc.
VasPar1211/Proj1
can u check this kind sir
So I ran your code, and it works fine on my machine.
So most likely, your assembly step (with nasm) is assembling to a format (elf64) that is not meant for your system. In the video, I state some of the requirements, like being on windows 10 64 bit, intel cpu, etc.
If that is not identical to your setup, nasm will assemble the program to a object file (.o file) in a way that your system does not support, resulting in: "program0.o: file not recognized: File format not recognized."
Try figure out what nasm commands are suited for your system.
Good Luck!
@@bvdlio Ill check and let yk thanks a lot
Run gcc -v and check your target architecture. Since this project uses the x64 architecture you need to make sure that your GCC install includes it
test two READ equal failed when compile program1.oll, ok with PUSH
You mean when you run it yourself? in the video? or where? what is 'test two'? are you on windows? do you link the c libraries?
If you want me to fix or help with something, i need a little more info :)
@@bvdlio I mean when I compare two same numbers from READ, it jump to "not equal". Thanks
now im making a programming lenguage, C+ (the opposite of C++)
Python makes it EZPZ lemon squeezy.
can u share this code?
Isn't this more an assembler than a compiler?
Not quite :3 An assembler is a program that takes assembly code and converts it to machine code. This program takes .oll code and converts it to assembly code, so it compiles the code to assembly. Hope this makes sense :3
Hold on, you need to use a compiler...to create a compiler?
Unless we write our compiler in assembly, we need a compiler or interpret to compiler/interpret our own compiler to use it.
If you are talking about gcc. gcc started out as a compiler, but these days it is a collection of tools. In our case we use it as the linker.
It is indeed a funny cycle of using compilers on compilers. I recommend tsoding dailys Porth playlist in the description. He eventually makes his language self hosted. Meaning he wrote the compiler for his own programming language using his own programming language. It's great fun :)
You don't *need* to. You can use an assembler but it will be a lot harder. You can hand-assemble by outputting the binary bytes directly but it will be a lot harder again. As a bare minimum you need something that can edit a text files and something that can create a binary executable file. In the beforetimes you could write the machine code directly into RAM and execute it but modern operating systems wouldn't allow that for security reasons. You could of course use an old operating system or old computer from the beforetimes.
I would definitely watch such a video, but these days almost nobody other than maybe malware researches would go lower level than as assembler and even then almost never.
a compiler written in a interpreter...isn't this counter intuitive?
I would argue no, since the output (compiled program) is the same no matter what language the compiler is written in. Be that interpreted or compiled.
It does not affect the compiled program/it's execution speed. (since the compiler is not responsible for running the programming).
Personally I just chose Python for educational purposes, since most people understand python.
@@bvdliook make sense but still curious whether it does effect the compile speed. Say if you have an IDE written in python vs C. Which would compile faster? Also when pressing run to test code, a compiler written in C would run faster than python?
I'm curious. This needs to be tested.
@@NamerunaTheFool !00%
The compile speed is for sure slowing using python/interpreted languages. (most of the time)
White Christopher Thomas Margaret Jackson Kimberly
Ok but why python?
It's just a choice-it could have been any language. Python is handy for this video since it's beginner-friendly and widely known. It's best to gain an understanding in a programming language-agnostic way.
@@bvdlio thats fair enough. python is a good choice if ur aiming for a tutorial-based approach for a general audience
Eww python
🤮
I'm getting this error:
[CMD] Parsing
[CMD] Assembling
program3.asm:27: error: symbol `L2' not defined
program3.asm:30: error: symbol `L0' not defined
program3.asm:43: error: symbol `L1' not defined
program3.asm:46: error: symbol `L0' not defined
[CMD] Linking
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find program3.o: No such file or directory
collect2.exe: error: ld returned 1 exit status
[CMD] Running
'program3.exe' is not recognized as an internal or external command,
operable program or batch file.
Hi there.
I treid to recreate your project, and am getting the following errors. Can you please help me with this?
[CMD] Parsing
[CMD] Assembling
[CMD] Linking
/usr/bin/ld: program0.o: warning: relocation against `ExitProcess' in read-only section `.text'
/usr/bin/ld: program0.o: relocation R_X86_64_PC32 against symbol `printf@@GLIBC_2.2.5' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
[CMD] Running
sh: 1: program0.exe: not found
Did you try re-compile with -fPIE like the error suggests? What output do you get then?
It also seems to suggest you have the ExitProcess imported/used in the wrong section of your assembly.
@@bvdlio I did, but I was getting some other error. And I am not sure how I imported it wrong, as another friend of mine suggested it might be the case, but I used the same code as you and have an intel cpu.
Thank you for making this tutorial, you are the best for this!!
Glad you like it!