emailler/test/httpd.s

90 lines
1.8 KiB
ArmAsm
Raw Normal View History

.include "../inc/common.i"
.include "../inc/commonprint.i"
.include "../inc/net.i"
.export start
.import exit_to_basic
2013-12-13 21:24:03 +00:00
.import httpd_start
.import http_get_value
2014-04-28 16:41:54 +00:00
; keep LD65 happy
.segment "INIT"
.segment "ONCE"
2014-04-28 16:41:54 +00:00
.segment "STARTUP"
2013-12-13 21:24:03 +00:00
lda #14
jsr print_a ; switch to lower case
2013-12-13 21:24:03 +00:00
start:
ldax #initializing
jsr print
init_ip_via_dhcp
bcs :+
jsr print_ip_config
2013-12-13 21:24:03 +00:00
ldax #listening
jsr print
ldax #httpd_callback
jsr httpd_start
: jmp exit_to_basic
2013-12-13 21:24:03 +00:00
print_vars:
lda #'h'
jsr http_get_value
2013-12-13 21:24:03 +00:00
bcs :+
jsr print
ldax #said
jsr print
2013-12-13 21:24:03 +00:00
lda #'m'
jsr http_get_value
2013-12-13 21:24:03 +00:00
bcs :+
jsr print
jsr print_cr
: rts
2013-12-13 21:24:03 +00:00
httpd_callback:
jsr print_vars
ldax #html
ldy #2 ; text/html
2013-12-13 21:24:03 +00:00
clc
rts
.rodata
2013-12-13 21:24:03 +00:00
initializing:
.byte 13,"INITIALIZING",13,0
2013-12-13 21:24:03 +00:00
listening:
.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
; -- 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-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-13 21:24:03 +00:00
; The Original Code is ip65.
;
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
; Jonno Downes. All Rights Reserved.
2013-12-13 21:24:03 +00:00
; -- LICENSE END --