Tools for working with Cidco Mailstations
at master 82 lines 1.7 kB view raw
1; 2; Based off of spew.asm from Cyrano Jones on the mailstation Yahoo Group, 3; modified to send 64kb of memory. 4; 5; Originally written to be assembled with AS80, converted to SDCC ASZ80 syntax. 6; 7 8 .module memdump 9 10 .area _DATA 11 .area _HEADER (ABS) 12 .org 0x4000 ; This is *always* #4000, regardless of 13 ; what page you use. 14 15 jp eventhandler 16 17 .dw (icons) ; icon location (in this page) 18 .dw (caption) 19 .dw (dunno) 20dunno: 21 .db #0 22xpos: 23 .dw #0 24ypos: 25 .dw #0 26caption: 27 .dw #0x0001 ; ????? 28 .dw (endcap - caption - 6) ; end of chars 29 .dw #0x0006 ; offset to first char 30 .ascii "Mem Dump" ; the caption string 31endcap: 32 33icons: 34 .dw #0 ; size icon0 35 .dw (icon0 - icons) ; offset to icon0 36 .dw #0 ; size icon1 37 .dw (icon1 - icons) ; offset to icon1 (0x00b5) 38icon0: 39 .dw #0 ; icon width 40 .db #0 ; icon height 41icon1: 42 .dw #0 ; icon width 43 .db #0 ; icon height 44 45 46 .equ bsendbyte, #0x802D ; raises busy & sends byte. 47 ; We use the existing sendbyte from 48 ; original update code. This means 49 ; codeflash page #01 needs to be banked 50 ; in to slot8000 before calling bsendbyte. 51 52 .equ done, #0x0000 ; Gotta go somewhere when done, we reboot. 53 ; Mailstation will call eventhandler 3 54 ; or 4 times when you select the new 55 ; application, and we only want to exec 56 ; once, so we do not return at end, we 57 ; reboot after first "event". 58 59eventhandler: 60 ld a, #0 ; set slot8000device = codeflash 61 out (8), a 62 ld a, #1 ; bank bsendbyte into slot8000 63 out (7), a 64 65 ld de, #0x0000 66byteloop: 67 ld a, (de) 68 ld h, a 69 push de 70 call bsendbyte ; send byte(H) 71 pop de 72 73 ld a, d 74 cp #0xff 75 jr nz, incde 76 ld a, e 77 cp #0xff 78 jr nz, incde 79 jp done 80incde: 81 inc de 82 jr byteloop