80-Bus News


November-December 1983, Volume 2, Issue 6

Page 58 of 67

INTEL-HEX dump program

8400 8800

8880 9000

9010 9200 E000 oooD


8000 8004

8007 8009 800C 800F 8012

ED 31

3E 32 32 32 32

TB 9200 E000

8881 9010 8881

M-80 20 Nov 1983 00:43 PAGE

+280 Title INTEL-HEX dump program

» Comment

INTEL-HEX DUMP V1.3, A. M. Davies Written source supplied, transcribed DRH 19/11/83.

This program dumps out memory contents to the screen and to the serial 1/0 (if “P is active) in INTEL-HEX format. The program runs from 8000H and requires two parametera to be entered before running – the start address of the memory area to be dumped must be in locations 8800H and 8801H (LSB first), and the number of 16 byte blocks to be dumped must be in locations 9000H and 9001H (LSB first). For example, 8800H and 8801H might contain OOH and O1H, and 9000H and 9001H might contain 80H and OOH. This gives the starting address as O{00H with a total of 80H blocks, ie, 128 * 16 = 2048 bytes to be dumped. Note that the start address is updated during the running of the program, but the number of blocks value is not. This facilitates further dumps from the next area of memory without requiring further entry of parameters.

The program was originally written to enable memory contents to be dumped to an EPROM programmer, and could no doubt be improved and made much more user-friendly. "

buffer equ startadd equ

8400h 8800h

16 byte data buffer

Start address of data to be dumped. N.B. This value ince as data is dumped.

16 byte block counter Number of 16 byte blocks to dump. Not incremented by program.

Same as recent!

recent! equ recnum equ

8880h 9000h

recent2 equ stcksv equ 9200h newstack equ 0e000h er equ Odh

lf equ Oah

904 Oh



org 8000h

ld (stcksv) ,ap ld sp, newstack

Save the old stack Set new stack pointer

tm on

start: id a,O0 3; Clear recent! ... ld (recenti),a la (recenti+1),a 1d (recent2),a } ee. and recent2 ld (recenti+1),a


8015 8018 801B 801D

8020 8023 8026 8027 802A 802D 8028


8034 8038 8039 803D 803E 8040

8042 8045 8049

804A B04D 804P

8052 8054 8056 8058 805B 805E

8061 8062

8065 8068 8069 806C 806D

806F 8070 8071 8074

8075 8076 8077 8078 8079

2A 14



2A 19 22 2A 19 22

2h 13 BT 20 cD ED cg cD 1B cD 16 cD 2a eD cD ai


23 10

dump program

8400 804A

0010 8880

8880 8800


9000 5B 9010

53 9010

52 D3

80BE TB 9200

8083 3A 8075

00 10 10 808E 8880 8085 808E 8400





loadbuff: 1d ld ldir call

1d 1d add ld ld add ld

ld ld ine 1d or sabe dr

call ld ret

typerec: call 1d eall

14 14 ld call 1d call

xor call

ld typebyte: 1d call ine djnz

xor sub call ret

conout: push push push push 1d


20 Nov 1983

hi, (startadd) de, buffer



hl, (recenti ) nl, de (recent! ), hl hl, (startadd) hi,de (startadd),hi

hl, (recnum) de, (recent?) de (recent2),de a

hl, de

nz, loadbuff

typendfl sp, (stckav)

terlf e,’s’ conout





hl, (recent ) tcaddr

a tobyte

hl, buffer a, (nl) tebyte

hl typebyte

a d tbyte

hl de be af c,2


an om em om em ee Om am om nm te oe On ron te an

an om on em om em ae


00:43 PAGE 1-1

Get the start pointer Copy data to buffer

Type out the data

Update the pointer in recent!

Update the value in startadd

Get no. of blocks to send Get block count value ..

++ bump the count ..

«+ and resave

Clear any carry flag

Test for end

If count <> size, do next ..

+. else end

Send a CR LF Send a block marker

Clear checksum to zero Set block length in <B> Set block length in <A> Send the block

Send <HL> as the address

Clear <A>, then send <A> .. +» as the block type

Get buffer in <HL> Get a byte ..

»-. and send it Point to next

Do for <B> times

Clear <A> Get checkaum .. +» and send it

Save the registers

Load <C> with conout


This is an OCR’d version of the scanned page and likely contains recognition errors.

Page 58 of 67