<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://spectrum.alioth.net/doc/index.php?action=history&amp;feed=atom&amp;title=Mac2string</id>
	<title>Mac2string - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://spectrum.alioth.net/doc/index.php?action=history&amp;feed=atom&amp;title=Mac2string"/>
	<link rel="alternate" type="text/html" href="https://spectrum.alioth.net/doc/index.php?title=Mac2string&amp;action=history"/>
	<updated>2026-05-07T14:23:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://spectrum.alioth.net/doc/index.php?title=Mac2string&amp;diff=187&amp;oldid=prev</id>
		<title>Winston: New page: '''mac2string (IXCALL 0x3E5A)''' - convert a 6 byte MAC address to a null terminated string  '''string2mac (IXCALL 0x3E3D)''' - convert a null terminated string to a 6 byte MAC address  ==...</title>
		<link rel="alternate" type="text/html" href="https://spectrum.alioth.net/doc/index.php?title=Mac2string&amp;diff=187&amp;oldid=prev"/>
		<updated>2008-08-31T19:01:24Z</updated>

		<summary type="html">&lt;p&gt;New page: &amp;#039;&amp;#039;&amp;#039;mac2string (IXCALL 0x3E5A)&amp;#039;&amp;#039;&amp;#039; - convert a 6 byte MAC address to a null terminated string  &amp;#039;&amp;#039;&amp;#039;string2mac (IXCALL 0x3E3D)&amp;#039;&amp;#039;&amp;#039; - convert a null terminated string to a 6 byte MAC address  ==...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''mac2string (IXCALL 0x3E5A)''' - convert a 6 byte MAC address to a null terminated string&lt;br /&gt;
&lt;br /&gt;
'''string2mac (IXCALL 0x3E3D)''' - convert a null terminated string to a 6 byte MAC address&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
''Assembly language''&lt;br /&gt;
&lt;br /&gt;
    ld hl, mac_addr&lt;br /&gt;
    ld de, mac_string&lt;br /&gt;
    ld ix, MAC2STRING&lt;br /&gt;
    call IXCALL&lt;br /&gt;
 &lt;br /&gt;
    ld hl, mac_string&lt;br /&gt;
    ld de, mac_addr&lt;br /&gt;
    ld ix, STRING2MAC&lt;br /&gt;
    call IXCALL&lt;br /&gt;
    jr c, .error&lt;br /&gt;
&lt;br /&gt;
''C''&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;spectranet.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    void mac2string(char *msc_addr, char *mac_string);&lt;br /&gt;
    int string2mac(char *mac_string, char *mac_addr);&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
The '''mac2string()''' and '''string2mac''' convert 6 byte MAC addresses to null terminated strings, and vice versa. The ''mac_addr'' parameter should be a 6 byte buffer containing a MAC address for mac2string, or 6 bytes of storage to receive the converted address for string2mac. The ''mac_string'' argument must be at least 19 bytes long to receive an 18 character null terminated string.&lt;br /&gt;
&lt;br /&gt;
The '''string2mac()''' function takes, as valid input, a MAC address string as pairs of hexadecimal numbers separated by colons, as in the following example:&lt;br /&gt;
&lt;br /&gt;
 00:55:AA:12:7C:9E&lt;br /&gt;
&lt;br /&gt;
The '''mac2string()''' function returns the string representation of the 6 byte MAC address in this format. The routine is case sensitive; letters forming a hex number must be in upper case.&lt;br /&gt;
&lt;br /&gt;
== Return values ==&lt;br /&gt;
&lt;br /&gt;
The '''string2mac()''' C function returns 0 on success, or -1 if it can't parse the supplied string. The assembly language interface returns with carry reset on success, or carry set on error.&lt;br /&gt;
&lt;br /&gt;
[[Category:Spectranet]]&lt;/div&gt;</summary>
		<author><name>Winston</name></author>
	</entry>
</feed>