2013-12-27 13:57:56 +00:00
|
|
|
.include "../inc/common.i"
|
|
|
|
.include "../inc/commonprint.i"
|
|
|
|
.include "../inc/net.i"
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
.import exit_to_basic
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
.import parse_dotted_quad
|
|
|
|
.import dotted_quad_value
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
.segment "STARTUP"
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; switch to lower case charset
|
2013-12-29 22:39:35 +00:00
|
|
|
lda #14
|
|
|
|
jsr print_a
|
2013-12-15 21:50:01 +00:00
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
jsr print_cr
|
2013-12-15 21:50:01 +00:00
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
ldax #dotted_quad_1
|
2013-12-19 21:04:19 +00:00
|
|
|
jsr test_dotted_quad_string
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
ldax #dotted_quad_2
|
2013-12-19 21:04:19 +00:00
|
|
|
jsr test_dotted_quad_string
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
ldax #dotted_quad_3
|
2013-12-19 21:04:19 +00:00
|
|
|
jsr test_dotted_quad_string
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
ldax #dotted_quad_4
|
2013-12-19 21:04:19 +00:00
|
|
|
jsr test_dotted_quad_string
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
ldax #dotted_quad_5
|
2013-12-19 21:04:19 +00:00
|
|
|
jsr test_dotted_quad_string
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
ldax #dotted_quad_6
|
2013-12-19 21:04:19 +00:00
|
|
|
jsr test_dotted_quad_string
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
ldax #dotted_quad_7
|
2013-12-19 21:04:19 +00:00
|
|
|
jsr test_dotted_quad_string
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
jmp exit_to_basic
|
|
|
|
|
|
|
|
test_dotted_quad_string:
|
2013-12-27 13:57:56 +00:00
|
|
|
stax temp_ax
|
2013-12-13 21:24:03 +00:00
|
|
|
jsr print
|
|
|
|
lda #':'
|
|
|
|
jsr print_a
|
|
|
|
lda #' '
|
|
|
|
jsr print_a
|
2013-12-27 13:57:56 +00:00
|
|
|
ldax temp_ax
|
|
|
|
jsr parse_dotted_quad
|
2013-12-13 21:24:03 +00:00
|
|
|
bcs @error
|
|
|
|
ldax #dotted_quad_value
|
|
|
|
jsr print_dotted_quad
|
|
|
|
jsr print_cr
|
|
|
|
rts
|
|
|
|
|
|
|
|
@error:
|
2013-12-27 13:57:56 +00:00
|
|
|
ldax #failed_msg
|
2013-12-13 21:24:03 +00:00
|
|
|
jsr print
|
|
|
|
jsr print_cr
|
|
|
|
rts
|
2013-12-19 21:04:19 +00:00
|
|
|
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
.bss
|
2013-12-19 21:04:19 +00:00
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
temp_ax: .res 2
|
2013-12-19 21:04:19 +00:00
|
|
|
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
.rodata
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
dotted_quad_1:
|
2013-12-27 13:57:56 +00:00
|
|
|
.byte "1.1.1.1",0 ; should work
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
dotted_quad_2:
|
2013-12-27 13:57:56 +00:00
|
|
|
.byte "GOOBER",0 ; should fail
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
dotted_quad_3:
|
2013-12-27 13:57:56 +00:00
|
|
|
.byte "255.255.255.0",0 ; should work
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
dotted_quad_4:
|
2013-12-27 13:57:56 +00:00
|
|
|
.byte "111.222.333.444",0 ; should fail
|
|
|
|
|
|
|
|
dotted_quad_5:
|
|
|
|
.byte "111.22.3",0 ; should fail
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
dotted_quad_6:
|
|
|
|
.byte "111.22.3.4",0 ; should work
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
dotted_quad_7:
|
|
|
|
.byte "3.4.5.6X",0 ; should fail
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; -- LICENSE FOR testdottedquad.s --
|
2013-12-13 21:24:03 +00:00
|
|
|
; The contents of this file are subject to the Mozilla Public License
|
|
|
|
; Version 1.1 (the "License"); you may not use this file except in
|
|
|
|
; compliance with the License. You may obtain a copy of the License at
|
|
|
|
; http://www.mozilla.org/MPL/
|
2013-12-27 13:57:56 +00:00
|
|
|
;
|
2013-12-13 21:24:03 +00:00
|
|
|
; Software distributed under the License is distributed on an "AS IS"
|
|
|
|
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
|
|
; License for the specific language governing rights and limitations
|
|
|
|
; under the License.
|
2013-12-27 13:57:56 +00:00
|
|
|
;
|
2013-12-13 21:24:03 +00:00
|
|
|
; The Original Code is ip65.
|
2013-12-27 13:57:56 +00:00
|
|
|
;
|
2013-12-13 21:24:03 +00:00
|
|
|
; The Initial Developer of the Original Code is Jonno Downes,
|
|
|
|
; jonno@jamtronix.com.
|
|
|
|
; Portions created by the Initial Developer are Copyright (C) 2009
|
2013-12-27 13:57:56 +00:00
|
|
|
; Jonno Downes. All Rights Reserved.
|
2013-12-13 21:24:03 +00:00
|
|
|
; -- LICENSE END --
|