I wrote a small test program on mikroPascal PRO for dsPIC30/33 and PIC24.
Code: Select all
program const_in_asm;
const
impl = 257;
expl: word = 257;
begin
{ Main program }
asm
mov #_impl, w0
mov #_expl, w1
mov #257, W2
mov #$0101, W3
end;
Code: Select all
_main:
MOV #2048, W15
MOV #6142, W0
MOV WREG, 32
MOV #1, W0
MOV WREG, 52
MOV #4, W0
IOR 68
;const_in_asm.mpas,5 :: begin
;const_in_asm.mpas,8 :: mov #_impl, w0
MOV #1, W0
;const_in_asm.mpas,9 :: mov #_expl, w1
MOV #1, W1
;const_in_asm.mpas,10 :: mov #257, W2
MOV #257, W2
;const_in_asm.mpas,11 :: mov #$0101, W3
MOV #257, W3
;const_in_asm.mpas,13 :: end.
L_end_main:
L__main_end_loop:
BRA L__main_end_loop
; end of _main