2014-04-27 15:47:07 +00:00
|
|
|
.include "../inc/common.i"
|
|
|
|
.include "../inc/commonprint.i"
|
|
|
|
.include "../inc/net.i"
|
2013-12-27 13:57:56 +00:00
|
|
|
|
2014-04-27 15:47:07 +00:00
|
|
|
.import exit_to_basic
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2014-04-27 15:47:07 +00:00
|
|
|
.import httpd_start
|
|
|
|
.import http_get_value
|
2013-12-19 21:04:19 +00:00
|
|
|
|
|
|
|
|
2014-04-28 16:41:54 +00:00
|
|
|
; keep LD65 happy
|
|
|
|
.segment "ZPSAVE"
|
|
|
|
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
.segment "STARTUP"
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
lda #14
|
2013-12-27 13:57:56 +00:00
|
|
|
jsr print_a ; switch to lower case
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2014-04-27 15:47:07 +00:00
|
|
|
ldax #initializing
|
|
|
|
jsr print
|
|
|
|
init_ip_via_dhcp
|
2015-07-08 13:44:48 +00:00
|
|
|
bcs :+
|
2014-04-27 15:47:07 +00:00
|
|
|
jsr print_ip_config
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2014-04-27 15:47:07 +00:00
|
|
|
ldax #listening
|
|
|
|
jsr print
|
|
|
|
ldax #httpd_callback
|
|
|
|
jsr httpd_start
|
2013-12-19 21:04:19 +00:00
|
|
|
|
2015-07-08 13:44:48 +00:00
|
|
|
: jmp exit_to_basic
|
2013-12-19 21:04:19 +00:00
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
print_vars:
|
|
|
|
lda #'h'
|
2014-04-27 15:47:07 +00:00
|
|
|
jsr http_get_value
|
2013-12-13 21:24:03 +00:00
|
|
|
bcs :+
|
2014-04-27 15:47:07 +00:00
|
|
|
jsr print
|
|
|
|
ldax #said
|
|
|
|
jsr print
|
2013-12-13 21:24:03 +00:00
|
|
|
lda #'m'
|
2014-04-27 15:47:07 +00:00
|
|
|
jsr http_get_value
|
2013-12-13 21:24:03 +00:00
|
|
|
bcs :+
|
2014-04-27 15:47:07 +00:00
|
|
|
jsr print
|
|
|
|
jsr print_cr
|
2013-12-27 13:57:56 +00:00
|
|
|
: rts
|
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
httpd_callback:
|
|
|
|
jsr print_vars
|
|
|
|
ldax #html
|
2014-04-27 15:47:07 +00:00
|
|
|
ldy #2 ; text/html
|
2013-12-13 21:24:03 +00:00
|
|
|
clc
|
|
|
|
rts
|
|
|
|
|
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
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
initializing:
|
2015-07-08 13:44:48 +00:00
|
|
|
.byte 13,"INITIALIZING",13,0
|
2013-12-13 21:24:03 +00:00
|
|
|
listening:
|
2015-04-13 20:38:55 +00:00
|
|
|
.byte "LISTENING",13,0
|
2013-12-13 21:24:03 +00:00
|
|
|
said:
|
|
|
|
.byte ":",0
|
|
|
|
html:
|
|
|
|
.byte "<h1>hello world</h1>%?mMessage recorded as '%$h:%$m'%.<form>Your Handle:<input name=h type=text length=20 value='%$h'><br>Your Message: <input type=text lengh=60 name='m'><br><input type=submit></form><br>",0
|
|
|
|
|
2013-12-19 21:04:19 +00:00
|
|
|
|
|
|
|
|
2014-04-27 15:47:07 +00:00
|
|
|
; -- LICENSE FOR httpd.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 --
|