.z80 aseg org 100h st: ld de,(6) ;bottom of bg ld hl,0100h ;end of page 1 scf ccf sbc hl,de ;how much to move ld b,h ld c,l pat1: ex de,hl pat2: ld de,ended ;buffer area ldir ;move it pat3: nop nop nop ld a,0 ld (pat1),a ;dont swap ld a,21h ld (pat2),a ;ld hl, not de ld a,11h ld (st),a ;ld de,nn instead of ld de,(nn) ld a,0c3h ld (pat3),a ;jp 0 ld sp,100h ld c,9 ld de,str call 5 ld de,(6) ld (st+1),de ld hl,100h sbc hl,de inc h ex de,hl ld a,d rrca rrca rrca rrca call prt ld a,d call prt jp 0 prt: push de and 0fh add a,'0' cp ':' jr c,over add a,7 over: ld e,a ld c,2 call 5 pop de ret str: db 'Save length is (hex) $' ended: end st