Download Print this page

Radio Shack TRS-80 Model II Reference Manual page 230

Disk operating system
Hide thumbs Also See for TRS-80 Model II:

Advertisement

Model II TRSDOS
BINDEC
Binary/Decimal (function code 21)
This routine converts a two-byte binary number to ASCII-coded decimal,
and vice versa. Decimal range is [0,65535].
Entry Conditions
B
=
Function Switch:
If B
=
0, then convert binary to ASCII decimal
If B is not 0, then convert ASCII decimal to binary
Contents of other registers when B = 0, binary to decimal:
DE
= Two-byte binary number to convert
(HL)
=
5-byte area to contain ASCII-coded decimal value upon return. The
field will contain decimal digits
(X'30'-X'39'),
leading zeroes on the
left as necessary to fill the field; for example, the number 21 would
be:
00021
Contents of other registers when B is not 0, decimal to binary:
(HL)
= 5-byte area containing ASCII decimal value to be converted to
binary
A
=
21
Exit Conditions
(HL)
=
Decimal value
DE
=
Binary value
266

Advertisement

loading