Reference Section
_asc_to_c {
char num, *strindx;
...
num = _asc_to_c("01111111", 2, &strindx);
switch (c_code)
{
case 0:_put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str("Except these characters: ");
_put_str(strindx); }; break;
case 1:_put_str("\n\rConversion resulted in overflow.");
break;
case -1:_put_str("\n\rConversion result is underflow.");
break;
}
...
}
#include <inline.h>
{
char instr[] = "01111111";
unsigned char num;
...
mov bl,2 /* set radix = 2 (binary) */
lea si,instr/* SI = offset of instr */
num = asc_to_c();/* "string" -> signed char */
ja label_100/* overflow? */
jb label_200/* underflow? */
cmp byte ptr [si],0/* entire string converted? */
je label_300/* y: conversion complete */
... some characters not converted ...
jmp short label_300
label_100:
...
... overflow ...
label_200:
...
... underflow ...
label_300:
...
}
Source file _DCATOSC.ASM ASM equiv ASC_TO_BYTES
{
int num;
char *strindx;
...
num = _asc_to_i("7FFF", 16, &strindx);
if (c_code == 0)
{
_put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str("\n\rExcept these characters: ");
_put_str(strindx); }
}
else if (c_code==1)
_put_str("\n\rConversion resulted in an overflow: ");
else
_put_str("\n\rConversion resulted in underflow: ");
...
}
#include <inline.h>
{
char instr[] = "32767";
int num;
mov bl,10 /* set radix */
lea si,instr/* SI -> offset of instr */
num = asc_to_i();/* "string" -> signed int */
ja label_100/* overflow? */
jb label_200/* underflow? */
cmp byte ptr [si],0/* was string converted? */
je label_300/* y: conversion complete */
... some characters not converted ...
jmp short label_300
label_100:
... overflow ...
label_200:
... underflow ...
label_300:
...
}
Source file _DCATOSI.ASM ASM equiv ASC_TO_WORDS
{
char *strindx;
long num;
...
num = _asc_to_l ("80000000", 16, &strindx);
switch (c_code)
{
case 0: _put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(strindx); }; break;
case -1: _put_str("\n\rConversion result of underflow.");
break;
}
...
}
#include <inline.h>
{
char instr[] = "2147483648";
long num;
...
mov bl,10 /* set radix */
lea si,instr/* SI -> offset of instr */
num = asc_to_l();/* was conversion successful? */
jneconv_100/* y: underflow */
cmp byte ptr [si],0/* entire instr processed? */
je conv_200/* y: conversion complete */
... some characters were not processed ...
jmp short conv_200
conv_100:
...
... underflow ...
conv_200:
...
}
Source file _DCATOSL.ASM ASM equiv ASC_TO_DWORDS
{
char *strindx;
quad num;
...
_asc_to_q("90000000000000000", 10, num, &strindx);
switch (c_code)
{
case 0: _put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(strindx) ;}; break;
case -1: _put_str("\n\rConversion result of underflow.");
break;
}
...
}
#include <inline.h>
{
char instr[] = "90000000000000000000";
quad num;
...
pushss
pop es /* ES=SS (quad on stack) */
mov bl,10 /* BL = radix (dec) */
lea si,instr/* SI = offset of instr */
lea di,num /* DI = offset of num */
asc_to_q(); /* num = conversion */
jnelabel_100/* underflow */
cmp byte ptr [si],0/* entire instr processed? */
je label_200/* y: conversion complete */
... some characters not converted ...
jmp short label_200
label_100:
... underflow ...
label_200:
...
}
Source file _DCATOSQ.ASM ASM equiv ASC_TO_QWORDS
{
char *strindx;
unsigned char num;
...
num = _asc_to_uc("11111111", 2, &strindx);
switch (c_code)
{
case 0:_put_str("Conversion was successful.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(strindx); }; break; /* display remaining chrs */
case -1:_put_str("Underflow."); break;
case 1:_put_str("Overflow."); break;
}
...
}
#include <inline.h>
{
char instr[] = "255";
unsigned char num;
...
mov bl,10 /* BL = radix (decimal) */
lea si,instr/* SI = offset of instr */
num = asc_to_uc();/* was it successful? */
ja label_100/* n: overflow */
jb label_200/* n: underflow */
... success ...
jmp short label_300/* continue ... */
label_100:
... overflow ...
label_200:
... underflow ...
label_300:
...
}
Source file _DCATOC.ASM ASM equiv ASC_TO_BYTE
{
char *strindx;
unsigned int num;
...
num = _asc_to_ui("65000", 10, &strindx);
switch (c_code)
{
case 0:_put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(strindx); }; break;
case 1:_put_str("\n\rConversion result of overflow.");
break;
case -1:_put_str("\n\rConversion result of underflow.");
break;
}
...
}
#include <inline.h>
{
char instr[] = "65000";
unsigned int num;
...
mov bl,10 /* BL = radix (dec) */
lea si,instr/* SI -> offset of instr */
num = asc_to_ui();/* was it successful? */
ja label_100/* n: overflow */
jb label_200/* n: underflow */
... success ...
jmp short label_300/* continue ... */
label_100:
... overflow ...
label_200:
... underflow ...
label_300:
...
}
Source file _DCATOI.ASM ASM equiv ASC_TO_WORD
{
char *strindx;
unsigned long num;
...
num = _asc_to_ul("FFFFFFFE", 16, &strindx);
switch (c_code)
{
case 0: _put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(strindx); }; break;
case -1: _put_str("\n\rConversion result of underflow.");
break;
}
...
}
#include <inline.h>
{
char instr[] = "0xFFFFFFFF";
unsigned long num;
...
mov bl,16 /* BL = radix */
lea si,instr/* SI = offset of instr */
num = asc_to_ul();/* is conversion successful? */
jnelabel_100/* n: underflow */
... success ...
cmp byte ptr [si],0/* entire string converted? */
je label_200/* y: conversion complete */
... some characters not converted ...
jmp short label_200
label_100:
... underflow ...
label_200:
...
}
Source file _DCATOL.ASM ASM equiv ASC_TO_DWORD
{
char *strindx;
uquad num;
...
_asc_to_uq("18000000000000", 16, num, &strindx);
switch (c_code)
{
case 0: _put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(strindx); }; break;
case -1: _put_str("\n\rConversion resulted in underflow.");
break;
}
...
}
#include <inline.h>
{
char instr[] = "18000000000000000000";
uquad num;
...
mov bl,10 /* set radix */
lea si,instr/* SI = offset of instr */
pushss
pop es /* ES=SS (quad on stack) */
lea di,num; /* DI = offset of num */
asc_to_uq(); /* is conversion successful? */
jnelabel_100/* n: underflow */
... success ...
cmp byte ptr [si],0/* entire string converted? */
je label_200/* y: conversion complete */
... unconverted characters in instr ...
jmp short label_200
label_100:
... underflow ...
label_200:
...
}
Source file _DCATOQ.ASM ASM equiv ASC_TO_QWORD
{
char *strindx, outstr[20];
bcd num;
..
_dec_to_bcd ("123456789012345678", num, &strindx);
_put_str(_bcd_to_dec(num, outstr));
...
}
#include <inline.h>
{
char outstr[20];
char instr[] = "100000000000000000";
bcd num;
...
lea di,num /* DI -> num */
lea si,instr/* SI -> instr */
dec_to_bcd(); /* "string" -> bcd */
lea si,outstr/* SI -> outstr */
bcd_to_dec(); /* bcd -> "string" */
put_str(); /* "18446744073709551615" */
...
}
Source file _DCBCDDC.ASM ASM equiv BCD_TO_DEC
{
char *strindx, outstr[] = " is the result.";
bcd num;
_dec_to_bcd("123456789012345678", num, &strindx);
_bcd_to_dece(num, outstr);
_put_str(outstr);/* "123456789012345678 is the result." */
}
#include <inline.h>
{
char outstr[] = " is the result.";
char instr[] = "184467440737095516";
bcd num;
...
lea di,num /* DI -> num */
lea si,instr/* SI -> instr */
dec_to_bcd(); /* "string" -> bcd */
lea si,outstr/* SI -> outstr */
bcd_to_dece(); /* bcd -> "string..." */
lea si,outstr/* reset SI -> outstr */
put_str(); /* "18446744073709551615 is the result." */
...
}
Source file _DCBCDDE.ASM ASM equiv BCD_TO_DECE
{
char outstr[20], *strindx;
BCD bnum;
quad qnum;
...
_dec_to_bcd("123456789012345678",bnum, &strindx);
_bcd_to_q(qnum, bnum);
_put_str(_q_to_dec(qnum, outstr));
}
#include <inline.h>
{
char outstr[20];
char instr[] = "123456789012345678";
BCD bnum;
quad qnum;
...
lea si,instr/* SI -> instr */
lea di,bnum /* DI -> bcd number */
dec_to_bcd(); /* "string" -> bcd */
lea si,qnum
xchgdi,si /* SI -> bcd, DI -> quad */
bcd_to_q(); /* convert bcd to quad */
lea si,outstr/* SI -> outstr */
q_to_dec(); /* quad -> "string" */
put_str(); /* "123456789012345678" */
...
}
Source file _DCBCDQ.ASM
ASM equivâ
char outstr[10];
_put_str(_c_to_asc(0x80,10,outstr));/* "128" */
#include <inline.h>
{
char outstr[10];
...
mov al,0xFF /* AL = num */
lea si,outstr/* SI = offset of outstr */
mov bl,10 /* BL = radix (dec) */
c_to_asc(); /* char -> "string" */
put_str(); /* "255" */
...
}
Source file _DCSCTA.ASM ASM equiv BYTES_TO_ASC
{
char outstr[25] = " is the result";
_put_str(_c_to_asce(255, 16, outstr));
/* "-FF is the result" */
...
}
#include <inline.h>
{
char outstr[25] = " is the result";
...
mov al,255
mov bl,16 /* BL = hex radix */
lea si,outstr/* SI = offset of outstr */
c_to_asce(); /* char -> "string" */
lea si,outstr/* reset SI = offset outstr */
put_str(); /* "-FF is the result" */
...
}
Source file _DCSCTAE.ASM ASM equiv BYTES_TO_ASCE
{
char outstr[5];
_put_str(_c_to_dec(0xFF,outstr));/* "-255" */
...
}
#include <inline.h>
{
char outstr[5];
mov al,127
lea si,outstr/* SI = offset of outstr */
c_to_dec(); /* char -> "string" */
put_str(); /* "127" */
...
}
Source file _DCSCTD.ASM ASM equiv BYTES_TO_DEC
{
char outstr[25] = " is the result";
_put_str(_c_to_dece(255,outstr)); /* "-1 is the result" */
...
}
#include <inline.h>
{
char outstr[25] = " is the result";
mov al,255
lea si,outstr/* SI = offset of outstr */
c_to_dece(); /* char -> "string" */
lea si,outstr/* reset SI = offset outstr */
put_str();
...
}
Source file _DCSCTDE.ASM ASM equiv BYTES_TO_DECE
{
dcopts dc;
...
dc_addr = &dc;
if(_dc_init(0) == -1);/* use current DOS country */
/* info for conversion */
_put_str("Unable to access DOS country info.");
...
}
#include <inline.h>
{
dcopts dc;
char *str;
...
dc_addr = &dc;
...
xor ax,ax/* AX = current DOS country code */
lea si,dc/* SI = offset of dc struct */
dc_init();/* initialize formatting w/DOS info */
jnclabel_010
str = "Unable to access DOS country info.";
mov si,str
put_str();/* display error */
label_010:
...
}
Source file _DCINIT.ASM ASM equiv DC_INIT
{
char *strindx, outstr[20];
bcd num;
...
_dec_to_bcd("123456789012345678", num, &strindx);
_put_str(_bcd_to_dec(num, outstr));
...
}
#include <inline.h>
{
char outstr[20];
char instr[] = "100000000000000000";
bcd num;
...
lea di,num /* DI -> num */
lea si,instr/* SI -> instr */
dec_to_bcd(); /* "string" -> bcd */
lea si,outstr/* SI -> outstr */
bcd_to_dec(); /* bcd -> "string" */
put_str(); /* "18446744073709551615" */
...
}
Source file _DCDCBCD.ASM ASM equiv DEC_TO_BCD
{
char *strindx, num;
num = _dec_to_c("-127", &strindx);
switch (c_code)
{
case 0: _put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str("Except these characters: ");
_put_str(stri}; break;
case 1: _put_str("\n\rConversion result in overflow.");
break;
case -1: _put_str("\n\rConversion result in underflow.");
break;
}
...
}
#include <inline.h>
{
char instr[] = "-128";
char num;
...
lea si,instr/* SI = offset of instr */
num = dec_to_c();/* num = conversion result */
ja label_100/* overflow? */
jb label_200/* underflow? */
cmp byte ptr [si],0/* entire string processed? */
je label_300/* y: finished */
... some characters were not converted ...
jmp short label_300
label_100:
... overflow ...
label_200:
... underflow ...
label_300:
...
}
Source file _DCDTOSC.ASM ASM equiv DEC_TO_BYTES
{
char *strindx;
double num;
num = _dec_to_d("1.23e255", 2+DC_ROUND, &strindx);
if (c_code != 0)
_put_str("Overflow or underflow result.");
}
#include <inline.h>
{
char instr[] = "1.23e255";
double num;
...
lea si,instr/* SI -> instr */
lea di,num /* DI -> buffer for num */
mov ch,DC_TRUNC/* CH = precision flag */
dec_to_d(); /* conversion successful? */
je label_010/* y: continue */
... /* n: overflow/underflow */
label_010:
...
}
Source file _DFDECTD.ASM ASM equiv DEC_TO_LONG
{
char *strindx;
float num;
num = _dec_to_f("1.23e25", 2+DC_ROUND, &strindx);
if (c_code != 0)
_put_str("overflow or underflow result")
#include <inline.h>
{
char instr[20] = "1.23e25";
float num;
...
lea si,instr/* SI -> instr */
lea di,num /* DI -> num */
mov ch,DC_TRUNC/* CH = precision + flags */
dec_to_f(); /* "string" -> float */
...
}
Source file _DFDECTF.ASM ASM equiv DEC_TO_SHORT
{
char *strindx;
int num;
num = _dec_to_fixpi("327.67", 2, &strindx);
...
switch (c_code)
{
case 0: _put_str("\n\rSuccess.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(stri}; break;
case 1:_put_str("\n\rOverflow!"); break;
case -1:_put_str("\n\rUnderflow!"); break;
}
...
}
#include <inline.h>
{
char instr[] = "327.67";
int num;
...
lea si,instr/* SI = offset of instr */
mov ch,2 /* CH = precision */
num = dec_to_fixpi();/* "string" -> fixed-point int */
...
}
Source file _DCDCXSI.ASM ASM equiv DEC_TO_FIXPWS
{
char *strindx;
long num;
num = _dec_to_fixpl("20000000.00", 2, &strindx);
switch (c_code)
{
case 0: _put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(str}; break;
case -1: _put_str("\n\rConversion resulted in underflow.");
break;
}
...
}
#include <inline.h>
{
char instr[] = "21474836.47";
long num;
...
lea si,instr/* SI -> instr */
mov ch,2 /* CH = precision */
num = dec_to_fixpl();/* num = fixed-point long */
...
}
Source file _DCDCXSL.ASM ASM equiv DEC_TO_FIXPDWS
{
char outstr[40], *strindx;
quad num;
...
_dec_to_fixpq("10000000000000.000", 3, num, &strindx);
_put_str(_fixpq_to_dec(2, num, outstr));
/* "10000000000000000.00" */
...
}
#include <inline.h>
{
char outstr[25];
char instr[] = "1000000000000000000";
quad num;
...
lea di,num /* DI -> quad */
lea si,instr/* SI -> instr */
xor ch,ch /* read with precision of 0 */
dec_to_fixpq();
lea si,outstr/* reset SI -> outstr */
mov ch,2 /* CH = precision of 2 */
fixpq_to_dec(); /* quad -> "string" */
put_str(); /* "1000000000000000000.00" */
...
}
Source file _DCDCXSQ.ASM ASM equiv DEC_TO_FIXPQWS
{
char outstr[80];
char *strindx;
...
_put_str(_dec_to_form("10000000000000000.009",
DC_THOUS+DC_CURRENCY, 2, 80, outstr, &strindx));
/* "$10,000,000,000,000,000.01" */
dc.dc_expstr = "x10^";/* set exponent string */
dc.dc_leadplus = "+";/* set leading plus string */
_put_str(_dec_to_form("10000000000000000.009",
DC_EXP+DC_PLUS+DC_CURRENCY, 2, 80, outstr, &strindx));
/* "+$1.00x10^16" */
...
}
#include <inline.h>
{
char outstr[80];
char instr[] = "10000000000000000.009";
...
/* non-exponential output */
mov al,DC_THOUS+DC_CURRENCY
mov ch,2 /* CH = precision */
mov cl,80 /* CL = width */
lea di,instr/* DI -> instr */
lea si,outstr/* SI -> outstr */
dec_to_form(); /* standard to format string */
put_str(); /* "$10,000,000,000,000,000.01"*/
...
/* exponential output */
dc.dc_expstr = "x10^";
dc.dc_leadplus = "+";
mov al,DC_EXP+DC_PLUS+DC_CURRENCY
mov ch,2 /* CH = precision */
mov cl,80 /* CL = width */
lea di,instr/* DI -> instr */
lea si,outstr/* SI -> outstr */
dec_to_form(); /* standard to format string */
put_str(); /* "+$1.00x10^16" */
...
}
Source file _DCDCFRM.ASM ASM equiv DEC_TO_FORM
{
char outstr[] = " is the\
formatted result.";
char *str;
char *strindx;
_dec_to_forme("10000000000000000.009", DC_THOUS+DC_CURRENCY,
2, 80, outstr, &strindx);
_put_str(outstr);
/* "$10,000,000,000,000,000.01 is the formatted result." */
str = " is the formatted result.";
dc.dc_expstr = "x10^";/* set exponent string */
dc.dc_leadplus = "+";/* set leading plus string */
_dec_to_forme("10000000000000000.009",
DC_CURRENCY+DC_EXP+DC_PLUS, 2, 80, str, &strindx);
_put_str(outstr);
/* "+$1.00x10^16 is the formatted result." */
...
}
#include <inline.h>
{
char outstr[] = " is the\
formatted result.";
char instr[] = "10000000000000000.009";
char *str;
...
mov al,DC_THOUS+DC_CURRENCY
mov ch,2 /* CH = precision */
mov cl,80 /* CL = maximum width */
lea di,instr/* DI = offset of outstr */
lea si,outstr/* SI = offset of instr */
dec_to_forme(); /* standard to format string */
lea si,outstr/* SI -> outstr */
put_str();
/*"$10,000,000,000,000,000.01 is the formatted result."*/
...
str = " is the formatted result.";
dc.dc_expstr = "x10^";
dc.dc_leadplus = "+";
mov al,DC_CURRENCY+DC_EXP+DC_PLUS
mov ch,2 /* CH = precision */
mov cl,80 /* CL = width */
lea di,instr/* DI = offset of instr */
mov si,str /* SI = offset of str */
dec_to_forme(); /* standard to format string */
mov si,str /* reset SI = offset of str */
put_str(); /* "+$1.00x10^16 is the formatted result" */
...
}
Source file _DCDFRME.ASM ASM equiv DEC_TO_FORME
{
int num;
char *strindx;
num = _dec_to_i("-32767", &strindx);
if (c_code == 0)
{
_put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str("\n\rExcept these characters: ");
_put_str(strindx}
}
else if (c_code == 1)
_put_str("\n\rConversion resulted in an overflow: ");
else
_put_str("\n\rConversion resulted in underflow: ");
...
}
#include <inline.h>
{
char instr[] = "32767";
int num;
...
lea si,instr/* SI = offset of instr */
num = dec_to_i();/* num = conversion result */
ja label_100/* overflow? */
jb label_200/* underflow? */
cmp byte ptr [si],0/* entire string converted? */
je label_300/* y: finished
... some characters were not converted ...
jmp short label_300
label_100:
... overflow ...
label_200:
... underflow ...
label_300:
...
}
Source file _DCDTOSI.ASM ASM equiv DEC_TO_WORDS
{
char *strindx;
long num;
num = _dec_to_l("2147483648", &strindx);
switch (c_code)
{
case 0: _put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(str}; break;
case -1: _put_str("\n\rConversion result in underflow.");
break;
}
...
}
#include <inline.h>
{
char instr[] = "2147483648";
long num;
...
lea si,instr/* SI = offset of instr */
num = dec_to_l();/* num = conversion result */
jnelabel_100/* was conversion successful? */
cmp byte ptr [si],0/* entire string converted? */
je label_200/* y: finished */
... some characters were not converted ...
jmp short label_200
label_100:
... underflow ...
label_200:
...
}
Source file _DCDTOSL.ASM ASM equiv DEC_TO_DWORDS
{
char *strindx;
long double num;
...
num = _dec_to_ld("1.23e2555", 2+DC_ROUND, &strindx);
if (c_code != 0)
_put_str("overflow or underflow result");
...
}
#include <inline.h>
{
char instr[] = "1.23e2555";
long double num;
...
lea si,instr/* SI -> instr */
lea di,num /* DI -> buffer for num */
mov ch,2+DC_ROUND/* CH = precision + flags */
dec_to_ld(); /* "string" -> long double */
je label_010/* conversion successful? */
... /* n: manage overflow cond. */
label_010:
...
}
Source file _DCDECTL.ASM ASM equiv DEC_TO_TENB
{
char *strindx;
uquad num;
...
_dec_to_q("9000000000000000000", num, &strindx);
switch (c_code)
{
case 0: _put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(str}; break;
case -1: _put_str("\n\rConversion result in underflow.");
break;
}
...
}
#include <inline.h>
{
char instr[] = "9000000000000000000";
uquad num;
...
lea si,instr/* SI = offset of instr */
lea di,num /* DI = offset of num */
dec_to_q(); /* was conversion successful? */
jnelabel_100/* n: handle underflow */
cmp byte ptr [si],0/* entire string converted? */
je label_200/* y: conversion complete */
... some characters were not converted ...
jmp short label_200
label_100:
... underflow or error ...
label_200:
...
}
Source file _DCDTOSQ.ASM ASM equiv DEC_TO_QWORDS
{
unsigned char num;
...
num = _dec_to_uc("255", &strindx);
switch (c_code)
{
case 0: _put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(str}; break;
case 1: _put_str("\n\rConversion result in overflow.");
break;
case -1: _put_str("\n\rConversion result in underflow.");
break;
}
...
}
#include <inline.h>
{
char instr[] = "255";
unsigned char num;
...
lea si,instr/* SI = offset of instr */
num = dec_to_uc();/* num = conversion */
ja label_200/* overflow? */
jb label_100/* underflow? */
cmp byte ptr [si],0/* entire string processed? */
je label_300/* y: conversion complete */
... some characters were not processed ...
jmp short label_300
label_100:
... overflow ...
label_200:
... underflow ...
label_300:
...
}
Source file _DCDTOC.ASM ASM equiv DEC_TO_BYTE
{
char *strindx;
unsigned num;
...
num = _dec_to_ufixpi("655.35", 2, &strindx);
switch (c_code)
{
case 0: _put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(str}; break;
case -1: _put_str("\n\rConversion resulted in underflow.");
break;
}
...
}
#include <inline.h>
{
char instr[] = "655.35";
unsigned num;
...
lea si,instr/* SI = offset of instr */
mov ch,2 /* CH = precision */
num = dec_to_ufixpi();/* "string" -> fixed-point int */
...
}
Source file _DCDCFXI.ASM ASM equiv DEC_TO_FIXPW
{
char *strindx;
unsigned long num;
num = _dec_to_ufixpl("21474836.48", 2, &strindx);
switch (c_code)
{
case 0: _put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(str}; break;
case -1: _put_str("\n\rConversion resulted in underflow.");
break;
}
...
}
#include <inline.h>
}
char instr[] = "21474836.48";
unsigned long num;
...
lea si,instr/* SI = offset of instr */
mov ch,2 /* CH = precision */
num = dec_to_ufixpl();/* "string" -> fixp long */
...
}
Source file _DCDCFXL.ASM ASM equiv DEC_TO_FIXPDW
{
char outstr[40], *strindx;
uquad num;
...
_dec_to_ufixpq("18446744073709551615", 0, num, &strindx);
_put_str(_ufixpq_to_dec(2, num, outstr));
/* "184467440737095516.15" */
...
}
#include <inline.h>
{
char outstr[40], instr[] = "18446744073709551615";
uquad num;
...
lea di,num /* DI -> num */
lea si,instr/* SI -> outstr */
xor ch,ch /* read with precision of 0 */
dec_to_ufixpq();/*"string" -> fixed-point quad */
lea si,outstr/* reset SI -> outstr */
mov ch,2 /* CH = precision */
ufixpq_to_dec();/* fixed-point -> "string" */
put_str(); /* "184467440737095516.15" */
...
}
Source file _DCDCFXQ.ASM ASM equiv DEC_TO_FIXPQW
{
char *strindx;
unsigned int num;
...
num = _dec_to_ui("65000", &strindx);
switch (c_code)
{
case 0:_put_str("\n\rSuccess.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(stri}; break;
case 1:_put_str("\n\rOverflow!"); break;
case -1:_put_str("\n\rUnderflow!"); break;
}
...
}
#include <inline.h>
{
char instr[] = "65000";
unsigned int num;
...
lea si,instr/* SI = offset of instr */
num = dec_to_ui();/* "string" -> num */
ja label_100/* overflow? */
jb label_200/* underflow? */
cmp byte ptr [si],0/* entire string converted? */
je label_300/* y: conversion complete */
... some characters were not converted ...
jmp short conv_300
label_100:
... overflow ...
conv_200:
... underflow ...
conv_300:
...
}
Source file _DCDTOI.ASM ASM equiv DEC_TO_WORD
{
char *strindx;
unsigned long num;
...
num = _dec_to_ul("1000000000", &strindx);
switch (c_code)
{
case 0: _put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(str}; break;
case -1: _put_str("\n\rConversion result in underflow.");
break;
}
...
}
#include <inline.h>
{
char instr[] = "4294967296";
unsigned long num;
...
lea si,instr/* SI = offset of instr */
num = dec_to_ul();/* num = conversion result */
jnelabel_100/* is conversion successful? */
cmp byte ptr [si],0/* entire string converted? */
je label_200/* y: conversion complete */
... some characters were not converted ...
jmp short label_200
label_100:
... underflow or error ...
label_200:
...
}
Source file _DCDTOL.ASM ASM equiv DEC_TO_DWORD
{
char *strindx;
uquad num;
...
_dec_to_uq("18000000000000000000", num, &strindx);
switch (c_code)
{
case 0: _put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(str}; break;
case -1: _put_str("\n\rConversion result in underflow.");
break;
}
...
}
#include <inline.h>
{
char instr[] = "18000000000000000000";
uquad num;
...
lea si,instr/* SI = offset of instr */
lea di,num /* DI = offset of num */
dec_to_uq(); /* was conversion successful? */
jnelabel_100/* n: handle underflow */
cmp byte ptr [si],0/* entire string converted? */
je label_300/* y: conversion complete */
... some characters were not converted ...
jmp short label_300
label_100:
... underflow or error ...
label_300:
...
}
Source file _DCDTOQ.ASM ASM equiv DEC_TO_QWORD
{
char outstr[80];
double num = 1.23e255;
...
_put_str(_d_to_dec(&num, 5+DC_TRUNC, outstr));
/* "1.23000e255" */
...
}
#include <inline.h>
{
char outstr[80];
double num = 1.23e25;
lea si,outstr/* SI = offset of outstr */
lea di,num /* DI = offset of num */
mov ch,5+DC_FLOAT/* CH = precision + float */
d_to_dec(); /* double -> "string" */
put_str(); /* "1.23e25" */
}
Source file _DFDTDEC.ASM ASM equiv LONG_TO_DEC
{
char outstr[] = " is the result.";
double num = 1.23e255;
...
_d_to_dece(&num, 5+DC_ROUND, outstr);
_put_str(outstr);/* "1.23000e255 is the result" */
...
}
#include <inline.h>
{
char outstr[] = " is the result.";
double num = 1.23e255;
lea si,outstr/* SI = offset of outstr */
lea di,num /* DI -> num */
mov ch,5+DC_FLOAT/* CH = precision + float */
d_to_dece(); /* double -> "string" */
lea si,outstr/* reset SI = offset of outstr */
put_str(); /* "1.23e255 is the result" */
}
Source file _DFDTDCE.ASM ASM equiv LONG_TO_DECE
{
char outstr[] = " is the result.";
double num = 1.23e5;
...
_d_to_decne(&num, 5, outstr);
_put_str(outstr);/*"123000.00000 is the result" */
...
}
#include <inline.h>
{
char outstr[50] = " is the result.";
double num = 1.23e5;
lea si,outstr/* SI -> outstr */
lea di,num /* DI -> num */
xor ch,ch /* CH = precision + float */
d_to_decne(); /* double -> "string" */
lea si,outstr/* reset SI -> outstr */
put_str();/* outstr = "123000 is the result." */
}
Source file _DFDDCNE.ASM ASM equiv LONG_TO_DECNE
{
char outstr[10];
...
_put_str(_fixpi_to_dec(10000, 2, outstr)); /* "100.00" */
...
}
#include <inline.h>
{
char outstr[20];
...
mov ax,10000/* AX = 100000 */
mov ch,2 /* CH = precision of 2 */
lea si,outstr/* SI = offset of outstr */
fixpi_to_dec(); /* int -> string */
put_str(); /* "100.00" */
...
}
Source file _DCSXIDC.ASM ASM equiv FIXPWS_TO_DEC
{
char outstr[] = " is the result.";
...
_fixpi_to_dece(10000, 2, outstr);
_put_str(outstr);/* "100.00 is the result." */
...
}
#include <inline.h>
{
char outstr[] = " is the result.";
...
mov ax,10000/* AX = 10000 */
mov ch,2 /* CH = precision */
lea si,outstr/* SI = offset of outstr */
fixpi_to_dece();/* int -> "string" */
lea si,outstr/* reset SI = offset of outstr */
put_str(); /* "100.00 is the result." */
...
}
Source file _DCSXIDE.ASM ASM equiv FIXPWS_TO_DECE
{
char outstr[20];
...
_put_str(_fixpl_to_dec(2147483647, 2, outstr));
/* "21474836.47" */
...
}
#include <inline.h>
{
char outstr[20];
...
mov ax,0xFFFF
mov dx,0x7FFF/* DX;AX = 2147483647 */
mov ch,2 /* CH = precision */
lea si,outstr/* SI = offset of outstr */
fixpl_to_dec(); /* fixed-pt long -> "string" */
put_str(); /* "21474836.47" */
...
}
Source file _DCSXLDC.ASM ASM equiv FIXPDWS_TO_DEC
{
char outstr[] = " is the result.";
...
_fixpl_to_dece(2147483647, 2, outstr);
_put_str(outstr);/* "21474836.47 is the result." */
...
}
#include <inline.h>
{
char outstr[50] = " is the result.";
...
mov ax,0xFFFF
mov dx,0x7FFF/* DX;AX = 2147483647 */
mov ch,2 /* CH = precision */
lea si,outstr/* SI = offset of outstr */
fixpl_to_dece();/* fixed-pt long -> "string" */
lea si,outstr/* reset SI = offset of outstr */
put_str(); /* "21474836.47 is the result."*/
...
}
Source file _DCSXLDE.ASM ASM equiv FIXPDWS_TO_DECE
{
char outstr[40];
char *strindx;
quad num;
...
_dec_to_fixpq(3,"10000000000000.000",num,&strindx);
_put_str(_fixpq_to_dec(2, num, outstr));
/* "10000000000000000.00" */
...
}
#include <inline.h>
{
char outstr[25];
char instr[] = "1000000000000000000";
quad num;
...
lea di,num /* DI = offset of quad */
lea si,instr/* SI = offset of instr */
xor ch,ch /* read with precision of 0 */
dec_to_fixpq(); /* "string" -> fixed-pt quad */
lea si,outstr/* reset SI = offset of outstr */
mov ch,2 /* CH = precision */
fixpq_to_dec(); /* quad -> "string" */
put_str(); /* "1000000000000000000.00" */
...
}
Source file _DCSXQDC.ASM ASM equiv FIXPQWS_TO_DEC
{
char outstr[]= " is the result.";
char *strindx;
quad num;
_dec_to_fixpq(0,"1000000000000000000",num, &strindx);
_fixpq_to_dece(2, num, outstr);
_put_str(outstr); /*"10000000000000000.00 is the result."*/
...
}
#include <inline.h>
{
char outstr[] = " is the result.";
char instr[] = "1000000000000000000";
quad num;
...
lea di,num /* DI = offset of quad */
lea si,instr/* SI = offset of instr */
xor ch,ch /* read with precision of 0 */
dec_to_fixpq(); /* "string" -> fixed-pt quad */
lea si,outstr/* reset SI = offset of outstr */
mov ch,2 /* CH = precision */
fixpq_to_dece();/* quad -> "string..." */
lea si,outstr/* reset SI = offset of outstr */
put_str(); /* "10000000000000000.00 is the result." */
...
}
Source file _DCSXQDE.ASM ASM equiv FIXPQWS_TO_DECE
{
char outstr[80];
char **strindx;
...
_put_str(_form_to_dec("$10,000,000,000,000,000.019",
DC_THOUS+DC_CURRENCY, 2, 80, outstr, &strindx));
/* "10000000000000000.01" */
...
_form_to_dec("+$1.00x10^16", DC_CURRENCY+DC_EXP+DC_PLUS, 2,
80, outstr,&strindx);
_put_str(outstr); /* "1.00e16" */
...
...
}
#include <inline.h>
{
char outstr[80];
char *instr;
...
instr = "$10,000,000,000,000,000.01";
mov al,DC_CURRENCY+DC_THOUS/* AL = nflags */
mov ch,2 /* CH = precision */
mov cl,80 /* CL = width */
lea si,outstr /* SI -> output string */
mov di,instr /* DI -> input string */
form_to_dec(); /* convert to standard string */
put_str(); /* "10000000000000000.01" */
...
instr = "$1.00x10^16";
mov al,DC_CURRENCY+DC_EXP
mov ch,2 /* CH = precision of 2 */
mov cl,80 /* CL = width of 80 */
lea si,outstr/* SI -> output string */
mov di,instr/* DI -> input string */
form_to_dec(); /* convert to standard string */
put_str(); /* "1.00e16" */
...
}
Source file _DCFRMDC.ASM ASM equiv FORM_TO_DEC
{
char *outstr;
char *strindx;
outstr = " is the standard result.";
...
_form_to_dece("$10,000,000,000,000,000.01",
DC_CURRENCY+DC_THOUS, 2, 80, outstr,&strindx);
_put_str(outstr);
/*"10000000000000000.01 is the standard result."*/
...
outstr = " is the standard result.";
dc.dc_expstr = "x10^";/* set exponent string */
dc.dc_leadplus = "+";/* set leading plus string */
_form_to_dece("+$1.00x10^16",DC_CURRENCY+DC_EXP+DC_PLUS, 2,
80, outstr, &strindx);
_put_str(outstr);/* "1.00e16 is the standard result." */
...
...
}
#include <inline.h>
{
char *instr, *outstr;
...
outstr = " is the standard result.";
instr = "$10,000,000,000,000,000.01";
mov al,DC_THOUS+DC_CURRENCY
mov ch,2 /* CH = precision */
mov cl,80 /* CL = max chars to process */
mov di,instr/* DI -> instr */
mov si,outstr/* SI -> outstr */
form_to_dece(); /* standard to format string */
mov si,outstr/* reset SI -> outstr */
put_str();
/*"$10,000,000,000,000,000.01 is the formatted result."*/
...
outstr = " is the standard result.";
dc.dc_expstr = "x10^";
dc.dc_leadplus = "+";
instr = "+$1.00x10^16";
mov al,DC_CURRENCY+DC_EXP+DC_PLUS
mov ch,2 /* CH = precision */
mov cl,80 /* CL = width */
mov di,instr/* DI -> instr */
mov si,outstr/* SI -> outstr */
form_to_dece(); /* standard to format string */
mov si,outstr/* reset SI -> outstr */
put_str();/* "1.00e16 is the standard result." */
...
}
Source file _DCFRMDE.ASM ASM equiv FORM_TO_DECE
{
char outstr[80];
float num = 1.23e25;
...
_put_str(_f_to_dec(&num, 5+DC_TRUNC, outstr));
/* "1.23000e25" */
...
}
#include <inline.h>
{
char outstr[80];
float num = 1.23e25;
lea si,outstr/* SI = offset of outstr */
lea di,num /* DI = offset of num */
mov ch,5+DC_FLOAT/* CH = precision + float */
f_to_dec(); /* float -> "string" */
put_str(); /* "1.23e25" */
}
Source file _DFFTDEC.ASM ASM equiv SHORT_TO_DEC
{
char outstr[] = " is the result.";
float num = 1.23e25;
...
_f_to_dece(&num, 5, outstr);
_put_str(outstr);/* "1.23000e25 is the result" */
...
}
#include <inline.h>
{
char outstr[] = " is the result.";
float num = 1.23e25;
lea si,outstr/* SI = offset of outstr */
lea di,num /* DI = offset of num */
mov ch,5+DC_FLOAT/* CH = precision + float */
f_to_dece(); /* float -> "string..." */
lea si,outstr/* reset SI = offset of outstr */
put_str(); /* "1.23e25 is the result" */
}
Source file _DFFTDCE.ASM ASM equiv SHORT_TO_DECE
{
char outstr[80];
float num = 1.23e5;
...
_put_str(_f_to_decn(&num, 5, outstr)); /* "123000.00000" */
...
}
#include <inline.h>
{
char outstr[80];
float num = 1.23e5;
lea si,outstr/* SI = offset of outstr */
lea di,num /* DI = offset of num */
mov ch,5+DC_FLOAT/* CH = precision + float */
f_to_decn(); /* float -> "string" */
put_str(); /* "123000" */
}
Source file _DFFTDCN.ASM ASM equiv SHORT_TO_DECN
{
char outstr[] = " is the result.";
float num = 1.23e5;
...
_f_to_decne(&num, 5+DC_ROUND, outstr);
_put_str(outstr);/* "123000.00000 is the result"*/
...
}
#include <inline.h>
{
char outstr[50] = " is the result.";
float num = 1.23e5;
lea si,outstr/* SI = offset of outstr */
lea di,num /* DI = offset of num */
xor ch,ch /* CH = precision of 0 */
f_to_decne(); /* float -> "string" */
lea si,outstr/* reset SI = offset of outstr */
put_str(); /* "123000 is the result" */
}
Source file _DFFDCNE.ASM ASM equiv SHORT_TO_DECNE
{
unsigned char num;
char *strindx;
...
num = _hex_to_uc ("FF", &strindx);
switch (c_code)
{
case 0: _put_str("\n\rConversion was successful.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(strindx); } break;
case 1: _put_str("\n\rConversion overflow."); break;
case -1: _put_str("\n\rConversion underflow."); break;
}
...
}
#include <inline.h>
{
char instr[] = "7F";
int num;
...
lea si,instr/* SI = offset of instr */
num = hex_to_uc();/* num = conversion result */
ja label_100/* overflow? */
jb label_200/* underflow? */
cmp byte ptr [si],0/* entire string converted? */
je label_300/* y: jump to label_300 */
... some characters were not converted ...
jmp short label_300
label_100:
...
... overflow ...
label_200:
...
... underflow ...
label_300:
...
}
Source file _DCHTOC.ASM ASM equiv HEX_TO_BYTE
{
char *strindx;
unsigned int num;
...
num = _hex_to_ui("65000", &strindx);
switch (c_code)
{
case 0:_put_str("\n\rSuccess.");
if (strindx[0] != NULL) {
_put_str(" Except these characters: ");
_put_str(strindx); } break;
case 1:_put_str("\n\rOverflow!"); break;
case -1:_put_str("\n\rUnderflow!"); break;
}
...
}
#include <inline.h>
{
char instr[] = "65000";
unsigned int num;
...
lea si,instr/* SI = offset of instr */
num = hex_to_ui();/* "string" -> int */
ja label_100/* overflow? */
jb label_200/* underflow? */
cmp byte ptr [si],0/* entire string converted? */
je label_300/* y: jump to label_300 */
... some characters were not converted ...
jmp short label_300
label_100:
...
... overflow ...
label_200:
...
... underflow ...
label_300:
...
}
Source file _DCHTOI.ASM ASM equiv HEX_TO_WORD
char outstr[10];
_put_str(_i_to_asc(65535,10,outstr)); /* "-1" */;
...
#include <inline.h>
{
char outstr[10];
...
mov ax,0xFFFF/* AX = signed int */
mov bl,10 /* BL = radix (dec) */
lea si,outstr/* SI = offset of outstr */
i_to_asc(); /* signed int -> "string" */
put_str(); /* "-1" */
...
}
Source file _DCSITA.ASM ASM equiv WORDS_TO_ASC
{
char outstr[] = " is signed int value.";
_i_to_asce(0xFFFF,10,outstr);
_put_str(outstr); /* "-1 is signed int value." */;
...
}
#include <inline.h>
{
char outstr[] = " is signed int value.";
...
mov ax,0xFFFF/* AX = signed int */
mov bl,10 /* BL = radix (decimal) */
lea si,outstr/* SI = offset of outstr */
i_to_asce(); /* num -> "string" */
lea si,outstr /* reset SI = offset outstr */
put_str(); /* "-1 is signed int value." */
...
}
Source file _DCSITAE.ASM ASM equiv WORDS_TO_ASCE
char outstr[10];
_put_str(_i_to_dec(65535,outstr)); /* "-1" */
...
#include <inline.h>
{
char outstr[10];
...
mov ax,-127
lea si,outstr/* SI = offset of outstr */
i_to_dec(); /* int -> "string" */
put_str(); /* "-127" */
...
}
Source file _DCSITD.ASM ASM equiv WORDS_TO_DEC
#include <inline.h>
{
char outstr[] = " is the result.";
...
lea si,outstr/* SI = offset of outstr */
mov ax,0xFFFF/* AL = num */
i_to_dece(); /* signed int -> "string" */
lea si,outstr/* reset SI = offset outstr */
put_str(); /* "65535 is the result." */
...
}
Source file _DCSITDE.ASM ASM equiv WORDS_TO_DECE
{
char outstr[80];
long double num = 1.23e2555;
...
_put_str(_ld_to_dec(&num, 5, outstr)); /* "1.23000e2555" */
...
}
#include <inline.h>
{
char outstr[80];
long double num = 1.23e2555;
lea si,outstr/* SI = offset of outstr */
lea di,num /* DI = offset of num */
mov ch,5+DC_FLOAT/* CH = precision + float */
ld_to_dec(); /* long double -> "string" */
put_str(); /* "1.23e2555" */
}
Source file _DFLDDEC.ASM ASM equiv TENB_TO_DEC
{
char outstr[] = " is the result.";
long double num = 1.23e2555;
...
_ld_to_dece(&num, 5+DC_ROUND, outstr);
_put_str(outstr);/* "1.23000e2555 is the result"*/
...
}
#include <inline.h>
{
char outstr[] = " is the result.";
long double num = 1.23e2555;
lea si,outstr/* SI = offset of outstr */
lea di,num /* DI = offset of num */
mov ch,5+DC_FLOAT/* CH = precision + float */
ld_to_dece(); /* long double -> "string" */
lea si,outstr/* reset SI = offset of outstr */
put_str();
}
Source file _DFLDDCE.ASM ASM equiv TENB_TO_DECE
{
char outstr[] = " is the result";
long double lnum = 1.23e5, *ldptr;
...
_ld_to_decne(&lnum, 5+DC_ROUND, outstr);
_put_str(outstr);/* "123000.00000 is the result"*/
...
}
#include <inline.h>
{
char outstr[] = " is the result";
long double num = 1.23e5;
lea si,outstr/* SI = offset of outstr */
lea di,num /* DI = offset of num */
xor ch,ch /* CH = precision */
ld_to_decne(); /* long double -> "string" */
lea si,outstr/* reset SI = offset of outstr */
put_str(); /* "123000 is the result" */
}
Source file _DFLDCNE.ASM ASM equiv TENB_TO_DECNE
char outstr[40];
_put_str(_l_to_asc(0xFFFFFFFF, 10, outstr)); /* "-1" */
...
#include <inline.h>
{
char outstr[40];
...
mov ax,0xFFFF
mov dx,0x7FFF/* DX;AX = num */
mov bl,10 /* BL = radix (dec) */
lea si,outstr/* SI = offset of outstr */
l_to_asc(); /* long -> "string" */
put_str(); /* "2174783647" */
...
}
Source file _DCSLTA.ASM ASM equiv DWORDS_TO_ASC
{
char *outstr = " is binary result";
_l_to_asce (-1,16,outstr);
_put_str(outstr); /* "0xFFFFFFFF is the result" */
...
}
#include <inline.h>
{
char outstr[50] = " is the hex result.";
...
mov ax,-1
mov dx,-1 /* DX:AX = signed long = -1 */
mov bl,16 /* BL = radix (hex) */
lea si,outstr/* SI = offset of outstr */
l_to_asce(); /* signed long -> "string" */
lea si,outstr/* reset SI */
put_str(); /* "0xFFFFFFFF is the result." */
...
}
Source file _DCSLTAE.ASM ASM equiv DWORDS_TO_ASCE
char outstr[40];
_put_str(_l_to_dec(0xFFFFFFFF, outstr)); /* "-1" */
...
#include <inline.h>
{
char outstr[20];
...
mov ax,0xFFFF
mov dx,0xFFFF/* DX;AX = signed long value */
lea si,outstr/* SI = offset of outstr */
l_to_dec(); /* signed long -> "string" */
put_str(); /* "-1" */
...
}
Source file _DCSLTD.ASM ASM equiv DWORDS_TO_DEC
{
char outstr[] = " is signed long value in decimal.";
_l_to_dece(0xFFFFFFFF, outstr);
_put_str(outstr); /* "-1 is signed long value in decimal." */
...
}
#include <inline.h>
{
char outstr[] = "-1 is signed long value in decimal";
...
lea si,outstr/* SI = offset of outstr */
mov ax,0xFFFE
mov dx,0xFFFF/* DX;AX = signed long */
l_to_dece(); /* long -> "string..." */
lea si,outstr/* reset SI = offset outstr */
put_str(); /* "-1 is signed long value in decimal." */
...
}
Source file _DCSLTDE.ASM ASM equiv DWORDS_TO_DECE
{
char outstr[20], *strindx;
quad num1;
...
_dec_to_q("9999999999", num1, &strindx);
_q_to_asc(num1, 16, outstr);
_put_str(outstr); /* "2504B33FF" */
...
}
#include <inline.h>
{
char outstr[20], instr[] = "2504B33FF";
quad num;
...
lea si,instr/* SI = offset of instr */
pushss
pop es /* ES = SS (quad on stack) */
lea di,num /* DI = offset of num */
mov bl,16 /* BL = radix (hex) */
asc_to_q(); /* "string" -> quad */
mov bl,10 /* BL = radix (decimal) */
lea si,outstr/* SI = offset of outstr */
q_to_asc(); /* quad -> "string" */
put_str(); /* "9999999999" */
...
}
Source file _DCSQTA.ASM ASM equiv QWORDS_TO_ASC
{
char *outstr = " quad value in HEX";
char *strindx;
quad num;
...
_dec_to_q ("5000000000", num, &strindx);
_q_to_asce (num, 16, outstr);
_put_str(outstr);/* "12A05F200 quad ..." */
...
}
#include <inline.h>
{
char outstr[50] = " quad value in HEX";
char instr[] = "5000000000";
quad num;
...
lea si,instr/* SI = offset of instr */
pushss
pop es /* ES = SS (quad on stack) */
lea di,num /* DI = offset of num */
dec_to_q(); /* "string" -> quad */
jnelabel_100/* if error jump to label */
mov bl,16 /* BL = radix (hex) */
lea si,outstr/* SI = offset of outstr */
q_to_asce(); /* quad -> "string" */
lea si,outstr/* reset SI = offset of outstr */
put_str();/* "12A05F200 quad value in HEX"; */
label_100:
...
}
Source file _DCSQTAE.ASM ASM equiv QWORDS_TO_ASCE
{
char outstr[25], *strindx;
BCD bnum;
quad qnum;
...
_dec_to_uq("123456789012345678", bnum, &strindx);
_q_to_bcd(bnum, qnum);
_put_str(_bcd_to_dec(bnum, outstr));
...
}
#include <inline.h>
{
char outstr[25];
char instr[] = "123456789012345678";
BCD bnum;
quad qnum;
...
lea si,instr/* SI = offset of instr */
lea di,qnum /* DI = offset of quad */
dec_to_q(); /* "string" -> quad */
lea si,bnum /* SI = offset of bcd */
q_to_bcd(); /* convert quad to bcd */
mov di,si /* DI = offset of bcd */
lea si,outstr/* SI = offset of outstr */
bcd_to_dec(); /* bcd -> "string" */
put_str(); /* "123456789012345678" */
...
}
Source file _DCQBCD.ASM ASM equiv QWORDS_TO_BCD
{
char outstr[22];
char *strindx;
quad num;
...
_asc_to_q ("0xFFFF", 16, num, &strindx);
if ( c_code != 0 )
_put_str(_q_to_dec(num,outstr)); /* "-1" */
...
}
#include <inline.h>
{
char outstr[22];
char instr[] = "0xFFFFFFFFFFFFFFFF";
quad num;
...
lea si,instr/* SI = offset of instr */
pushss
pop es /* ES = SS (quad on stack) */
lea di,num /* DI = offset of num */
mov bl,16 /* BL = radix (hex) */
asc_to_q(); /* "string" -> quad */
lea si,outstr/* SI = offset of outstr */
q_to_dec(); /* quad -> "string" */
put_str(); /* "-1" */
...
}
Source file _DCSQTD.ASM ASM equiv QWORDS_TO_DECE
{
char *outstr = " quad value";
char *strindx;
quad num;
...
_asc_to_q("0xFFFF", 16, num, &strindx);
if ( c_code != 0 )
{
_q_to_dece(num,outstr);
_put_str(outstr);/* "-1 quad value" */
}
...
}
#include <inline.h>
{
char outstr[] = " quad value";
char instr[] = "0xFFFFFFFFFFFFFFFF";
quad num;
...
lea si,instr/* SI = offset of outstr */
pushss
pop es /* ES = SS (quad on stack) */
lea di,num /* DI = offset of num */
mov bl,16 /* BL = radix (hex) */
asc_to_q(); /* "string" -> quad */
lea si,outstr/* SI = offset of outstr */
q_to_dece(); /* quad -> "string" */
lea si,outstr/* reset SI = offset of outstr */
put_str(); /* "-1" */
...
}
Source file _DCSQTDE.ASM ASM equiv QWORDS_TO_DECE
{
char outstr[10];
_put_str(_uc_to_asc (255, 2, outstr));
/* binary result "11111111" */
...
}
#include <inline.h>
{
char outstr[10];
...
mov al,255 /* AL = num */
mov bl,2 /* BL = radix (binary) */
lea si,outstr/* SI = offset of outstr */
uc_to_asc(); /* num -> "string" */
put_str(); /* display conversion result */
...
}
Source file _DCCTOA.ASM ASM equiv BYTE_TO_ASC
{
char outstr[] = " is the hex value";
_uc_to_asce("255", 16, outstr);
_put_str(outstr); /* "FF is the hex value" */
...
}
#include <inline.h>
{
char outstr[] = " is the hex value";
...
mov al,255 /* AL = num */
mov bl,16 /* BL = radix (hex) */
lea si,outstr/* SI = offset of outstr */
uc_to_asce(); /* num -> "string" */
lea si,outstr/* reset SI = offset outstr */
put_str(); /* "FF is the hex value" */
...
}
Source file _DCCTOAE.ASM ASM equiv BYTE_TO_ASCE
{
char outstr[10];
_put_str(_uc_to_dec(0xFF,outstr)); /* "255" */
...
}
#include <inline.h>
{
char outstr[10];
...
mov al,0xFF /* AL = num */
lea si,outstr/* SI = offset of outstr */
uc_to_dec(); /* num -> "string" */
put_str(); /* "255" */
...
}
Source file _DCCTOD.ASM ASM equiv BYTE_TO_DEC
{
char outstr[25] = " is the result";
_uc_to_dece(0xFE,outstr);
_put_str(outstr); /* "254 is the result" */
...
}
#include <inline.h>
{
char outstr[] = " is the result";
...
mov al,0xFE /* AL = num */
lea si,outstr/* SI = offset of outstr */
uc_to_dece(); /* num -> "string" */
lea si,outstr/* reset SI = offset outstr */
put_str(); /* "254 is the result." */
...
}
Source file _DCCTODE.ASM ASM equiv BYTE_TO_DECE
{
char outstr[3];
_put_str(_uc_to_hex(253,outstr)); /* "FD" */
...
}
#include <inline.h>
{
char outstr[3];
...
mov al,255 /* AL = num */
lea si,outstr/* SI = offset of outstr */
uc_to_hex(); /* num -> "string" (hex) */
put_str(); /* "FF" */
...
}
Source file _DCCTOH.ASM ASM equiv BYTE_TO_HEX
{
char outstr[81] = " is conversion result";
_uc_to_hexe(255,outstr);
_put_str(outstr); /* "FF is conversion result" */
...
}
#include <inline.h>
{
char outstr[81] = " is conversion result";
...
mov al,127 /* AL = num */
lea si,outstr/* SI = offset of outstr */
uc_to_hexe(); /* num -> "string" (hex) */
lea si,outstr/* reset SI = offset outstr */
put_str(); /* "7F is conversion result" */
...
}
Source file _DCCTOHE.ASM ASM equiv BYTE_TO_HEXE
{
char outstr[10];
_put_str(_ufixpi_to_dec(-1, 2, outstr)); /* "655.35" */
}
#include <inline.h>
{
char outstr[80];
...
mov ax,-1 /* AX = 65535 */
mov ch,2 /* CH = precision */
lea si,outstr/* SI = offset of outstr */
ufixpi_to_dec();/* fixed-pt int -> "string" */
put_str(); /* "655.35" */
...
}
Source file _DCXIDC.ASM ASM equiv FIXPW_TO_DEC
{
char outstr[] = " is the result.";
_ufixpi_to_dece(10000, 2, outstr);
_put_str(outstr);/* "100.00 is the result." */
}
#include <inline.h>
{
char outstr[] = " is the result.";
...
mov ax,10000/* AX = 10000 */
mov ch,2 /* CH = precision */
lea si,outstr/* SI = offset of outstr */
ufixpi_to_dece();/* fixed-pt int -> "string..."*/
lea si,outstr/* reset SI = offset of outstr */
put_str(); /* "100.00 is the result." */
...
}
Source file _DCXIDCE.ASM ASM equiv FIXPW_TO_DECE
{
char outstr[10];
_put_str(_ufixpl_to_dec(-1, 2, outstr)); /* "42949672.95" */
}
#include <inline.h>
{
char outstr[20];
...
mov ax,-1
mov dx,ax /* DX;AX = -1 */
mov ch,2 /* CH = precision */
lea si,outstr/* SI = offset of outstr */
ufixpl_to_dec();/* fixed-pt long -> "string" */
put_str(); /* "42949672.95" */
...
}
Source file _DCXLDC.ASM ASM equiv FIXPDW_TO_DEC
{
char outstr[] = " is the result.";
_ufixpl_to_dece(-1, 2, outstr);
_put_str(outstr);/* "4294972.95 is the result." */
}
#include <inline.h>
{
char outstr[50] = " is the result.";
...
mov ax,-1
mov dx,ax /* DX;AX = -1 */
mov ch,2 /* CH = precision */
lea si,outstr/* SI = offset of outstr */
ufixpl_to_dece();/* fixed-pt long -> "string" */
lea si,outstr/* reset SI = offset of outstr */
put_str(); /* "4294972.95 is the result." */
...
}
Source file _DCXLDCE.ASM ASM equiv FIXPDW_TO_DECE
{
char outstr[40], *strindx;
uquad num;
...
_dec_to_ufixpq("18446744073709551615", 0, num, &strindx);
...
_put_str(_ufixpq_to_dec(num, 2, outstr));
/* "184467440737095516.15" */
...
}
#include <inline.h>
{
char outstr[40], instr[] = "18446744073709551615";
uquad num;
...
lea di,num /* DI = offset of num */
lea si,instr/* SI = offset of outstr */
xor ch,ch /* read with precision of 0 */
dec_to_ufixpq();/* "string" -> fixed-pt quad */
lea si,outstr/* reset SI = offset of outstr */
mov ch,2 /* CH = precision */
ufixpq_to_dec();/* fixed-pt quad -> "string" */
put_str(); /* "184467440737095516.15" */
...
}
Source file _DCXQDC.ASM ASM equiv FIXPQW_TO_DEC
{
char *strindx;
char outstr[] = " is the result.";
uquad num;
...
_dec_to_ufixpq(0, "18446744073709551615", num, &strindx);
...
_ufixpq_to_dece(num, 2, outstr);
_put_str(outstr);
/* "184467440737095516.15 is the result." */
}
#include <inline.h>
{
char instr[] = "184467440737095516.15";
char outstr[] = " is the result.";
uquad num;
...
lea di,num /* DI = offset of num */
lea si,instr/* SI = offset of instr */
xor ch,ch /* CH = precision */
dec_to_ufixpq();/* "string" -> fixed-pt quad */
lea si,outstr/* SI = offset of outstr */
mov ch,2 /* CH = precision */
ufixpq_to_dece();/* fixed-pt quad -> "string" */
lea si,outstr/* reset SI = offset of outstr */
put_str(); /* "184467440737095516.15 is the result." */
...
}
Source file _DCXQDCE.ASM ASM equiv FIXPQW_TO_DECE
{
char outstr[20];
_put_str(_ui_to_asc(0xFFFF,2,outstr));
/* "1111111111111111" */
...
}
#include <inline.h>
{
char outstr[20];
...
mov ax,0xFFFE/* AX = num */
mov bl,2 /* BL = radix */
lea si,outstr/* SI = offset of outstr */
ui_to_asc(); /* unsigned int -> "string" */
put_str(); /* "1111111111111111" */
...
}
Source file _DCITOA.ASM ASM equiv WORD_TO_ASC
{
char outstr[] = " is the result";
_ui_to_asce("65535", 16, outstr)
_put_str(outstr); /* "FFFF is the result" */
...
}
#include <inline.h>
{
char outstr[] = " is the result";
...
mov al,0xF0F0/* AX = num */
mov bl,10 /* BL = radix */
lea si,outstr/* SI = offset of outstr */
ui_to_asce(); /* unsigned -> "string..." */
lea si,outstr/* reset SI = offset outstr */
put_str(); /* "61680 is the result" */
...
}
Source file _DCITOAE.ASM ASM equiv WORD_TO_ASCE
{
char outstr[10];
_put_str(_ui_to_dec(0xF0F0,outstr)); /* "61680" */
...
}
#include <inline.h>
{
char outstr[10];
...
mov ax,0xF0F0
lea si,outstr/* SI = offset of outstr */
ui_to_dec(); /* unsigned int -> "string" */
put_str(); /* "61680 */
...
}
Source file _DCITOD.ASM ASM equiv WORD_TO_DEC
{
char outstr[] = " is the result";
_ui_to_dece (0x8000,outstr);
_put_str(outstr); /* "32768 is the result" */
...
}
#include <inline.h>
{
char outstr[50] = " is the result";
...
mov ax,0xFFFE/* AX = num */
lea si,outstr/* SI = offset of outstr */
ui_to_dece();
lea si,outstr/* reset SI = offset outstr */
put_str(); /* "65534 is the result" */
...
}
Source file _DCITODE.ASM ASM equiv WORD_TO_DECE
{
char outstr[10];
_put_str(_ui_to_hex(65535)); /* "FFFF" */
...
}
#include <inline.h>
{
char outstr[10];
...
mov ax,65535/* AX = num */
lea si,outstr/* SI = offset of outstr */
ui_to_hex(); /* unsigned int -> "string" */
put_str() /* "FFFF" */
...
}
Source file _DCITOH.ASM ASM equiv WORD_TO_HEX
{
char *outstr = " is conversion result";
_ui_to_hexe(65535,outstr);
_put_str(outstr); /* "FFFF is conversion result" */
...
}
#include <inline.h>
{
char outstr[] = "0x is the result";
...
mov ax,32768/* AX = num */
lea si,outstr/* SI = offset of outstr */
add si,2 /* point past "0x" */
ui_to_hexe(); /* num -> "string" */
lea si,outstr/* reset SI = offset outstr */
put_str(); /* "0x8000 is the result" */
...
}
Source file _DCITOHE.ASM ASM equiv WORD_TO_HEXE
{
char *outstr = " is binary result";
...
_put_str(_ul_to_asc(511,2,outstr)); /* "111111111" */
...
}
#include <inline.h>
{
char outstr[50];
...
mov ax,0xFFFF
mov dx,0xFFFF/* DX:AX = unsigned long */
mov bl,2 /* BL = radix */
lea si,outstr/* SI = offset of outstr */
ul_to_asc(); /* num -> "string"
put_str(); /* "11111111111111111111111111111111 " */
...
}
Source file _DCLTOA.ASM ASM equiv DWORD_TO_ASC
{
char *outstr = " is binary result";
_ul_to_asce(511,2,outstr);
_put_str(outstr ); /* "111111111 is binary result" */
...
}
#include <inline.h>
{
char outstr[50]=" as binary";
...
mov ax,0xFFFF
mov dx,0xFFFF/* DX:AX = unsigned long */
mov bl,2 /* BL = radix */
lea si,outstr/* SI = offset of outstr */
ul_to_asce(); /* num -> "string"
lea si,outstr/* reset SI = offset outstr */
put_str(); /* "11111111111111111111111111111111 ..." */
...
}
Source file _DCLTOAE.ASM ASM equiv DWORD_TO_ASCE
{
char outstr[81];
_put_str(_ul_to_dec(0xFFFFFFFF, outstr)); /* "4294967295" */
...
}
#include <inline.h>
{
char outstr[81];
...
mov ax,0xFFFF
mov dx,0xFFFF/* DX;AX = num */
lea si,outstr/* SI = offset of outstr */
ul_to_dec(); /* unsigned long -> "string" */
put_str(); /* "4294967295" */
...
}
Source file _DCLTOD.ASM ASM equiv DWORD_TO_DEC
{
char outstr[] = " is ...";
_ul_to_dece(0xFFFFFFFF, outstr);
_put_str(outstr); /* "4294967295 is ..." */
...
}
#include <inline.h>
{
char outstr[] = " is the result.";
unsigned long num = 0xFFFFFFFF;
...
lea si,outstr/* SI = offset of outstr */
mov ax,num
mov dx,num+2/* DX;AX = num */
ul_to_dece(); /* num -> "string" */
lea si,outstr/* reset SI = offset outstr */
put_str(); /* "4294967294 is the result." */
...
}
Source file _DCLTODE.ASM ASM equiv DWORD_TO_DECE
{
char outstr[20];
uquad num1, num2;
...
_mov_uql (num1, 4294967295);
_mov_uql (num2, 4294967295);
_put_str(_uq_to_asc(_add_uqq(num1, num2), 16, outstr));
/* "FFFFFFFFFFFFFFFF" */
...
}
#include <inline.h>
{
char outstr[20], instr[50] = "123456789012345678";
uquad num;
...
lea si,instr/* SI = offset of instr */
lea di,num /* DI = offset of num */
mov bl,10 /* BL = radix (dec) */
asc_to_uq(); /* "string" -> num */
mov bl,10 /* BL = radix (dec) */
lea si,outstr/* SI = offset of outstr */
uq_to_asc(); /* num -> "string" */
put_str(); /* "123456789012345678" */
...
}
Source file _DCQTOA.ASM ASM equiv QWORD_TO_ASC
{
char *outstr = " uquad value in HEX";
char *strindx;
uquad num;
...
_dec_to_uq("5000000000", num, &strindx);
if (c-code == 0)
{
_uq_to_asce(num, 16, outstr);
_put_str(outstr);/* "12A05F200" */
}
...
}
#include <inline.h>
{
char *outstr = " milliseconds since last day off";
char instr[50] = "31536000000";
uquad num;
...
lea si,instr/* SI = offset of instr */
lea di,num /* DI = offset of num */
mov bl,10 /* BL = radix (dec) */
asc_to_uq(); /* "string" -> num */
mov bl,10 /* BL = radix (dec) */
lea si,outstr/* SI = offset of outstr */
uq_to_asce(); /* num -> "string" */
lea si,outstr/* reset SI = offset outstr */
put_str(); /* "31536000000 millisec..." */
...
}
Source file _DCQTOAE.ASM ASM equiv QWORD_TO_ASCE
{
char *outstr = " uquad value in HEX";
char *strindx;
uquad num;
...
_dec_to_uq("5000000000", num, &strindx);
if (c_code == 0)
_put_str(_uq_to_dec(num, outstr));
...
}
#include <inline.h>
{
char outstr[22];
char instr[50] = "31536000000";
uquad num;
...
lea si,instr/* SI = offset of instr */
lea di,num /* DI = offset of num */
dec_to_uq(); /* "string" -> num */
lea si,outstr/* SI = offset of outstr */
uq_to_dec(); /* num -> "string" */
put_str(); /* "31536000000" */
...
}
Source file _DCQTOD.ASM ASM equiv QWORD_TO_DEC
{
char *outstr = " quad value";
char *strindx;
uquad num;
...
_dec_to_uq("100000000", num, &strindx);
_uq_to_dece (num, outstr);
_put_str(outstr); /* "100000000 quad value" */
...
}
#include <inline.h>
{
char outstr[50] = " quad value";
char instr[20] = "100000000";
uquad num;
...
lea si,instr/* SI = offset of instr */
lea di,num /* DI = offset of num */
dec_to_uq(); /* "string" -> num */
lea si,outstr/* SI = offset of outstr */
uq_to_dece(); /* uquad -> "string" */
lea si,outstr/* reset SI = offset outstr */
put_str(); /* "100000000 quad value" */
...
}
Source file _DCQTODE.ASM ASM equiv QWORD_TO_DECE