
Originally Posted by
kiwipiper
Also Melanie showed me how to output a Decimal String by putting a # in front of the variable tone i.e. Serout 0, 6, [$1b, $52, 1, #tone]
Can you output a hex or binary value instead and how do you do this?
I am using MiroCode Studio and meProg
Cheers Bruce
Hi Bruce,
I am not sure if this works with serout, but it does with SEROUT2, HSEROUT:
BIN, HEX, DEC.
from PBP manual Sec. 5.74 :
"1) A string constant is output as a literal string of characters.
2) A numeric value (either a variable or a constant) will send the corresponding ASCII character. Most notably, 13 is carriage return and 10 is line feed.
3) A numeric value preceded by BIN will send the ASCII representation of its binary value. For example, if B0 = 8, then BIN B0 (or BIN 8) will send "1000".
4) A numeric value preceded by DEC will send the ASCII representation of its decimal value. For example, if B0 = 123, then DEC B0 (or DEC 123) will send "123".
5) A numeric value preceded by HEX will send the ASCII representation of its hexadecimal value. For example, if B0 = 254, then HEX B0 (or HEX 254) will send "FE".
6) REP followed by a character and count will repeat the character, count time. For example, REP A0"\4 will send "0000".
7) STR followed by a byte array variable and optional count will send a string of characters. The string length is determined by the count or when a 0 character is encountered in the string.
BIN, DEC, and HEX may be preceded or followed by several optional parameters. If any of them are preceded by an I (for indicated), the output will be preceded by either a "%" , "#" , or "$" to indicate the following value is binary, decimal, or hexadecimal."
http://www.melabs.com/resources/pbpmanual/
JS
Last edited by Archangel; - 23rd October 2007 at 01:33.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks