-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand_DP.asm
More file actions
49 lines (47 loc) · 1.39 KB
/
command_DP.asm
File metadata and controls
49 lines (47 loc) · 1.39 KB
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
; 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
;
; Procedura obsługi polecenia DP [begin-address [end-address]]
; Zrzuca zawartość pamięci programu hosta
;-----------------------------------------------------------
; DP [begin-address [end-address]]
if USE_HELP_DESC
dw s_help_DP
endif
command_dump_host_ROM:
clr A
mov R2, A
mov R3, A
mov R4, #(total_program_size - 1) shr 8
mov R5, #(total_program_size - 1) and 0FFh
acall get_address_range
; mamy zakres zrzutu: R2:R3 bajtów poczynając od R4:R5
mov DPTR, #cb_dump_ROM
ajmp dump_hex_file
cb_dump_ROM:
mov R0, #input
mov DPH, R4
mov DPL, R5
cb_dump_ROM_loop:
clr A
movc A, @A + DPTR
inc DPTR
mov @R0, A
inc R0
djnz R7, cb_dump_ROM_loop
mov DPTR, #cb_dump_ROM
sjmp cb_ret_input_OK