better layout, more menu works

This commit is contained in:
Dagen Brock 2015-09-22 22:00:30 -05:00
parent 0913a5fd89
commit eb1c2ac00a
2 changed files with 111 additions and 29 deletions

View File

@ -542,3 +542,84 @@ HexCharForByte
:alpha clc
adc #"A"
rts
BINBCD16 SED ; Switch to decimal mode
LDA #0 ; Ensure the result is clear
STA BCD+0
STA BCD+1
STA BCD+2
LDX #16 ; The number of source bits
:CNVBIT ASL BIN+0 ; Shift out one bit
ROL BIN+1
LDA BCD+0 ; And add into result
ADC BCD+0
STA BCD+0
LDA BCD+1 ; propagating any carry
ADC BCD+1
STA BCD+1
LDA BCD+2 ; ... thru whole result
ADC BCD+2
STA BCD+2
DEX ; And repeat for next bit
BNE :CNVBIT
CLD ; Back to binary
RTS
BIN dw $03e7
BCD ds 3
* 16-bit mode!!!
BCDBIN16 clc
xce
rep #$30
stz BIN
lda BCD
and #$000F ;get 1's
sta BIN
lda BCD
and #$00F0 ;get 10's
lsr
lsr
lsr
lsr
jsr TIMES10
clc
adc BIN ;add 10's back to BIN
sta BIN
lda BCD
and #$0f00 ;get 100's
xba
jsr TIMES10
jsr TIMES10
clc
adc BIN
sta BIN
lda BCD
and #$f000 ;get 1000's
xba
lsr
lsr
lsr
lsr
jsr TIMES10
jsr TIMES10
jsr TIMES10
clc
adc BIN
sta BIN
sep #$30
RTS
* 16-bit mode!!!
TIMES10
sta :tensadd+1
ldx #10 ;m*10
:tensloop clc
:tensadd adc #$0000 ;placeholder, gets overwritten above
dex
bne :tensloop
RTS
mx %00

View File

@ -12,6 +12,7 @@
MLI equ $bf00
Init
jsr BINBCD16
sei ; disable interrupts
LDA #$A0 ;USE A BLANK SPACE TO
JSR $C300 ;TURN ON THE VIDEO FIRMWARE
@ -701,7 +702,7 @@ MainMenuDefs
db MenuOption_Int ; 1=hex input
db 03 ; display/entry width. ints are 16-bit internally
da TestIterations ; variable storage
:BeginTest hex 20,0F ; x,y
:BeginTest hex 1C,0F ; x,y
db MenuOption_Action ; 2=action
db MenuStr_BeginTestL ; menu string length
da MenuStr_BeginTest ; string storage
@ -729,7 +730,7 @@ MainMenuStrs
asc $1B,'ZZ'," Adjacent Wr. [ ] Refresh Pause [000] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
asc $1B,'ZZ'," Read Repeat [000] Write Repeat [000] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
asc $1B,'ZZ'," Iterations [000] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
asc $1B,'ZZ'," ",'_'," ",'Z'," ",'_'," ",'_',$18,00
asc $1B,'ZZ'," ( ) ",'_'," ",'Z'," ",'_'," ",'_',$18,00
asc $1B,'ZLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL_',$18,00
asc $1B,'Z'," ",'_',$18,00
asc $1B,'Z'," ",'_',$18,00