Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integer constants in PIC assembly: decimal vs. hex

I am doing programming in PIC based micro controller (microchip). The PIC model that I used is PIC16.

I have issue on classifying the data type

e.g. MOVLW xxxx where xxxx are the following:-

  • 0x23: hexadecimal

  • 23: decimal

  • D'20': hexadecimal

  • 1Bh: hexadecimal

  • b'00101100': binary

Why are 1Bh, D'20', 0x23 hexadecimal? Is there any other way to show hexadecimal in PIC assembly

like image 930
johnson lai Avatar asked Mar 05 '26 07:03

johnson lai


1 Answers

0x23 hexadecimal

23 hexadecimal

D'20' decimal

1Bh hexadecimal

b'00101100' binary

This is the correct combination. In assembly, by default 23 is hexadecimal. D in D'20' indicates that the data type is decimal. Same to 1Bh where h indicates hexadecimals.

like image 145
superoo7 Avatar answered Mar 06 '26 23:03

superoo7



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!