Download BIOS REFERENCE MANUAL - K-Team

Transcript
K-system
All information in this document
is preliminary and subject to change
str_cnvt_hascii_bin8(binary, ascii, paramNb)
Conversion from an ASCII (hexadecimal) formatted buffer to an 8-bit binary one.
This system call converts an ASCII (hexadecimal representation) formatted buffer to an 8-bit binary
one. An error is returned if the buffer is inconsistent. Here is an example:
ASCII in:
10, 1, 4, 4, 66\r\n\0
Parameter number: 3
Binary out:
0x10, 0x1, 0x4
Input (stacking order):
paramNb
Number of parameters.
ascii
Pointer on the ASCII buffer.
binary
Pointer on the binary buffer.
Output:
D0
0
Conversion OK.
D0
-1
Format of the buffer inconsistent.
Call examples in assembler and C:
...
push.32
{A6}+paramNb
; number of parameters
push.32
#{A6}+ascii
; pointer on an ASCII buffer
push.32
#{A6}+binary
; pointer on a binary buffer
CALL_BIOS
str_cnvt_hascii_bin8,3
; execute the function
test.32
D0
;
jump,mi
R8^Error
; buffer format error
int32
status;
uint8
*binary;
char
*ascii;
uint32
paramNb;
...
status = str_cnvt_hascii_bin8(binary, ascii, paramNb);
if (status < 0) return -1;
K-Team
http://www.k-team.com
[email protected]
May 25, 1999
156