Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » How to learn NASM?
- ninjaMAR
-
1000+ posts
How to learn NASM?
How to learn NASM?
Nevermind. I just figured it out mostly by reading other peoples code
Nevermind. I just figured it out mostly by reading other peoples code
Last edited by ninjaMAR (Sept. 28, 2021 00:59:31)
- Raihan142857
-
1000+ posts
How to learn NASM?
why do you want to learn it? There's not really any good way to learn it online as far as I know… I got a basic understanding of it by reading other people's / the c compiler's assembly code.
- scratchieguy12345678
-
500+ posts
How to learn NASM?
redacted
Last edited by scratchieguy12345678 (May 21, 2021 02:44:24)
- ninjaMAR
-
1000+ posts
How to learn NASM?
idk sounds cool why do you want to learn it? There's not really any good way to learn it online as far as I know… I got a basic understanding of it by reading other people's / the c compiler's assembly code.
if some people know then how? also don't be offtopic You don't.
- scratchieguy12345678
-
500+ posts
How to learn NASM?
I guess if you really want to, you could use this tutorial I dug up somehow: https://cs.lmu.edu/~ray/notes/nasmtutorial/
- imfh
-
1000+ posts
How to learn NASM?
If you learn a different assembly language first and it will be much easier. Do you know any other assembly languages?
- ninjaMAR
-
1000+ posts
How to learn NASM?
https://cs.lmu.edu/~ray/notes/nasmtutorial/I saw that I guess if you really want to, you could use this tutorial I dug up somehow:
I don't know any other assembly languages. Which should I learn? If you learn a different assembly language first and it will be much easier. Do you know any other assembly languages?
- PkmnQ
-
1000+ posts
How to learn NASM?
6502 is easy to learn, but it isn't helping me understand the NASM tutorial linked above, so I'm not sure if it will help.I don't know any other assembly languages. Which should I learn? If you learn a different assembly language first and it will be much easier. Do you know any other assembly languages?
- Raihan142857
-
1000+ posts
How to learn NASM?
nasm is pretty much the python of assembly languages in terms of easiness to learnhttps://cs.lmu.edu/~ray/notes/nasmtutorial/I saw that I guess if you really want to, you could use this tutorial I dug up somehow:I don't know any other assembly languages. Which should I learn? If you learn a different assembly language first and it will be much easier. Do you know any other assembly languages?
here are some programs I wrote in nasm, you can read those to try and understand it
- ninjaMAR
-
1000+ posts
How to learn NASM?
I understand a little although I would like a guidenasm is pretty much the python of assembly languages in terms of easiness to learnhttps://cs.lmu.edu/~ray/notes/nasmtutorial/I saw that I guess if you really want to, you could use this tutorial I dug up somehow:I don't know any other assembly languages. Which should I learn? If you learn a different assembly language first and it will be much easier. Do you know any other assembly languages?
here are some programs I wrote in nasm, you can read those to try and understand it
- imfh
-
1000+ posts
How to learn NASM?
Here's an assembly program I wrote for a class on the LC3. I commented it pretty well, so hopefully that helps some. If you want to learn more about the instruction set of the LC3, you can skip ahead to page five (525) of this pdf I found. If you have questions, feel free to ask! There is no subtract, multiplies, or equals instruction, so they have to be implemented manually.
I'm not completely sure if it is a good language to learn assembly from, however. Half of my class was about understanding how the computer actually interprets the instructions on the hardware level all the way down at the transistors, which was actually really interesting. It's possible the language was chosen to help more with learning about the hardware rather than assembly programming.
If you actually want to run a program like this, there are instructions for downloading and running the emulator here (it's a .jar file). To run a program, do what it tells you to do for assembling and loading the lc3os, but with different file names (“as program.asm”, “ld program.obj”). Note that you will need to load both the lc3os and the program for it to work correctly.
Ignore the red boxes in the code, I don't think bbcode has a better assembly syntax highlighter than nasm.
The BR instruction looks at the result of the last time a value was saved to a register. BRz will “branch” to a label if the last saved value was a zero.
I've added some extra comments to explain what things do. I started them with ;# to catch attention.
I can't have this here forever since it is possible the same assignment will be reused, so if you want to keep it, you might want to save a copy on your computer.
(removed code, I may put it back later with chunks taken out.)
I'm not completely sure if it is a good language to learn assembly from, however. Half of my class was about understanding how the computer actually interprets the instructions on the hardware level all the way down at the transistors, which was actually really interesting. It's possible the language was chosen to help more with learning about the hardware rather than assembly programming.
If you actually want to run a program like this, there are instructions for downloading and running the emulator here (it's a .jar file). To run a program, do what it tells you to do for assembling and loading the lc3os, but with different file names (“as program.asm”, “ld program.obj”). Note that you will need to load both the lc3os and the program for it to work correctly.
Ignore the red boxes in the code, I don't think bbcode has a better assembly syntax highlighter than nasm.
The BR instruction looks at the result of the last time a value was saved to a register. BRz will “branch” to a label if the last saved value was a zero.
I've added some extra comments to explain what things do. I started them with ;# to catch attention.
I can't have this here forever since it is possible the same assignment will be reused, so if you want to keep it, you might want to save a copy on your computer.
(removed code, I may put it back later with chunks taken out.)
Last edited by imfh (May 29, 2021 14:05:34)
- Raihan142857
-
1000+ posts
How to learn NASM?
this pdf I found. If you have questions, feel free to ask! There is no subtract, multiplies, or equals instruction, so they have to be implemented manually.this doesn't look much like nasm as far as I know… what type of assembly is it? Here's an assembly program I wrote for a class on the LC3. I commented it pretty well, so hopefully that helps some. If you want to learn more about the instruction set of the LC3, you can skip ahead to page five (525) of
I'm not completely sure if it is a good language to learn assembly from, however. Half of my class was about understanding how the computer actually interprets the instructions on the hardware level all the way down at the transistors, which was actually really interesting. It's possible the language was chosen to help more with learning about the hardware rather than assembly programming.
If you actually want to run a program like this, there are instructions for downloading and running the emulator here (it's a .jar file). To run a program, do what it tells you to do for assembling and loading the lc3os, but with different file names (“as program.asm”, “ld program.obj”). Note that you will need to load both the lc3os and the program for it to work correctly.
Ignore the red boxes in the code, I don't think bbcode has a better assembly syntax highlighter than nasm.
The BR instruction looks at the result of the last time a value was saved to a register. BRz will “branch” to a label if the last saved value was a zero.
I've added some extra comments to explain what things do. I started them with ;# to catch attention.
I can't have this here forever since it is possible the same assignment will be reused, so if you want to keep it, you might want to save a copy on your computer.(code)
- imfh
-
1000+ posts
How to learn NASM?
It's just LC3 assembly. this doesn't look much like nasm as far as I know… what type of assembly is it?
Last edited by imfh (May 21, 2021 18:03:57)
- Discussion Forums
- » Advanced Topics
-
» How to learn NASM?