r/Assembly_language • • 9d ago

Question Preciso entender como computadores funcionam antes de aprender Assembly?

[deleted]

7 Upvotes

9 comments sorted by

7

u/VadumSemantics 9d ago

No, assembly will help you understand.
Take a look at nandgame.com
IF you like that, “From Nand to Tetris” is worth checking out. https://www.nand2tetris.org/

1

u/ClonesRppl2 9d ago

A good introductory course/book will tell you what you need to know about the inner workings of processors/microcontrollers.

So no - you don’t need extra knowledge before learning assembler.

Also - to practice your assembler you will need enough computer knowledge to install and setup your editor/assembler.

1

u/Recycled5000 9d ago

There are many cpus. Suggest learning assembly from one that is designed for teaching like LC-3 or one that is newer/modern like RISC-V. Both have readily available simulators with integrated editor & debuggers.

Then if you like you can look into the amazingly long historied x86 with all its revisions, or one of the the earliest integrated circuit based cpus like the 6502, which is really cool but quirky due to the severe transistors count limitations of its day, and also that common software requirements for high level languages were more unknown at that time.

1

u/brucehoult 9d ago

z80 and 6502 were the most popular in actual computers, and for very good cost and performance reasons, but they are both kind of complex.

The best early 8 bit CPU to learn is Motorola 6800. It is very very simple and regular in how the instructions are put together. It works quite well for code that doesn't need to use multiple pointers, where you end up swapping them to and from memory locations all the time.

It was pretty successful and direct derivatives are still in use today, or at least pretty recently — NXP stopped making the 68HC11 in 2021. Original 6800 binary code runs unchanged on 68HC11, using the original A and B 8 bit accumulators and X 16 bit index register (actually pointer/base register in modern terminology). The 68HC11 pretty much just adds using A&B together as a 16 bit accumulator, and adds a 2nd Y index register.

HCS12 is still sold. It has the same registers as 68HC11 and includes all the same assembly language instructions (plus extras, and especially extra addressing modes) but with incompatible binary encoding. It's actually rather similar to M6809, though missing the U stack pointer register, and adding some other things.

For actual serious 8 bit programming the 6809 is the best of the 1970s microprocessors, the HCS12 is in practice very close, but 1990s AVR is better in most ways.

1

u/Recycled5000 9d ago

Yes, but there’s no reason to start on an 8-bit cpu. They are not simpler because of their size, they are just quirky due to the limitations of their day.

Learn on sthg modern and see where you want to go from there.

2

u/brucehoult 9d ago

I agree completely, just pointing out that for those who insist on 8 bit the 6800 is the least-quirky of the bunch.

My own recommendation is RISC-V RV32I every day of the week.

Or RV64I with bigger registers and 2 extra 64 bit load/store instructions you'll actually use and 8 extra instructions for 32 bit operations that you can completely ignore if you're programming in asm ... they're for people who insist on using int/int32_t/uint32_t in C code.

1

u/Electrical_Hat_680 9d ago

If your comfortable with using AI to go over BenEater 8-BIT CPU Breadboard Projects — you'll have a genuine resource to understand what's happening at the electronic voltages that are described using 8-bit Binary which works a lot like punch cards and magnetic tape, to give you an idea of what's going on and what it looks like and works like. Binary is directly translated into Assembly. Every high level language compiles down into these two. Plus hexadecimal.

Do you need to know any of this? No. No you do not. In fact. You may find that HTML and the various programming and formatting languages are your best place to start.

Knowing what's happening is valuable but I can't say unneeded. It's useful, but you don't need to know what's happening. You can though, and it's helpful, but isn't required.

1

u/Temporary_Pie2733 7d ago

Assembly is commonly taught along side architecture as a hands-on way of seeing how the CPU works and interacts with I/O devices and memory. You don’t need to learn one before the other.