M6800 User Group Library

Entry #001

Programmer: N/A

Company: Motorola, Inc.

Program Title: EXBUG CBCDHZ subroutine (Convert a hexadecimal character to a binary number)

Function: Verify input is a hexadecimal digit character. Convert character to a 4 bit binary number with high order 4 bits equal to zero. Set "N" (Negative) condition code for non-hexadecimal character. Call: JSR CBCDHX

Parameters: Character to convert must be in Accumulator A.

Results: If hexadecimal character input, accumulator A contains the 4 bit binary number represented by the input character and the "N" (Negative) condition code cleared. If non-hexadecimal character input, Accumulator A contains the character input and the "N" (Negative) condition code is set.

Hardware Configuration: Motorola EXORciser

Memory Required: N/A

Software Support: EXBUG 1.1

Assembler/Compiler: N/A

LINE  ADDR OP OPER	LABEL	OPCODE	OPERAND/COMMENT
----- ---- -- ----	-----	------	-----------------------------------
00001		NAM	CBCDHX Test Test
00002	; Generate S-Records - S0, S5, S1_Start, S1_End.
00003        		OPT	S19_START=$FAA5,S19_END=$FAC0
00004	; Generate Intel Hex file..
00005        		OPT	IHEX_START=$FAA5,IHEX_END=$FAC0
00006	;
00007      FAA0	INCHNP	EQU	$FAA0	
00008      FAF4	ALLONE	EQU	$FAF4	
00009 FAA5		ORG	$FAA5	
00010	; REV. 1.0 BY MOTOROLA MICROSYSTEMS MARCH 15, 1977
00011	;
00012	; ALL REFERENCES TO ROUTINE VIA EXBUG SHOULD 
00013	; USE EXBUG'S JUMP VECTOR ENTRY AT $F006
00014	;
00015	; INPUT ONE HEXADECIMAL CHAR CONVERT TO BCD
00016	; NEG CONDITION CODE, RESET = GOOD HEX; SET = NOT
00017 FAA5 8D F9	IN1H	BSR	INCHNP	
00018 FAA7 81 30	CBCDHX	CMPA	#$30	; (CONVERT BCD TO HEX)
00019 FAA9 2B 11		BMI	IN1HB	; NOT HEXs
00020 FAAB 81 39		CMPA	#$39	
00021 FAAD 2F 0A		BLE	IN1HG	; GOOD HEX
00022 FAAF 81 41		CMPA	#$41	
00023 FAB1 2B 09		BMI	IN1HB	; NOT HEX
00024 FAB3 81 46		CMPA	#$46	
00025 FAB5 2E 05		BGT	IN1HB	; NOT HEX
00026 FAB7 80 07		SUBA	#7	
00027 FAB9 84 0F	IN1HG	ANDA	#$F	; MASK TO BCD-RESET NEG CODE
00028 FABB 39		RTS		
00029 FABC 7D FA F4	IN1HB	TST	ALLONE	; SET NEG CONDITION CODE
00030 FABF 39		RTS		
00031		END	

Total Errors: 0

Symbol Table Sorted Alphabetically

Symbol - Value	Symbol - Value	Symbol - Value	
ALLONE - $FAF4	IN1H - $FAA5	IN1HG - $FAB9	
CBCDHX - $FAA7	IN1HB - $FABC	INCHNP - $FAA0	

S-Records - Addresses $FAA5 to $FAC0

S00600004844521B
S110FAA58DF9811E2B0B81272F0081292B09812E8B
S10BFAB52E0580078400397DFAF4392A
S5030002FA
S9030000FC

Intel Hex Records - Addresses $FAA5 to $FAC0

:10FAA5008DF9811E2B0B81272F0081292B09812E92
:0BFAB5002E0580078400397DFAF4392B
:00000001FF