Posts: 89
Threads: 11
Joined: Dec 2015
Reputation:
3
Time for my semi-monthly dumb question.
What does an assembler do, and more specifically, how does one use an assembler to either implement others' custom code or insert one's own?
Is there a difference between using an assembler and generating the opcodes via changing the bytes in hex?
Nearly all of the assembly tutorials point to learning the assembly language, and while obviously, that's required to understand the code...I feel like something is being skipped.
Posts: 23
Threads: 4
Joined: Sep 2015
Reputation:
0
I know I'm still a rank amateur at this. So, take it for what it's worth.
I just make changes in hex, and don't use the assembler.
Posts: 763
Threads: 83
Joined: Apr 2015
Reputation:
22
For the longest time I did everything in hex... and i mean EVERYTHING. I do all sorts of extensive hacks in a lot of areas, and it was all hex until recently. I really liked the granular control of adding the hex manually. It helped me see what was going on, how much space I was using, and I was worried using an assembler would create a disconnect between what I was doing and what actually went into the ROM.
Now, after spending some time using xkas (assembler), it just saves too much time to work in hex for serious code edits. The biggest difference was not having to recalculate jumps and branches manually, labels get's all of that get done for you. And since I spent so much time working only in hex. I actually think I've got a leg up on a lot of other coders who have used almost exclusively the assembler because I can troubleshoot the hex pretty easily.
It actually wasn't that hard of a jump from doing raw hex to using the assembly language for xkas. 90% of it is literally just typing out the opcodes that you would be putting into the hex anyway. Then once you learn labels, everything else is bells and whistles that are certainly helpful, but by no means necessary, and you can expand your knowledge from there at your leisure.
Bottom line: From experience I can tell you you certainly CAN do everything you want to do in hex without ever touching an assembler. But they are handy tools to learn if you're willing to put in a little work up front to learn.
Posts: 3,975
Threads: 278
Joined: Oct 2011
Reputation:
65
Outside a 2 or 3 bytes edit, not using an assembler is counter productive. An assembler remove the step of knowing the opcodes hex values. You also don't have to rewrite everything each time you edit your function. Finally, labels remove the step of manually calculating branches, JSRs and jumps.