[A83] Re: Printerdriver for the TI-83(+)


[Prev][Next][Index][Thread]

[A83] Re: Printerdriver for the TI-83(+)




A thought for optimization:

SendData:
     ld   a,(hl)    ;hl=input
     inc  hl
     or   a
     jr   z,sendDataDone
     ld   b,8
     ld   c,a
SendByteLoop:
     ..[wait]..
     rr   c
     jr   c,sendBit1
sendBit0:
     ld   a,$C0
     jr   sendBitDone
sendBit1:
     ld   a,$C3
sendBitDone:
     out  (0),a
     djnz sendByteLoop
     jr   sendData
sendDataDone:
     ld   hl,txt
     bcall(_puts)
     ret
txt:
     .db "Thank you for   "
     .db "using [name]    "
     .db "made by http:// "
     .db "zeekoe.cjb.net  "
     .db "Thanks to:      "
     .db [list of names]

>From: "Ronald Teune" <rtwolf@gmx.net>
>
>Concept printer driver for the ti 83(+):
>
>Begin:
>     ld a,(hl)    ;hl=input
>     cp $00
>     jr z,stop
>     [wait]
>     bit a,0
>     call nz,out1
>     call z,out0
>      [wait]
>     bit a,1
>     call nz,out1
>     call z,out0
>     [wait]
>     bit a,2
>     call nz,out1
>     call z,out0
>     [wait]
>     bit a,3
>     call nz,out1
>     call z,out0
>     (...)
>     [wait]
>     bit a,7
>     call nz,out1
>     call z,out0
>     inc hl
>     jp begin
>out0:
>     [wait]
>     ld a,C0h
>     out(00),a
>     ret
>out1:
>     [wait]
>     ld a,C3h
>     out(00),a
>     ret
>stop:
>     ld hl,txt
>     bcall(_puts)
>     ret
>txt:
>     .db "Thank you for   "
>     .db "using [name]    "
>     .db "made by http:// "
>     .db "zeekoe.cjb.net  "
>     .db "Thanks to:      "
>     .db [list of names]


_________________________________________________________________
Download MSN Explorer gratis van http://explorer.msn.nl/intl.asp