Answer :
a) The contents of address 0x22 in PIC18F after assembling the given code are 07H.
b) The contents of address 0x22 in PIC18F after assembling the given code are 20H.
1. In the first code snippet, the ORG directive sets the origin address to 0x20. Following that, the DB directive specifies byte values to be stored in consecutive memory locations. Thus, the byte values 00H, 05H, 07H, 00H, and 03H are sequentially stored in addresses 0x20, 0x21, 0x22, 0x23, and 0x24 respectively. Therefore, the content of address 0x22 is 07H.
2. In the second code snippet, the ORG directive again sets the origin address to 0x20. However, this time the DW directive specifies word values to be stored in consecutive memory locations. So, the word values 0702H, 123FH, 7020H, and 0000H are sequentially stored in addresses 0x20, 0x22, 0x24, and 0x26 respectively. Since we are interested in the content of address 0x22, it contains the lower byte of the second word, which is 20H. Therefore, the content of address 0x22 is 20H.