Code:
pause 2000
Serout2 PORTb.7,84,["ready",13,10]
addr var word
inbuff var byte[30]
buff var byte[30] $4f0
lb var byte
hb var byte
lc var byte
lp var word
Clear
goto StartLoop ' Required
String2:
@ db 0x3f,0,0,0xfc,0xfc,0x3f,0x66,0x55,0,0
asm
org 0x5170
dw 0x003F,0xFC00,0x3FFC,0x5566,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000;,0x00
org 0x0200
ENDASM
asm
GetAddress macro Label, Wout
CHK?RP Wout
movlw low Label ; get low byte
movwf Wout
movlw High Label ; get high byte
movwf Wout + 1
endm
ENDASM
StartLoop:
Serout2 PORTb.7,84, [13,10,"db data " ]
@ GetAddress _String2 ,_addr
for lc=0 to 3
Serout2 PORTb.7,84, [13,10,"address ",hex4 addr ]
readcode addr ,lb
addr=addr+1
Serout2 PORTb.7,84, [" lb ",hex2 lb," address ",hex4 addr ]
readcode addr ,hb
Serout2 PORTb.7,84, [" hb ",hex2 hb ]
addr=addr+1
next
Serout2 PORTb.7,84, [13,10,"dw data as byte " ]
addr =$5170
for lc=0 to 3
Serout2 PORTb.7,84, [13,10,"address ",hex4 addr ]
readcode addr ,lb
addr=addr+1
Serout2 PORTb.7,84, [" lb ",hex2 lb," address ",hex4 addr ]
readcode addr ,hb
Serout2 PORTb.7,84, [" hb ",hex2 hb ]
addr=addr+1
next
Serout2 PORTb.7,84, [13,10,"dw data as word " ]
;@ GetAddress _String3 ,_addr
addr =$5170
for lc=0 to 3
Serout2 PORTb.7,84, [13,10,"address ",hex4 addr ]
readcode addr ,lp
addr=addr+2
Serout2 PORTb.7,84, [" lp ",hex4 lp]
next
addr =$5177
readcode addr ,lb
Serout2 PORTb.7,84, [13,10,"odd address ",hex4 addr ]
Serout2 PORTb.7,84, [" high ",hex2 lb ]
addr =$5176
readcode addr ,lb
Serout2 PORTb.7,84, [13,10,"even address ",hex4 addr ]
Serout2 PORTb.7,84, [" low ",hex2 lb ]
goto StartLoop ' Repeat
end
output
Bookmarks