Skip to content

Commit

Permalink
Halt Z80 on SYS_reset() / SYS_hardReset()
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane-D committed Dec 15, 2024
1 parent 1fcfb6f commit 617e3cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Binary file modified lib/libmd.a
Binary file not shown.
18 changes: 14 additions & 4 deletions src/sys_a.s
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,32 @@ func SYS_assertReset


func SYS_reset
move #0x2700,%sr
move.l (0),%a7
move #0x2700,%sr
move.l (0),%a7

move %sp, %usp
sub #USER_STACK_LENGTH, %sp // configure a USER_STACK_LENGTH bytes user stack at bottom, and system stack on top of it

move.l #0xA11100,%a0 /* Z80_HALT_PORT */
move.w #0x0100,%d0
move.w %d0,(%a0) /* HALT Z80 */
move.w %d0,0x0100(%a0) /* END RESET Z80 */

jmp _reset_entry


func SYS_hardReset
move #0x2700,%sr
move.l (0),%a7
move #0x2700,%sr
move.l (0),%a7

move %sp, %usp
sub #USER_STACK_LENGTH, %sp // configure a USER_STACK_LENGTH bytes user stack at bottom, and system stack on top of it

move.l #0xA11100,%a0 /* Z80_HALT_PORT */
move.w #0x0100,%d0
move.w %d0,(%a0) /* HALT Z80 */
move.w %d0,0x0100(%a0) /* END RESET Z80 */

jmp _start_entry


Expand Down

0 comments on commit 617e3cb

Please sign in to comment.