.include "../inc/common.i" .include "../inc/commonprint.i" .include "../inc/net.i" .export start .import exit_to_basic .import print_a .import get_key .import ascii_to_native .import parser_init .import parser_skip_next .importzp copy_src .importzp copy_dest .import url_ip .import url_port .import url_selector .import url_resource_type .import url_parse .import url_download .import url_download_buffer .import url_download_buffer_length temp_buff = copy_dest ; keep LD65 happy .segment "INIT" .segment "ONCE" .segment "STARTUP" ; switch to lower case charset lda #14 jsr print_a start: jsr print_cr init_ip_via_dhcp jsr print_ip_config ldax #url_1 jsr test_url_download ldax #url_2 ; jsr test_url_download jmp exit_to_basic test_url_download: stax temp_url_ptr ldax #downloading jsr print ldax temp_url_ptr jsr print jsr print_cr ldax #dl_buffer stax url_download_buffer ldax #dl_buffer_length stax url_download_buffer_length ldax temp_url_ptr jsr url_download bcc :+ jmp print_errorcode : ldax #dl_buffer jsr parser_init @next_title: ldax #title jsr parser_skip_next bcs @done jsr print_tag_contents jsr print_cr jmp @next_title @done: rts wait_key: ldax #press_a_key jsr print jmp get_key print_tag_contents: stax temp_buff lda #0 sta string_offset @next_byte: ldy string_offset lda (temp_buff),y beq @done cmp #'<' beq @done jsr ascii_to_native jsr print_a inc string_offset beq @done jmp @next_byte @done: rts .data title: .byte "