AN2183 Freescale Semiconductor / Motorola, AN2183 Datasheet - Page 38

no-image

AN2183

Manufacturer Part Number
AN2183
Description
Using FLASH as EEPROM on the MC68HC908GP32
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Application Note
GetHexByte1:
GetHexByte2:
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
FromHex:
FromHex1:
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
ToHex:
ToHex1:
38
FromHex Subroutine
This subroutine converts the value passed in the lower nibble of ACC to it’s ASCII
equivalent.
Calling convention:
Returns:
Changes:
ToHex Subroutine
This subroutine converts the ASCII hex value passed in ACC to a binary hex value.
Calling convention:
Returns:
Changes:
jsr
bsr
bsr
bne
bsr
add
bit
ais
rts
jsr
and
add
cmp
bls
add
rts
lda
jsr
sub
cmp
bls
sub
rts
GetChar
PutChar
IsHex
GetHexByte1
ToHex
1,sp
#0
#1
FromHex
ACC= data.
ACC
#$0F
#’0’
#’9’
FromHex1
#7
data
ToHex
ACC= data.
ACC
#’0’
#9
ToHex1
#7
=======================================================================
=====================================================================
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
; get lsb character from the SCI
; echo it back
; check if valid ASCII hex character
; exit if not
; convert ASCII hex character to hex value
; combine msb and lsb nibbles
; CCRZ= 1
; deallocate local variable
; return
; mask off upper nibble
; add ASCII offset for ’0’
; check if result is between ’0’ to ’9’
; skip if so
; else, adjust for value between ’A’ to ’F’
; return
; adjust first by subtracting ’0’
; check if value was between ’0’ to ’9’
; exit if so
; else, adjust for value between ’A’ to ’F’
; return
MOTOROLA
AN2183

Related parts for AN2183