changeset 748:d876b4806c66

Moved os9p3_perr.asm and os9p4_regdump.asm to level2/
author boisy
date Wed, 08 Jan 2003 03:43:28 +0000
parents 27033c1dd023
children ec1909ff0764
files 3rdparty/p2mods/makefile 3rdparty/p2mods/os9p3_perr.asm 3rdparty/p2mods/os9p4_regdump.asm
diffstat 3 files changed, 1 insertions(+), 672 deletions(-) [+]
line wrap: on
line diff
--- a/3rdparty/p2mods/makefile	Wed Jan 08 03:40:21 2003 +0000
+++ b/3rdparty/p2mods/makefile	Wed Jan 08 03:43:28 2003 +0000
@@ -1,7 +1,7 @@
 include ../../Makefile.rules
 
 DEPENDS		= ./Makefile
-CMDS		= os9p3_perr os9p4_regdump_6809 os9p4_regdump_6309 os9p3_sayhi sayhi tsayhi
+CMDS		= os9p3_sayhi sayhi tsayhi
 ALLOBJS		= $(CMDS)
 
 all:	$(ALLOBJS)
@@ -11,11 +11,5 @@
 	@$(ECHO) "*                                           *"
 	@$(ECHO) "*********************************************"
 
-os9p4_regdump_6809: os9p4_regdump.asm
-	$(AS) $(AFLAGS) $(ASOUT)$@ $<
-
-os9p4_regdump_6309: os9p4_regdump.asm
-	$(AS) -e $(AFLAGS) $(ASOUT)$@ $< -aH6309=1
-
 clean:
 	$(RM) $(ALLOBJS)
