~ubuntu-branches/ubuntu/trusty/libticalcs/trusty-proposed

« back to all changes in this revision

Viewing changes to src/romdump_8x/link83p.asm

  • Committer: Package Import Robot
  • Author(s): Andreas B. Mundt
  • Date: 2013-08-27 19:58:21 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20130827195821-biurlicyqb65gj3g
Tags: 1.1.8+dfsg2-2
* Provide original upstream source, but patch away pre-compiled
  binaries to be policy-compliant.
* Remove unnecessary dependency on 'autopoint', use autoreconf.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;;; -*- TI-Asm -*-
 
2
 
 
3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
4
;;;
 
5
;;; TI-73/82/83/83+/84+/85/86 ROM Dumper
 
6
;;;
 
7
;;; Copyright (c) 2012 Benjamin Moody
 
8
;;;
 
9
;;; This program is free software; you can redistribute it and/or modify
 
10
;;; it under the terms of the GNU General Public License as published by
 
11
;;; the Free Software Foundation; either version 2 of the License, or
 
12
;;; (at your option) any later version.
 
13
;;;
 
14
;;; This program is distributed in the hope that it will be useful,
 
15
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
;;; GNU General Public License for more details.
 
18
;;;
 
19
;;; You should have received a copy of the GNU General Public License
 
20
;;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
21
;;;
 
22
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
23
 
 
24
;; CheckLinkActivity:
 
25
;;
 
26
;; Check whether we are receiving data from the link port.
 
27
;;
 
28
;; Output:
 
29
;; - Zero flag clear (NZ) if we are receiving data
 
30
;;
 
31
;; Destroys:
 
32
;; - AF
 
33
;; - DE, HL
 
34
 
 
35
CheckLinkActivity:
 
36
        in a, (linkPort)
 
37
        cpl
 
38
        and 3
 
39
        ret nz
 
40
        in a, (2)
 
41
        and 80h
 
42
        ret z
 
43
        in a, (9)
 
44
        and 18h
 
45
        ret
 
46
 
 
47
;; LinkGetByte:
 
48
;;
 
49
;; Read a byte from the link port.
 
50
;;
 
51
;; Output:
 
52
;; - Carry flag set if there was an error
 
53
;; - C = byte value
 
54
;;
 
55
;; Destroys:
 
56
;; - Interrupts disabled
 
57
;; - AF, B, DE, HL
 
58
 
 
59
LinkGetByte:
 
60
        ld hl, LinkIOError
 
61
        call APP_PUSH_ERRORH
 
62
         B_CALL _RecAByteIO
 
63
         ld d, a
 
64
         jr LinkIODone
 
65
 
 
66
;; LinkPutByte:
 
67
;;
 
68
;; Read a byte from the link port.
 
69
;;
 
70
;; Input:
 
71
;; - A = C = byte value to write
 
72
;;
 
73
;; Output:
 
74
;; - Carry flag set if there was an error
 
75
;;
 
76
;; Destroys:
 
77
;; - Interrupts disabled
 
78
;; - AF, B, DE, HL
 
79
 
 
80
LinkPutByte:
 
81
        ld hl, LinkIOError
 
82
        call APP_PUSH_ERRORH
 
83
         B_CALL _SendAByte
 
84
LinkIODone:
 
85
         call APP_POP_ERRORH
 
86
        ld c, d
 
87
        or a
 
88
        ret
 
89
 
 
90
LinkIOError:
 
91
        scf
 
92
        ret