thank you for your help
i think there is miss understand iwant to built my own small program to transfer asm to hex, if someone have an idea
It's called an assembler - and it's not going to be that small (not if you want it to be any use).
THANK YOU Nigel Goodwin FOR YOUR REPLY
Is it yours WinPicProg ?
How can I programming such as WinPicProg?(an assembler like what you said), i want to make a program like WinPicProg but for pic 16F84 ONLY FOR THE MOMMENT Teach me how to do this?
You would need to translate the ASM into opcodes, and figure out what kind of memory you are transferring, and figure out the registers and the addresses for each one.
You would need to do code / data allocation and reference direct memory addresses for each one.
You would then need to optimise your output based on the memory stack and chip model, figure out the port / peripheral feature offset addresses.
I wrote a 16 bit dos and 32 bit win32 assembler which output to direct machine code, took me 2 years to get them both working correctly, after a lot of bits and bytes and direct, indirect, memory addressing.
I cant remember 99% of it now though!
It's too time consuming to re-invent the wheel!
Wilksey
WinPicProg is a programmer, NOT an assembler - the assembler is MPASM - as provided free by MicroChip. MPASM converts the source code to HEX, WinPicProg then transfers the HEX file to the target PIC.
If you're interested in programming your own assembler, I would recommend googling "how to write an assembler".
There is lots of information out there; one link I found quickly was this: How To Write An Assembler - comp.lang.asm.x86 | Google Groups
Ultimately, however, this is a programming question in an electronics forum--there is lots on programming in here, but mostly centred around programming microcontrollers, not necessarily programming the tools used to program microcontrollers.You may have better luck searching in some programming forums.
Good luck,
Torben
Maybe he would like us to hand assemble his code for him?Please, pardon my ignorance, but what exactly would you like us to do with this information?
Unless you understand how an assembler works, then yes, it is very very difficult to construct one.
Please, pardon my ignorance, but what exactly would you like us to do with this information?
void main() {
TRISB=0B00000000;
PORTB=0B00000001;
}
:020000001528C1
:0C00060083120D088A000C08820008001C
:1000120003208A110A128000840A8C0A03198D0AAD
:08002200C003031D09280800BA
:0C002A00831686010130831286001A281C
:02400E00FA3F77
:00000001FF
This format produces one 8-bit hex file with a low byte, high byte combination. Since each address can only contain 8 bits in this format, all addresses are doubled.
Each data record begins with a 9-character prefix and ends with a 2-character checksum. Each record has the following format:
:BBAAAATTHHHH....HHHCC
where:
BB A two digit hexadecimal byte count representing the number of data bytes that will appear on the line.
AAAA A four digit hexadecimal address representing the starting address of the data record.
TT A two digit record type that will always be '00' except for the end-of-file record, which will be '01'.
HH A two digit hexadecimal data byte, presented in low byte/high byte combinations.
CC A two digit hexadecimal checksum that is the two's complement of the sum of all preceding bytes in the record.
Hmmmm,
Might we tell him when the assembler ( edit : or disassembler ) will be ready to use ... Microchip will have stopped its 16F84 production for a while ???
The HEX file format is explained in the MPASM helpfile, under HEX file format in the index.
Code:This format produces one 8-bit hex file with a low byte, high byte combination. Since each address can only contain 8 bits in this format, all addresses are doubled. Each data record begins with a 9-character prefix and ends with a 2-character checksum. Each record has the following format: :BBAAAATTHHHH....HHHCC where: BB A two digit hexadecimal byte count representing the number of data bytes that will appear on the line. AAAA A four digit hexadecimal address representing the starting address of the data record. TT A two digit record type that will always be '00' except for the end-of-file record, which will be '01'. HH A two digit hexadecimal data byte, presented in low byte/high byte combinations. CC A two digit hexadecimal checksum that is the two's complement of the sum of all preceding bytes in the record.
i choose the pic16F84 to work on it because it has only 35 Instructions
i didn't understand you very well
so the instruction Consists of 14bit that's mean 2 byte and the memory of the pic16F84 is only 8bit so the instructon divided in to 2 lines in the memory but the thing which i didn't understand is how i return the hex to assembly instruction could you explain to me how ? from the given example above
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?