BCF f,b = 01 00bb bfff ffff
STATUS = 0003 = 0011(Binary)
RP0 = 0005 = 0101(Binary)
01 00bb bfff ffff
=
01 0010 1000 0011
= 1283 (Compiled HEX code for BCF STATUS, RP0)
1283 Hex =
01 0010 1000 0011
=
01 00bb bfff ffff
=
000 0011 = 03 = Status Register
10 1 = 05 = RP0 Bit
01 00 = BCF
Ok,
Take this example:
BCF f, b - f = the FILE register, so STATUS for example, b = the 8 bit address within the FILE register, we will use RP0.Code:BCF f,b = 01 00bb bfff ffff
Looking at the STATUS and RP0 from the MPASM INC file we can see that:
Code:STATUS = 0003 = 0011(Binary) RP0 = 0005 = 0101(Binary)
So from the original code we can assemble this as:
Code:01 00bb bfff ffff = 01 0010 1000 0011 = 1283 (Compiled HEX code for BCF STATUS, RP0)
In reverse (Disassemble):
Code:1283 Hex = 01 0010 1000 0011 = 01 00bb bfff ffff = 000 0011 = 03 = Status Register 10 1 = 05 = RP0 Bit 01 00 = BCF
Nigel, please correct me if I am wrong on this example and / or any information I have missed.
Wilksey
bsf 03h,5 ;Go to Bank 1
movlw 00h ;Put 00000 into W
movwf 85h ;Move 00000 onto TRISA – all pins set to output
bcf 03h,5 ;Come back to Bank 0
movlw 01h ;Write 01h to the W register. In binary this is 00001, which
;puts a ‘1’ on bit 1 (pin 17) while keeping the other pins to ‘0’
movwf 05h ;Now move the contents of W (02h) onto the PortA, whose
;address is 05h
void main() {
TRISB=0B00000000;
PORTB=0B00000001;
}
:020000001528C1
:0C00060083120D088A000C08820008001C
:1000120003208A110A128000840A8C0A03198D0AAD
:08002200C003031D09280800BA
:0C002A00831686010130831286001A281C
:02400E00FA3F77
:00000001FF
Code::020000001528C1 :0C00060083120D088A000C08820008001C :1000120003208A110A128000840A8C0A03198D0AAD :08002200C003031D09280800BA :0C 002A 00 [COLOR="red"]8316[/COLOR] 8601 0130 8312 8600 1A28 1C :02400E00FA3F77 :00000001FF
So let's take the instruction BSF
01 0110 1000 0011
1683H
but when i looked for it in the hex file WHICH I BUT IT above but i didn't find it!!
i understand you now
:0C =12 in decimal representing the number of data bytes that will appear on the line.
002A =which address??
00 =which type?????
8316 8601 0130 8312 8600 1A28 =A two digit hexadecimal data byte, presented in low byte/high byte combinations.
1C=checksum
I've read this entire thread and have no idea what the OP wants.
Ok,
Take this example:
BCF f, b - f = the FILE register, so STATUS for example, b = the 8 bit address within the FILE register, we will use RP0.Code:BCF f,b = 01 00bb bfff ffff
Looking at the STATUS and RP0 from the MPASM INC file we can see that:
Code:STATUS = 0003 = 0011(Binary) RP0 = 0005 = 0101(Binary)
So from the original code we can assemble this as:
Code:01 00bb bfff ffff = 01 0010 1000 0011 = 1283 (Compiled HEX code for BCF STATUS, RP0)
In reverse (Disassemble):
Code:1283 Hex = 01 0010 1000 0011 = 01 00bb bfff ffff = 000 0011 = 03 = Status Register 10 1 = 05 = RP0 Bit 01 00 = BCF
Nigel, please correct me if I am wrong on this example and / or any information I have missed.
Wilksey
MOVLW 11 00xx kkkk kkkk
MOVLW 11 0000 0000 0000
= 3000 Hex
3000 Hex = 11000000000000
Closest match to 1100 is MOVLW (11 00xx)
0000 0000 = kkkk kkkk = 0
00 = xx
11 00 = MOVLW
It can be just as difficult to make a disassembler as it can to make an assembler.
MOVLW?
Move Literal to W (Working Register) aka Accumulator.
Code:MOVLW 11 00xx kkkk kkkk
xx means "dont care" so we can assume 00 for this.
kkkk kkkk means literal constant, in this case 00 so we can assume all 0's for this.
Code:MOVLW 11 0000 0000 0000 = 3000 Hex
In reverse (Disassemble):
Code:3000 Hex = 11000000000000 Closest match to 1100 is MOVLW (11 00xx) 0000 0000 = kkkk kkkk = 0 00 = xx 11 00 = MOVLW
Wilksey
Actually a disassembler for the 14 bit (and 12 bit) PIC's is VERY easy to do, which is why I happened to write one, and integrate it in PicProg (the DOS predecessor to WinPicProg). In fact the first version of PicProg was written while I was awaiting the arrival of a PCB for a programmer from Dontronics in Australia - which took about 5 days - I added the disassembler in the later part of the 5 days, as I'd finished the programmer software (with the exception of testing it).
thank you very much Nigel Goodwin
i will see the code if there is ambiguity i will ask you
It is easy if you have the understanding in the beginning, but for a "newbie" it can be difficult.
Wilksey
your pic Software support 4 Pics
you divided the command to 4 parts
Pattern : $3000; Mask : $fc00; CmdType : 4; Mnemonic : 'MOVLW'
What does it mean Mask and and CmdType(command Type) why you gave it this form?
you 11 years that's mean you have a good exprience and it is very easy to tou to write a compiler for the pic16F84
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?