view 3rdparty/utils/view/debug.a @ 3210:6353bb024571

Created makefile and defsfile for NoCan RAMMER module driver and descriptor Updated rammer.asm in the NoCan driver folder to build the NoCan version of the Driver Updated r0.asm file to create the 6MB version of the descriptor. The makefile creates a disk image with two sets of the required drivers for the 6309 and 6809's in their respective module folders. /NITROS9/6309_L2/MODULES/RBF for the 6309 files and /NITROS9/6809_L2/MODULES/RBF for the 6809 files. This will make it easier for doing a dsave from this disk image into a normal distro disk image so people have these drivers ready for when new memory upgrades allow compatible usage of the NoCan registers.
author David Ladd <drencor-xeen@users.sourceforge.net>
date Wed, 20 Dec 2017 15:15:49 -0600
parents 37fd74e6fad8
children
line wrap: on
line source

*
* Debug routines
*

 ifp1
 use os9defs.d
 endc

 psect debug_a,0,0,0,0,0
*
* Output bin byte in A to stdout
*
binout:
  pshs a,b,cc,x,y
  ldx  #8   8 bits to write out.
binout1
  ldb  #'0  
  lsra      Get next least significant bit
  adcb #0   B will be 0 or 1
  pshs b    Save the digit.
  leax -1,x
  bne  binout1
  tfr  s,x  Now, output the 8 digits.
  ldy  #8
  lda  #2
  os9  I$Write
  leas 8,s
  puls a,b,cc,x,y,pc  

  
*
* Output hex byte in A to stdout
*
hexout:
  pshs a,b,cc,x,y
  tfr  a,b
  anda #$0f
  adda #$90
  daa
  adca #$40
  daa
  pshs a
  lda  #$10
  mul
  adda #$90
  daa
  adca #$40
  daa
  pshs a
  lda  #2
  tfr  s,x
  ldy  #2
  os9  I$Write
  leas 2,s
  puls a,b,cc,x,y,pc

CCdat fcc "efhinzvc"

CCOut
  pshs cc,dp,a,b,x,y,u
  pshs a
  leau CCdat,pcr
  pulu cc,dp,a,b,x,y   Move 8 bytes to the stack.
  pshs cc,dp,a,b,x,y
  leax -1,s            X points to CC info - 1
  ldb  #8
  lda  #'-
CCOloop
  ror  8,s
  bcs  CCOSet
  sta  b,x
CCOSet
  decb
  bne  CCOloop
  lda  #2
  leax ,s  
  ldy  #8
  os9  I$Write
  leas 9,s      Clean up stack
  puls a,b,cc,dp,x,y,u,pc

*
* Output byte in D to stderr
hexout2
  pshs a,b,cc
  bsr  hexout
  exg  b,a
  bsr  hexout
  puls a,b,cc,pc

*
* for single-byte regs, output hex + ASCII
hexout1
  pshs a,b,x,y,cc
  bsr  hexout
  anda #$7f   Strip off high bit
  cmpa #$7f
  beq  ho0
  cmpa #$20
  bhs  ho1
ho0
  lda  #'.
ho1
  pshs a      Put character on stack.
  ldb  #$20
  pshs b      Put space before it.
  lda  #2
  ldy  #2
  tfr  s,x
  os9  I$Write
  puls x       Clean up stack.
  puls a,b,x,y,cc,pc

CCreg fcc " CC:"
Areg  fcc "  A:"
Breg  fcc "  B:"
DPreg fcc " DP:"
Xreg  fcc "  X:"
Yreg  fcc "  Y:"
Sreg  fcc "  S:"
Ureg  fcc "  U:"
PCreg fcc " PC:"

regdmp:
   pshs u    Push actual U
   leau 4,s  Make U be S  (Note: no CC flags affected.)
   pshs cc,a,b,dp,x,y,u  Now push rest.
   tfr  s,u

   leax CCreg,pcr
   ldy  #4         First do CC register.
   lda  #2
   os9  I$Write
   lda  ,u+
   lbsr CCOut
   leax 4,x

   ldb  #3
dmpregs1
   pshs b
   ldy  #4  
   lda  #2
   os9  I$Write
   lda  ,u+
   bsr  hexout1
   leax 4,x
   puls b
   decb
   bne  dmpregs1   

   ldb  #5
dmpregs2
   pshs b
   ldy  #4  
   lda  #2
   os9  I$Write
   ldd  ,u++
   lbsr hexout2
   leax 4,x
   puls b
   decb
   bne  dmpregs2

   bsr  crlf         Output the final CR.

*   ldx  #300      Sleep for 5 seconds.
*   os9  F$Sleep

   puls cc,a,b,dp,x,y,u
   puls u,pc


*
* Miscellaneous output routines
*
crlf:
   pshs a,b,cc,x,y
   lda  #$0d
   bra  Chrout
Space:
   pshs a,b,cc,x,y
   lda  #$20
Chrout
   pshs a
   tfr  s,x
   ldy  #1
   lda  #2
   os9  I$WritLn
   puls a
   puls a,b,cc,x,y,pc

   endsect