johnson lai
johnson lai

Reputation: 1036

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:-

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

Upvotes: 3

Views: 2138

Answers (1)

superoo7
superoo7

Reputation: 99

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.

Upvotes: 4

Related Questions