
68 CHAPTER 5. TABLES
hexchars fcc /0123456789AaBbCcDdEeFf/
hextrans fcb 0,1,2,3,4
fcb 5,6,7,8,9
fcb 10,10, 11,11, 12,12, 13,13, 14,14, 15,15
nhexchars equ 22
To illustrate the use of the translation table, let us write a function that will
translate telephone numbers. For example, if the input to the program is a mixture
of numbers and letters as in 1-800-CALLATT the program should translate it to
1-800-2255288. The translation table can be found on any telephone and is:
value translation
’A’, ’B’, ’C’ 2
’D’, ’E’, ’F’ 3
’G’, ’H’, ’I’ 4
’J’, ’K’, ’L’ 5
’M’, ’N’, ’O’ 6
’P’, ’Q’, ’R’, ’S’ 7
’T’, ’U’, ’V’ 8
’W’, ’X’, ’Y’, ’Z’ 9
The following program sets up the above table and uses it to translate phone
numbers.
;Name:
;email:
;date:
;
; Standard buffalo equates
; Make sure you have ALL the equates in the file.
;
ucase equ $ffa0
wchek equ $ffa3
dchek equ $ffa6
init equ $ffa9
input equ $ffac
output equ $ffaf
outlhlf equ $ffb2
outrhlf equ $ffb5
outa equ $ffb8
out1byt equ $ffbb
out1bsp equ $ffbe
Comentarios a estos manuales