How can i convert these subroutines?

Started by stiggity, December 14, 2010, 05:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

stiggity

heres the whole thing. Im getting lost somewhere around here..

      lda      #"i"
      jsr      strfin
      jsr      strget
 
      lda     strpnt
      bne    prot1e
         ldy  #5
         lda  #4
prot1d1  jsr  chrout
         dey
         bne  prot1d1
         ldx  #0
         stx  started
         jmp  restor

prot1e   ldy  #0
jb5  lda  (strpnt+1),y
         jsr  chrout
         ldx  nova
         bne  jb6
  STA  buffer,Y
jb6  iny
  cpy  strpnt
         bcc  jb5
prot1e2  lda  #13     ;terminating carriage return..
         jsr  chrout

Wagner

The name strpnt is somewhat misleading.  The length of the string is in strpnt, but the actual pointer doesn't begin until strpnt+1.  Said another way, location $52 contains the length of the string, and locations $53 and $54 contain the lo-byte and hi-byte of the pointer to the string that I$ also points to.

So, yes, it copies the string from I$ into buffer (as long as nova is zero, otherwise it gets output with chrout only).  The cpy strpnt, is comparing Y with the string length.  Or at least that's the idea on the 64.  On the 128, as you know, the string is in RAM 1, so a JSR INDFET will be necessary.

stiggity

Wagner:
I managed to hack together a routine, and have a 100% fully functional module now. Thank You.

-Steve