!
!   utils.s  Miscelaneous low level routines.
!
!**********************************************************************
!
!   Peek and Poke in alternate address space.
!
!**********************************************************************
.seg "text"
.global ←io←peek
←io←peek:
!
! %o0 holds address. Access IO alternate space
! returns value in %o0
!
srl   %o0, 2, %o0
sll   %o0, 2, %o0   ! makes sure the access is word aligned
lda  [%o0] 0x80, %o0
retl
nop
.global ←io←poke
←io←poke:
!
! %o0 holds address %o1 holds value. Access IO alternate space
!
srl   %o0, 2, %o0
sll   %o0, 2, %o0   ! makes sure the access is word aligned
sta  %o1, [%o0] 0x80
retl
nop
!**********************************************************************
!
!   Trap 0x40 to enter the debugger.
!
!**********************************************************************
.seg "text"
.global ←Trap0x40
←Trap0x40:
ta %g0 + 0x40
nop
retl
nop