Notice: Trying to access array offset on value of type bool in /mnt/cpcwiki-httpdocs/includes/libs/IPSet.php on line 243

Notice: Trying to access array offset on value of type bool in /mnt/cpcwiki-httpdocs/includes/libs/IPSet.php on line 246

Notice: Trying to access array offset on value of type bool in /mnt/cpcwiki-httpdocs/includes/libs/IPSet.php on line 243

Notice: Trying to access array offset on value of type bool in /mnt/cpcwiki-httpdocs/includes/libs/IPSet.php on line 246

Notice: Trying to access array offset on value of type null in /mnt/cpcwiki-httpdocs/includes/profiler/SectionProfiler.php on line 104

Notice: Trying to access array offset on value of type null in /mnt/cpcwiki-httpdocs/includes/profiler/SectionProfiler.php on line 104

Notice: Trying to access array offset on value of type null in /mnt/cpcwiki-httpdocs/includes/profiler/SectionProfiler.php on line 105

Notice: Trying to access array offset on value of type null in /mnt/cpcwiki-httpdocs/includes/profiler/SectionProfiler.php on line 105

Notice: Trying to access array offset on value of type null in /mnt/cpcwiki-httpdocs/includes/profiler/SectionProfiler.php on line 106

Notice: Trying to access array offset on value of type null in /mnt/cpcwiki-httpdocs/includes/profiler/SectionProfiler.php on line 106
Programming:Next / previous line calculation - CPCWiki
Last modified on 17 April 2015, at 12:47

Programming:Next / previous line calculation

Revision as of 12:47, 17 April 2015 by Prodatron (Talk | contribs) (Without Firmware)

Next line

This routines calculate the next line from the given address.

Firmware

Input: HL=Address

Output: HL=Address of the next line

Destroyed: AF

SCR_NEXT_LINE equ #BC26

call SCR_NEXT_LINE

Without Firmware

Input: HL=Address

Output: HL=Address of the next line

Destroyed: AF,BC

; Richard Fairhurst 
; October 1997 
; 
;*** Next line down from HL *** 

.nline  ld a,8 
        add h 
        ld h,a 
        ret nc
        ld bc,#c050
        add hl,bc 
        ret

Previous line

This routines calculate the previous line from the given address.

Firmware

Input: HL=Address

Output: HL=Address of the previous line

Destroyed: AF

SCR_PREV_LINE equ #BC29

call SCR_PREV_LINE