From 3d79a99023c2d9c58f1df7114c1bcc7ebaa0118e Mon Sep 17 00:00:00 2001 From: jonnosan Date: Sat, 13 Apr 2013 11:33:54 +0000 Subject: [PATCH] now correct git-svn-id: http://svn.code.sf.net/p/netboot65/code@333 93682198-c243-4bdb-bd91-e943c89aac3b --- client/a2/amper.s | 66 ++++++++++++++++++++++++++--------- client/a2/autoexec.applesoft | 2 ++ client/a2/autoexec.bas | Bin 272 -> 297 bytes 3 files changed, 51 insertions(+), 17 deletions(-) diff --git a/client/a2/amper.s b/client/a2/amper.s index ea03329..c0b9863 100644 --- a/client/a2/amper.s +++ b/client/a2/amper.s @@ -17,6 +17,7 @@ .importzp copy_dest .importzp buffer_ptr + .importzp scratch_ptr .import http_parse_request .import http_get_value @@ -264,7 +265,9 @@ httpd_handler: stax httpd_port_number tsx stx top_of_stack - + ldax #__http_variables_buffer + stax http_variables_buffer + ldax #listening jsr print ldax #cfg_ip @@ -392,8 +395,12 @@ http_callback: cmp #0 bne @look_for_eol rts - - + +send_buffer: + ldax output_buffer_length + stax tcp_send_data_len + ldax httpd_io_buffer + jsr tcp_send reset_output_buffer: ldax httpd_io_buffer @@ -403,21 +410,13 @@ reset_output_buffer: sta output_buffer_length sta output_buffer_length+1 rts - - -send_buffer: - ldax output_buffer_length - stax tcp_send_data_len - ldax httpd_io_buffer - jsr tcp_send - jmp reset_output_buffer emit_string: - stax copy_src + stax scratch_ptr ldy #0 @next_byte: - lda (copy_src),y + lda (scratch_ptr),y beq @done jsr xmit_a iny @@ -426,15 +425,48 @@ emit_string: rts got_http_request: + jsr http_parse_request + ldax #path jsr print lda #$02 jsr http_get_value - stax copy_src + stax scratch_ptr jsr print jsr print_cr + + ldy #0 +@find_null: + lda (scratch_ptr),y + beq @found_null + iny + bne @find_null +@found_null: + sty param_length + + lda #'P' + sta VARNAM + lda #'A'+$80 + sta VARNAM+1 + jsr GETVAR ;find the variable of this name (or else make a blank one) + lda param_length + jsr GETSPA ;create space in the string table of appropriate length + ldy #$00 ;set up string variable pointer + sta (VARPNT),Y ;string length + iny + lda FRESPC ;lo byte of area just reserved + sta (VARPNT),Y + iny + lda FRESPC+1 ;hi byte of area just reserved + sta (VARPNT),Y + + ldx scratch_ptr + ldy scratch_ptr+1 + lda param_length + jsr MOVSTR + ;now restore stack to how it was when &HTTPD was called, and return to BASIC ldx top_of_stack txs @@ -471,7 +503,7 @@ send_header: ldax #content_type_buffer jsr emit_string ldax #end_of_header - jmp emit_string + jsr emit_string flush_handler: lda output_buffer_length @@ -595,7 +627,6 @@ xmit_a_ptr: .bss -transfer_buffer: .res 256 param_length: .res 1 ping_counter: .res 1 handler_address: .res 2 @@ -610,5 +641,6 @@ tcp_buffer_ptr: .res 2 top_of_stack: .res 1 polling_counter: .res 1 string_ptr: .res 1 +transfer_buffer: .res 256 +__http_variables_buffer: .res 256; temp buffer for storing variables __httpd_io_buffer: .res 1024 ;temp buffer for storing inbound requests. - diff --git a/client/a2/autoexec.applesoft b/client/a2/autoexec.applesoft index 32b0101..f3cc47e 100644 --- a/client/a2/autoexec.applesoft +++ b/client/a2/autoexec.applesoft @@ -8,8 +8,10 @@ 40 &IPCFG 50 &PING "192.168.10.2" 60 &PING "192.168.10.2" , 5 +70 PA$="DUMMY" 100 &HTTPD 8080 1000 PRINT "HELLO FOO!" +1005 PRINT PA$ 1010 &!"HOWDY DOODY DOO!" 1020 &FLUSH 1030 GOTO 100 \ No newline at end of file diff --git a/client/a2/autoexec.bas b/client/a2/autoexec.bas index b33ef2884ac42ceda4d779026fd76e0897bbdc7a..068853e6f811a2f15aac162ee6f2e4f82a371967 100644 GIT binary patch delta 115 zcmbQhw33NYV3;~WR7nEE=eSIU9818YTFs%0o2?=nqFt9LS_`vakd6$xh ztB;Srf}6j;q7uVTj>f__D;O6hIsKoG-;}i3G pMI{gaaF<907k_^U36x;r{KLH7%_lV2gMpWmjb*i=fdK;p0|3W|7={1<