-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommand_LR_VR.asm
66 lines (62 loc) · 1.71 KB
/
command_LR_VR.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
; This file is part of Programator.
;
; Programator is free software: you can redistribute it and/or
; modify it under the terms of the GNU General Public License as
; published by the Free Software Foundation, either version 3 of the
; License, or (at your option) any later version.
;
; Programator is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with Programator. If not, see <https://www.gnu.org/licenses/>.
;
; Copyright (c) 2022, 2024 Aleksander Mazur
;
; Procedury obsługi poleceń LR i VR
; LR zapisuje dane do RAMu hosta, a VR weryfikuje je
;-----------------------------------------------------------
; LR
if USE_HELP_DESC
dw s_help_LR
endif
command_load_host_RAM:
setb F0
sjmp command_lv_host_RAM
;-----------------------------------------------------------
; VR
if USE_HELP_DESC
dw s_help_VR
endif
command_verify_host_RAM:
clr F0
command_lv_host_RAM:
mov DPTR, #cb_lv_host_RAM
ajmp load_hex_file
; Callback dla load_hex_file
; F0=1 -> load
; F0=0 -> verify
cb_lv_host_RAM:
mov A, R4
jnz cb_lv_code_A ; adresy w RAM >= 100h nie są dostępne
mov A, R5
mov R1, A
; load -> kopiowanie R7 bajtów spod R0 do R1
; verify -> porównywanie R7 bajtów od R0 z tymi od R1
cb_lv_host_RAM_loop:
mov A, @R0 ; A = kolejny bajt z bufora odebranego z rekordu Intel Hex
jnb F0, cb_lv_host_RAM_no_copy
mov @R1, A
cb_lv_host_RAM_no_copy:
mov R2, A
mov A, @R1
cjne A, AR2, cb_lv_code_V
inc R0
inc R1
djnz R7, cb_lv_host_RAM_loop
sjmp cb_lv_code_G
cb_lv_code_A:
mov A, #'A'
ret