General > General Technical Chat

ASM programming is FASCINATING!

<< < (24/24)

Ian.M:
Take MPLAB 8.92 and select a PIC with the desired core and as much program memory as possible.   Open the program memory view, and make sure the Machine tab (at bottom) is selected and the Disassembly column is visible.  Next, right  click and fill with a sequence, starting from address 0x000, opcode 0x000, and it will fill all memory with incrementing opcodes, show you how they map to instructions and where the gaps are.  Some gaps are real, others aren't.  e.g. the hardware doesn't have a CLRW opcode, it and CLRF are really special cases of the undocumented CLR opcode, which if it was treated as any other instruction with a target register would take a F or W modifier bit, so  CLRW is really CLR <dont_care_reg>, W 'under the hood'.  Compare with the  INSTRUCTION SET SUMMARY table from the datasheet and you'll start getting clues to the instruction decoder architecture.

For further enlightenment you'll have to set up to execute undocumented opcodes on real hardware, feeding in preconditions and dumping results.  If you've got the use of a full chip level reverse engineering lab so you can decap the die and microprobe it running or even use a scanning electron microscope in voltage contrast mode, you can make definitive conclusions, but most of us have to settle for educated guesses backed up by as much of the IC state as we can read back or infer.

Berni:

--- Quote from: MK14 on August 02, 2020, 02:38:20 pm ---
--- Quote from: VK3DRB on August 02, 2020, 05:59:03 am ---
--- Quote from: MK14 on August 01, 2020, 04:44:33 pm ---Yes, assembler, can be a rather hard and daunting subject, to master....

--- End quote ---

Rubbish. Assembler is easy. Just read the manual that came with the assembler or macro assembler. These compilers are not hard to master.

--- End quote ---

They are NOT compilers.

Source:
https://www.geeksforgeeks.org/difference-between-compiler-and-assembler/

--- End quote ---

No need to get too pedantic about the terminology.

If one is to be pedantic then a thing that takes C code and spits out a working EXE file can't be called a compiler. Even tho this is what pretty much everyone will understand when they hear compiler.

The compiler just turns the C source files into object files. These things can't be executed yet. So they need to be fed trough an assembler to turn it into machine code. Yet you still can't run that because all you got now is a bunch of blobs of machine instructions. This needs to be fed trough a linker to actually put them all together into memory and hook them up together. So now you got a memory image that would run, but still can't be put inside a EXE. So it must be put trough a loader/output generator to package it up into an executable file along with all the information required to load it into memory and start it.

But everyone just calls it compiling, even tho that's technically just one small part of the process.

Benta:

--- Quote from: MK14 on August 02, 2020, 04:06:07 pm ---Please, let's try and get this thread, back on track!

--- End quote ---

How? You're one of the contributors that derailed it completely. I understand why the OP has stepped back.

eti:


Derailment *and* a train wreck in one fell swoop - amazing. How is it that people can't just keep shtum and let others have a viewpoint without "correcting" them?

I'll leave you lot to argue whilst the contributors contribute, I'll pop along again soon and see if we've actually progressed with a coherent, calm interchange, at all...

Navigation

[0] Message Index

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod