6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri May 17, 2024 7:33 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Oct 18, 2013 2:48 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8189
Location: Midwestern USA
W65C816S String Manipulation Library V2 has been posted by Mike in the code repository. This is an update to the W65C816S String Manipulation Library I published last year. V2 has more functions, better performance, especially when handling large character strings, and a unified calling syntax that uses stack frames to pass parameters into the functions. All functions are written in assembly language for the 65C816 running in 16 bit native mode and are fully commented. Functions use only the hardware stack for working storage.

If anyone puts the library to use please let me know how it works out for you.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 25, 2013 6:09 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8189
Location: Midwestern USA
I belatedly discovered that the version of the string manipulation library that is posted in the Code section of 6502.org is missing the strncpy (string copy) function. I have submitted an updated copy of the library to Mike to replace the old one.

Meanwhile, if anyone needs the strcpy function, it's attached as a text file.

Incidentally, here's a synopsis of what's in the string library:

    W65C816S STRING MANIPULATION LIBRARY V2 is a collection of 16-bit W65C816S native mode assembly language subroutines that perform a variety of useful character string operations. All functions are designed to take advantage of the W65C816S microprocessor’s enhanced features and to facilitate integration with other native mode 65C816 software. No predefined storage allocation is required for any library function.

    The following functions are implemented:

  • strcat — Catenate (concatenate) two strings.
  • strchr — Find a character in a string.
  • strcmp — Compare two strings.
  • strcpy — Copy a string to another string.
  • strdel — Delete a substring from a string.
  • strins — Insert a substring into a string.
  • strlen — Return the length of a string.
  • strpat — Compare two strings using ? and * wildcard pattern matching.
  • strprn — Print a character string.
  • strstr — Find a substring in a string.
  • strsub — Copy a substring from a string.

Attachment:
File comment: strncpy - String Copy Function Source Code
strcpy.txt [8.2 KiB]
Downloaded 115 times
————————————————————————————
This just in! :lol: Mike posted the updated library copy.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 27, 2013 9:44 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8189
Location: Midwestern USA
Necessity is the mother of invention...so goes the old wheeze. :)

I had a situation arise where I needed to right-justify some numbers for display purposes in my 816NIX filesystem development code. So I wrote a new function that can left-, right- and center-justify a character string using a selectable fill character to pad the field. See attached, which will be included in the next revision to the string manipulation library. See also screen-shot with right-justified number display.

Attachment:
File comment: strpad: COPY, JUSTIFY & PAD STRING: strpad STRING1,STRING2,L,J,FC
strpad.txt [11.16 KiB]
Downloaded 75 times
Attachment:
File comment: Updated string manipulation library macros.
stringmacs.txt [3.4 KiB]
Downloaded 58 times
Attachment:
File comment: Filesystem geometry display w/right-justified numbers.
fs_geometry.jpg
fs_geometry.jpg [ 2.29 MiB | Viewed 655 times ]

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: