forked from OldSkoolCoder/OSKMon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibDecimalCommand.asm
34 lines (31 loc) · 1.32 KB
/
libDecimalCommand.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
;*******************************************************************************
;* Decimal Convertor Operation *
;*******************************************************************************
;* Syntax : # (number)
;*******************************************************************************
;** decimal conv. -- syntax :- # (number) **
COM_DECIMAL
jsr bas_InLine$ ; Get 16 Bit Decimal Number from command line
lda #0
ldx #2
sta $7a
stx $7b
jsr bas_FrmNum$ ; Convert from Floating Point Number in FAC1
jsr bas_GetAddr$ ; Get 16 Bit Address from FAC1
jsr PrintCarrageReturnAndLineFeed
jsr HEXPR ; Print Hexadecimal Number
jsr PrintCarrageReturnAndLineFeed
jsr BINPR ; Print Binary Number
jsr PrintCarrageReturnAndLineFeed
jsr OCTPR ; Display Octal Number
jmp READY
;*******************************************************************************
DECPR
lda #"#" ; Load Hash
jsr krljmp_CHROUT$ ; Print Character
lda #CHR_Equals ; Load Equals
jsr krljmp_CHROUT$ ; Print Character
jsr SPACE
lda HT + 1 ; Load Hi Value
ldx HT ; Load Lo Value
jmp bas_LinePrint$ ; Print Decimal Number