Skip to content

Commit

Permalink
Added GET_AHL24
Browse files Browse the repository at this point in the history
  • Loading branch information
breakintoprogram authored Apr 16, 2023
1 parent 49d3388 commit f47beae
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/misc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; Title: AGON MOS - Miscellaneous helper functions
; Author: Dean Belfield
; Created: 24/07/2022
; Last Updated: 20/03/2023
; Last Updated: 15/04/2023
;
; Modinfo:
; 03/08/2022: Added SET_AHL24 and SET_ADE24
Expand All @@ -11,6 +11,7 @@
; 19/11/2022: Added exec24 and params for exec16/24 functions
; 09/03/2023: Added wait_timer0
; 20/03/2023: Function exec24 now preserves MB
; 15/04/2023: Added GET_AHL24

INCLUDE "macros.inc"
INCLUDE "equs.inc"
Expand All @@ -22,6 +23,7 @@
XDEF SWITCH_A
XDEF SET_AHL24
XDEF GET_AHL24
XDEF SET_ADE24
XDEF __exec16
Expand Down Expand Up @@ -49,13 +51,22 @@ SWITCH_A: EX (SP), HL ; Swap HL with the contents of the top of the stack
; Set the MSB of HL (U) to A
;
SET_AHL24: PUSH HL
SET_AHL24: PUSH HL
LD HL, 2
ADD HL, SP
LD (HL), A
POP HL
RET

; Get the MSB of HL (U) in A
;
GET_AHL24: PUSH HL
LD HL, 2
ADD HL, SP
LD A, (HL)
POP HL
RET

; Set the MSB of DE (U) to A
;
SET_ADE24: EX DE, HL
Expand Down

0 comments on commit f47beae

Please sign in to comment.