File: seek.asm

package info (click to toggle)
z80asm 1.8-2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 356 kB
  • sloc: ansic: 4,440; asm: 299; makefile: 46
file content (55 lines) | stat: -rw-r--r-- 1,409 bytes parent folder | download | duplicates (4)
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
; seek.asm - seek example
; Copyright 2005 jancasper
;
; This file is part of z80asm.
;
; Z80asm 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.
;
; Z80asm 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 this program.  If not, see <http://www.gnu.org/licenses/>.

; this org not strictly	necessary
	org   $4000

; load an existing rom,	16384 bytes in size, which was originally assembled at $4000
	incbin 'disk.rom'

; seek back to absolute	position 16 in the output file
	seek  $10
; since	the rom	is loaded at addres $4000, code	at $10 should be referred to as	$4010
	org   $4010

; the following	instructions will overwrite the	code at	$10
	jp    diskio
	jp    dskchg
	jp    getdpb
	jp    choice
	jp    dskfmt
	jp    drvoff

	seek  $3410
	org   $7410

diskio:	
dskchg:	
getdpb:	
choice:	
dskfmt:	
drvoff:
	add   a,2
	add   2
	sub   a,2
	sub   2

	ei
	ret

; The result of	this will be a new, patched binary rom file that is still exactly 16384	bytes in size.