--- a/3rdparty/p2mods/os9p3_perr.asm	Wed Jan 08 03:40:21 2003 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,315 +0,0 @@
-*+
-*  O S 9 p 3 . a
-*  -- printerr functionality for Level II
-*
-*  AUTHOR
-*    Peter E. Durham
-*    The New Wentworth Timesharing System
-*    summer: 6 Twin Brook Circle        school: Quincy House D-24
-*            Andover, MA 01810                  58 Plympton St.
-*            (617) 475-4243                     Cambridge, MA 02138
-*                                               (617) 498-3209
-*    cis:    73177,1215                 delphi: PEDXING
-*    unix:   harvard!husc4!durham_2     intnet: durham_2@husc4.harvard.edu 
-*
-*  VERSION
-*    01.00.00 (PED) 87/06/23 -- First release
-*
-*  COPYRIGHT (C) 1987 by Peter Durham
-*    Permission is given to all members of the OS-9 community to use,
-*    modify, and share this program for their personal enjoyment.
-*    Commercial use of this program, which was written for fun to share with
-*    the community, is prohibited without the consent of the author.
-*    Please share any extensions or modifications with the author, who
-*    would be interested in hearing about them.
-*
-*  NOTE
-*    Quick poll... how does the above sound as a copyright notice?  Clearly,
-*    authors like to share their work while maintaining some control on it.
-*    And it doesn't seem fair for someone else to make $ from something
-*    someone else made for fun.  I think the above conditions are what most
-*    people want.  Let me know what you think.
-*
-*  NOTE
-*    The inspiration for this utility was the os9p3 example in
-*    the Tandy Level II manual.  Tandy deserves praise for
-*    including examples such as this one in their manuals.
-*
-*  NOTE
-*    There is something funny about OS9p3 modules... some versions
-*    are not liked, others are.  When developing this module, often
-*    a version would fail... but if I added a "leas 0,s" right before
-*    the "rts" in PrinBuf, it would work!  Probably the location and
-*    operation are not significant.  This version here has never failed
-*    to boot on my system; however, if it does on yours (or you change
-*    it), try putting such things in.
-*
-*  NOTE
-*    For those people who just can't have enough... OS9p3 will look for
-*    a module called OS9p4, and link to it, and execute it.  Thanks to
-*    Kev for this idea.  Now we can keep additions to the kernel in nice
-*    separate chunks.  (How long 'til OS9p11 comes around...?)
-*-
-         nam   OS9p3
-         ttl   Printerr functionality for Level II
-         opt   w79
-*+
-*  C o n s t a n t s 
-*  (so we don't need a level II DEFS file)
-*-
-*+
-*  Service calls
-*-
-
-         ifp1
-         use   defsfile
-         endc  
-*+
-*  C o d e
-*-
-*+
-*  Module header
-*-
-Type     set   Systm      ;System module, 6809 object code
-Revs     set   Reent+1    ;Sharable, first revision
-edition  set   1
-
-         mod   OS9End,OS9Name,Type,Revs,Entry,256
-OS9Name  fcs   "OS9p3"    ;Name
-         fcb   edition
-*+
-*  Initialization routine and table
-*-
-Entry    equ   *
-         leay  SvcTbl,pcr ;Get address of table
-         os9   F$SSvc     ;Install services in table
-         lda   #Type      ;Get system module type for OS9p4
-         leax  P4Name,pcr ;Get name for OS9p4
-         os9   F$Link     ;Try to link to it
-         bcs   Exit       ;If not found, exit
-         jsr   ,y         ;Go execute it!
-Exit     rts              ;Return to os9p2
-SvcTbl   equ   *
-         fcb   F$PErr     ;System call number
-         fdb   PErr-*-2   ;Offset to code
-         fcb   $80        ;End of table
-*+
-*  The new F$Perr service call
-*-
-*+
-*  Data (in user space!)
-*-
-BufLen   equ   80
-Buf      rmb   BufLen
-HunDig   equ   Buf+7
-TenDig   equ   Buf+8
-OneDig   equ   Buf+9
-DataMem  equ   .
-*+
-*  FUNCTION     PErr
-*  PURPOSE      Top level routine
-*  REGISTERS    B = Error code (after Setup)
-*               U = User memory area (after Setup)
-*               Y = User process descriptor (after Setup)
-*               A = Error file path number (after OpenFil)
-*               X = Pointer to strings
-*-
-PErr     equ   *
-         bsr   Setup      ;Go set up registers
-         leax  ErrMsg,pcr ;Get pointer to "Error #000"
-         bsr   MoveBuf    ;Go copy it over
-         bsr   WritNum    ;Go copy the number into it
-         lbsr  PrinMsg    ;Go print the message
-         bcs   PErrBye    ;If error, abort
-         leax  FilNam,pcr ;Get pointer to "/dd/sys/errmsg"
-         bsr   MoveBuf    ;Go copy it over
-         lbsr  OpenFil    ;Go open the file
-         bcs   PErrBye    ;If error, abort
-Loop     lbsr  RdBuf      ;Go read a line from the file
-         bcs   Error      ;If error, print CR, and abort
-         pshs  b          ;Save error code
-         pshs  b          ;Save error code again for compare
-         bsr   CalcNum    ;What number is on this line?
-         cmpb  ,s+        ;Is this line the right line?
-         puls  b          ;Restore error code
-         bne   Loop       ;If not right line, loop again
-         lbsr  PrinBuf    ;If right line, write line out
-         bra   Close      ;Done, so close the file
-Error    lbsr  DoCR       ;Go print a carriage return
-Close    lbsr  ClosFil    ;Go close the file
-PErrBye  rts              ;Return from system call
-*+
-*  FUNCTION     SetUp
-*  PURPOSE      Sets up registers
-*  GIVES        B = Error code
-*               U = Pointer to data memory on user stack in user space
-*               Y = Pointer to user process descriptor in system space
-*-
-SetUp    equ   *
-         ldb   R$B,u      ;Get error code
-         ldy   D.Proc     ;Get user's process descriptor
-         ldu   P$SP,y     ;Get user's stack pointer
-         leau  -DataMem,u ;Reserve a little space
-         rts   
-*+
-*  FUNCTION     MoveBuf
-*  PURPOSE      Copies string to user space
-*  TAKES        X = location of string in system space
-*-
-MoveBuf  equ   *
-         pshs  u,y,d      ;Save registers
-         lda   D.SysTsk   ;Get system process task number
-         ldb   P$Task,y   ;Get user process task number
-         leau  Buf,u      ;Get pointer to destination buffer
-         ldy   #BufLen    ;Copy BufLen characters over (extras, oh well)
-         os9   F$Move     ;Move string to user space
-         puls  d,y,u,pc   ;Restore registers and return
-*+
-*  FUNCTION     WriteNum
-*  PURPOSE      Puts the ASCII value of the error code in user space
-*  TAKES        B = error code
-*-
-WritNum  equ   *
-         pshs  x,d        ;Save registers
-         clra             ;Start A as 0
-Huns     cmpb  #100       ;Is B >= 100?
-         blo   HunDone    ;If not, go do Tens
-         inca             ;Increment hundreds digit
-         subb  #100       ;Subtract 100 from B
-         bra   Huns       ;Go do again
-HunDone  leax  HunDig,u   ;Where to put digit
-         bsr   WritDig    ;Go put it there
-         clra             ;Start A again as 0
-Tens     cmpb  #10        ;Is B >= 10?
-         blo   TenDone    ;If not, go do Ones
-         inca             ;Increment hundreds digit
-         subb  #10        ;Subtract 10 from B
-         bra   Tens       ;Go do again
-TenDone  leax  TenDig,u   ;Where to put digit
-         bsr   WritDig    ;Go put it there
-         tfr   b,a        ;Get ones digit
-         leax  OneDig,u   ;Where to put digit
-         bsr   WritDig    ;Go put it there
-         puls  d,x,pc     ;Restore registers and return
-*+
-*  FUNCTION     WritDig
-*  PURPOSE      Copy digit into user space
-*  TAKES        A = digit to copy (not in ASCII yet)
-*               X = where to put digit
-*-
-WritDig  equ   *
-         pshs  d          ;Save registers
-         adda  #'0        ;Convert A to ASCII
-         ldb   P$Task,y   ;Get task number
-         os9   F$StABX    ;Write that digit to user space
-         puls  d,pc       ;Restore registers and return
-*+
-*  FUNCTION     CalcNum
-*  PURPOSE      Converts ASCII number in user space to binary
-*  TAKES        Buf (in user space) = ASCII number
-*  GIVES        B = number converted
-*               X = points to first nonnumeric character
-*-
-CalcNum  equ   *
-         pshs  a          ;Save register
-         leax  Buf,u      ;Get pointer to buffer
-         clrb             ;Set accumulator to zero
-NextDig  bsr   LoadDig    ;Get digit from user space
-         suba  #'0        ;Convert to binary; is it less than zero?
-         bmi   CalcBye    ;If so, return
-         cmpa  #9         ;Is the digit more than nine?
-         bhi   CalcBye    ;If so, return
-         pshs  a          ;Save the digit while we multiply
-         lda   #10        ;Multiply current number by 10
-         mul              ;Do it
-         addb  ,s+        ;Add new digit to number
-         leax  1,x        ;Advance X to next digit
-         bra   NextDig    ;Go get the next digit
-CalcBye  puls  a,pc       ;Restore register and return
-*+
-*  FUNCTION     LoadDig
-*  PURPOSE      Get digit from user space
-*  TAKES        X = pointer to digit in user space
-*  GIVES        A = digit in user space
-*-
-LoadDig  equ   *
-         pshs  b          ;Save register
-         ldb   P$Task,y   ;Get user process task number
-         os9   F$LdABX    ;Get digit
-         puls  b,pc       ;Restore register and return
-*+
-*  FUNCTION     PrinMsg
-*  PURPOSE      Prints out the Error #xxx message
-*-
-PrinMsg  equ   *
-         pshs  y,x,a      ;Save registers
-         lda   P$Path+2,y ;Get StdErr path number
-         leax  Buf,u      ;Get pointer to message
-         ldy   #ErrLen    ;Maximum ErrLen characters to print
-         os9   I$Write    ;Write out error message
-         puls  a,x,y,pc   ;Restore registers and return
-*+
-*  FUNCTION     DoCR
-*  PURPOSE      Prints a carriage return
-*-
-DoCR     equ   *
-         pshs  x,d        ;Save registers
-         ldb   P$Task,y   ;Get user task number
-         lda   #$0D       ;Load A with a CR
-         leax  Buf,u      ;Get pointer to buffer
-         os9   F$StABX    ;Move the CR to the buffer
-         bsr   PrinBuf    ;Go print it
-         puls  d,x,pc     ;Restore registers and return
-*+
-*  FUNCTION     PrinBuf
-*  PURPOSE      Prints out the string from user space
-*  TAKES        X (in user space) = String to print
-*-
-PrinBuf  equ   *
-         pshs  y,a        ;Save registers
-         lda   P$Path+2,y ;Get StdErr path number
-         ldy   #BufLen    ;Maximum BufLen characters to print
-         os9   I$WritLn   ;Write out message
-         puls  a,y,pc     ;Restore registers and return
-*+
-*  FUNCTION     RdBuf
-*  PURPOSE      Reads in a string from file to user space
-*  TAKES        A = path number
-*  GIVES        Buf (in user space) = String read in
-*-
-RdBuf    equ   *
-         pshs  y,x        ;Save registers
-         leax  Buf,u      ;Get pointer to buffer
-         ldy   #BufLen    ;Maximum BufLen characters to read
-         os9   I$ReadLn   ;Read in line from file
-         puls  x,y,pc     ;Restore registers and return
-*+
-*  FUNCTION     OpenFil
-*  PURPOSE      Open path to error message file
-*  TAKES        Buf (in user space) = name of file
-*  GIVES        A = Path number
-*-
-OpenFil  equ   *
-         pshs  x          ;Save register
-         lda   #READ.     ;Open path for read access
-         leax  Buf,u      ;Get pointer to string
-         os9   I$Open     ;Open path
-         puls  x,pc       ;Restore registers and return A
-*+
-*  FUNCTION     ClosFil
-*  PURPOSE      Close path to error message file
-*  TAKES        A = Path number
-*-
-ClosFil  equ   *
-         os9   I$Close    ;Close file
-         rts              ;Return
-P4Name   fcc   "OS9p4"
-         fcb   $D
-ErrMsg   fcc   "Error #000"
-ErrLen   equ   *-ErrMsg
-FilNam   fcc   "/dd/sys/errmsg"
-         fcb   $D
-FilLen   equ   *-FilNam
-         emod  
-OS9End   equ   *
-         end   
--- a/3rdparty/p2mods/os9p4_regdump.asm	Wed Jan 08 03:40:21 2003 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,350 +0,0 @@
-
-*
-* Copyright February,1989 by Ron Lammardo
-*
-* This system call can be used in an application program to dump the
-* current contents of all user registers in Hex,Decimal,Binary and Ascii 
-* (Registers "A" and "B" Only). This module MUST be present in the
-* bootfile. If no OS9P3 module is found,change the "mname" and "nextname"
-* as appropriate.
-*
-*
-* If there is a conflict with the code used for this system called, it can
-* be changed by resetting the equate at "F$RegDmp"
-*
-* NOTE: All registers EXCEPT 'CC' are preserved....OS9 internally resets
-*       the condition code register upon service call exit.
-
-         nam   os9p4 
-         ttl   User Register Dump System Call for OS9 Level-II
-
-         ifp1  
-         use   defsfile
-         endc  
-
-typelang set   systm+objct
-attrev   set   reent+revision
-revision set   1
-edition  set   1
-
-         mod   Eom,Mname,Typelang,Attrev,Start,0
-
-mname          
-         fcs   /OS9p4/    name of this module
-         fcb   edition
-
-svctabl        
-         fcb   F$RegDmp   F$RegDmp code
-         fdb   regdmp-*-2 offset to actual code
-         fcb   $80        end of table
-
-start          
-         leay  <svctabl,pcr point to service table
-         os9   F$SSvc     insert the new op code in the table
-         lda   #typelang  get next module type (same as this one!)
-         leax  <nextname,pcr get address of next module name
-         os9   F$Link     attempt to link to it
-         bcs   endsetup   no good...skip this
-         jsr   ,y         else go execute it
-
-endsetup       
-         rts              return back to previous module
-
-nextname       
-         fcc   /OS9P5/    next module name to link to
-         fcb   $0d
-
-regdmp   equ   *
-         IFNE  H6309
-         pshs  cc,a,b,e,f,dp,x,y,u save all registers
-         ELSE
-         pshs  cc,a,b,dp,x,y,u save all registers
-         ENDC
-         tfr   u,y        transfer addresses
-         leas  -60,s      back up for some variable storage
-         leau  4,s        buffer starts here
-         clr   ,u+        set flag to print ascii char
-         lda   #$20       get a space
-         ldb   #50        number of chars to clear
-         tfr   u,x        set register for loop
-
-clrloop        
-         sta   ,x+        initialize a space
-         decb             decrement counter
-         bne   clrloop    if more..loop back & clear another
-         lbsr  reg060     send a <cr>
-         leax  reg080,pcr point to start of control table
-         clra             clear msb of register
-         ldb   R$A,y      get register from stack
-         bsr   reg000     dump register A
-         ldb   R$B,y      get register from stack
-         bsr   reg000     dump register B
-         IFNE  H6309
-         ldb   R$E,y      get register from stack
-         bsr   reg000     dump register E
-         ldb   R$F,y      get register from stack
-         bsr   reg000     dump register F
-         ENDC
-         inc   -1,u       turn off ascii char print flag
-         ldd   R$X,y      get register from stack
-         bsr   reg000     dump register X
-         ldd   R$Y,y      get register from stack
-         bsr   reg000     dump regisetr Y
-         ldd   R$U,y      get register from stack
-         bsr   reg000     dump register U
-         ldb   R$CC,y     get register from stack
-         bsr   reg000     dump register CC
-         ldb   R$DP,y     get register from stack
-         bsr   reg000     dump register DP
-         ldd   R$PC,y     get user Task Number
-         bsr   reg000     dump register PC
-         ldy   <D.Proc    get address of users process descriptor
-         ldd   P$SP,y     get users stack address
-         IFNE  H6309
-         addd  #14        add on for registers which were saved
-         ELSE
-         addd  #12        add on for registers which were saved
-         ENDC
-         bsr   reg000     dump register S
-         lbsr  reg060     send a <CR>
-         leas  60,s       restore stack pointer
-         IFNE  H6309
-         puls  cc,a,b,e,f,dp,x,y,u,pc restore all registers and return
-         ELSE
-         puls  cc,a,b,dp,x,y,u,pc restore all registers and return
-         ENDC
-
-* Dump a register in "D"
-* X = Control Table Location
-* U = Output buffer Location
-
-reg000         
-         pshs  y          save y register
-         tfr   d,y        register in y
-         lda   ,x         # of bytes
-         leax  3,x        point past table entry
-         pshs  a,x,y,u    save registers
-         ldd   -2,x       get register name
-         std   ,u++       move to buffer
-         ldd   #"=$       get chars
-         std   ,u++       move to buffer
-         ldd   3,s        get reg
-         lbsr  gethex     convert to hex
-         tst   0,s        1 byte ?
-         bne   reg010     no...skip this
-         ldd   2,u        get 2 lsb's
-         std   ,u         store in msb's
-         ldd   #$2020     get two blanks
-         std   2,u        store in lsb's
-
-reg010         
-         ldd   #$2023     get a space and  "#"
-         std   4,u        move in two spaces
-         leau  6,u        point to start of decimal output buffer
-         ldd   3,s        get register
-         lbsr  getdec     convert to decimal
-         tst   0,s        is it one byte
-         bne   reg020     no..skip this
-         ldd   2,u        else get third & fourth chars
-         std   ,u         store as first two
-         lda   4,u        get fifth char
-         sta   2,u        store as third
-         ldd   #$2020     get two spaces
-         std   3,u        store as 4th & 5th chars
-
-reg020         
-         ldd   #$2025     get a blank & "%"
-         std   5,u        move it to buffer
-         leau  7,u        point to start of binary output area
-         tfr   a,b        space in 'b'
-         std   16,u       space out ascii char
-         ldd   3,s        get register
-         bsr   getbin     convert to binary
-         tst   0,s        check byte count
-         bne   reg040     skip if two bytes
-         ldb   #8         loop counter
-
-reg030         
-         lda   8,u        get two chars from second 8 digits
-         sta   ,u+        store in first 8 digits
-         lda   #$20       get two blanks
-         sta   7,u        store in second 8 digits
-         decb             decrement counter
-         bne   reg030     loop back if not done
-         leau  -8,u       back up to beginning of binary digit output
-         ldb   4,s        get lsb of register
-         tst   -18,u      check if we want to print ascii char
-         bne   reg040     nope..skip this
-         cmpb  #$20       compare char with space
-         blo   reg040     if lower..skip this
-         cmpb  #'z        compare with last alpha char
-         bhi   reg040     if higher..skip this
-         stb   17,u       else store the char
-
-reg040         
-         lda   #$0d       get a <cr>
-         sta   18,u       and store it
-         leax  -17,u      back up to buffer start
-         bsr   reg070     send it
-         clra             clear msb for next reg
-         puls  b,x,y,u    restore registers
-         puls  y,pc       restore y & return
-
-reg050         
-         fcb   $0d
-
-reg060         
-         leax  <reg050,pcr point to <cr>
-
-reg070         
-         pshs  x,y,u,a,b  save registers
-         ldy   <D.Proc    get process descriptor address
-         lda   P$Path+2,y get user error path number
-         pshs  a          save it
-         ldu   P$SP,y     get user stack address
-         leau  -50,u      back off to make room
-         lda   <D.SysTsk  get system task number
-         ldb   P$Task,y   get users task number
-         ldy   #40        chars to move
-         os9   F$Move     move from system to user space
-         tfr   u,x        restore buffer address
-         puls  a          restore user error path number
-         os9   I$WritLn   send it
-         puls  x,y,u,a,b,pc restore registers & return
-
-* Control  Table - Format is :
-*      Byte count    (0=1,1=2)
-*      Register name (Two chars)
-
-reg080         
-         fcb   0
-         fcc   /a /
-         fcb   0
-         fcc   /b /
-         IFNE  H6309
-         fcb   0
-         fcc   /e /
-         fcb   0
-         fcc   /f /
-         ENDC
-         fcb   1
-         fcc   /x /
-         fcb   1
-         fcc   /y /
-         fcb   1
-         fcc   /u /
-         fcb   0
-         fcc   /cc/
-         fcb   0
-         fcc   /dp/
-         fcb   1
-         fcc   /pc/
-         fcb   1
-         fcc   /s /
-
-
-* Convert "D" to binary digits in buffer "U"
-
-getbin         
-         pshs  u,b        save 'u', second byte of register
-         bsr   bin010     convert first byte
-         puls  a          get second byte
-         bsr   bin010     convert it
-         puls  u,pc       restore 'u' and return
-
-bin010         
-         bita  #%10000000 check bit
-         bsr   bin020     print result
-         bita  #%01000000
-         bsr   bin020
-         bita  #%00100000
-         bsr   bin020
-         bita  #%00010000
-         bsr   bin020
-         bita  #%00001000
-         bsr   bin020
-         bita  #%00000100
-         bsr   bin020
-         bita  #%00000010
-         bsr   bin020
-         bita  #%00000001
-
-bin020         
-         beq   bin030     skip this if bit was set
-         ldb   #'1        else get an ascii '1'
-         bra   bin040     skip next
-
-bin030         
-         ldb   #'0        bit not set...get an ascii '0'
-
-bin040         
-         stb   ,u+        store the ascii char
-         rts   
-
-* Convert "D" to 4 hex digits in buffer "U"
-
-gethex         
-         pshs  u,b        save 'u',second register byte
-         bsr   gth010     convert first byte
-         puls  a          restore second byte
-         bsr   gth010     convert it
-         puls  u,pc       restore 'u' and return
-
-gth010         
-         pshs  a          save the byte
-         lsra             shift left 4 bits to right
-         lsra  
-         lsra  
-         lsra  
-         bsr   gth020     convert to hex digit
-         puls  a          restore the byte
-         anda  #$0f       strip off high 4 digits
-
-gth020         
-         adda  #'0        make it ascii
-         cmpa  #$3a       is it a letter
-         blt   gth030     nope..skip this
-         adda  #7         else add bias
-
-gth030         
-         sta   ,u+        store the ascii character
-         rts              return
-
-* Convert "D" to 5 decimal digits in buffer at "U"
-
-
-getdec         
-         pshs  x,y,u      save registers
-         ldx   #10000     get decimal number for subtraction
-         bsr   gtd010     get the decimal digit
-         ldx   #01000
-         bsr   gtd010
-         ldx   #00100
-         bsr   gtd010
-         ldx   #00010
-         bsr   gtd010
-         ldx   #00001
-         bsr   gtd010
-         puls  x,y,u,pc   restore registers & return
-
-gtd010         
-         pshs  x,a        save x register & extra byte
-         clr   ,s         clear counter
-
-gtd020         
-         cmpd  1,s        compare 'd' with 'x' on stack
-         blo   gtd030     less...skip this
-         subd  1,s        else subtract number on stack
-         inc   ,s         increment digit counter
-         bra   gtd020     and loop back
-
-gtd030         
-         std   1,s        save remainder of number
-         ldb   ,s+        get counter
-         addb  #$30       make it ascii
-         stb   ,u+        and move it as output
-         puls  d,pc       restore remainder & return
-
-         emod  
-eom            
-         end