With all the network cards for the C64 these days, a user-friendly IP address input/parsing routine might be handy. Here's one I wrote for Artillery Duel - could be optimized, but hopefully easy to follow. Use in conjunction with the [[robust_string_input]] code. DASM. ; ====================================== ; IP Address Input routine - Schema/AIC ; ====================================== ;Converts e.g. ;192.168.1.64 ;to ;ABC ABC ABC ABC ;192.168.001.064 ;and then to 4 bytes at gotip include "robust_string_input.asm" IPADDRESS_FILTER dc.b "1234567890.",0 getip lda #$00 sta $cc ; Force cursor to flash lda #>IPADDRESS_FILTER ldx #255 bcs INVALIDIP ;Save the returned byte ldy IPINDEX sta gotip,y inc IPINDEX lda IPINDEX cmp #$04 ;Done beq IP_DONE inc STRINDEX ;Skip over the '.' jmp NEXTBYTE IP_DONE rts INVALIDIP ; ERROR MESSAGE HERE! inc $d020 jmp INVALIDIP rts ;=================================================== ; Convert three-digit decimal (ABC) into a byte ;=================================================== dec2hex lda A jsr MULT10 jsr MULT10 ;x100 sta TMP0 lda B jsr MULT10 ;x10 sta TMP1 lda C sta TMP2 ;x1 clc lda #$00 adc TMP0 adc TMP1 adc TMP2 rts ;Carry will be set if result was > 255 ; =================== TMP0 dc.b #$00 TMP1 dc.b #$00 TMP2 dc.b #$00 A ;First digit dc.b #$00 B ;Second digit dc.b #$00 C ;Third digit dc.b #$00 ; ======================================================================= ; Multiply by 10 - from http://www.6502.org/source/integers/fastx10.htm MULT10 ASL ;multiply by 2 STA TEMP10 ;temp store in TEMP ASL ;again multiply by 2 (*4) ASL ;again multiply by 2 (*8) CLC ADC TEMP10 ;as result, A = x*8 + x*2 RTS TEMP10 .byte 0