-
Notifications
You must be signed in to change notification settings - Fork 82
/
code12.src
75 lines (52 loc) · 1.07 KB
/
code12.src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.page
.subttl 'code12'
n32768 .byte 144,128,0,0,0
flpint jsr ayint
lda facmo
ldy faclo
rts
intidx jsr chrget
jsr frmevl ;get a number
posint jsr chknum
lda facsgn
bmi nonono ;if negative, blow him out.
ayint lda facexp
cmp #144 ;fac .gt. 32767?
bcc qintgo
lda #<n32768 ;get address of -32768.
ldy #>n32768
jsr fcomp ;see if fac=((x)).
nonono beq qintgo
jmp fcerr ;no, fac is too big.
qintgo jmp qint ;go to wint and shove it.
.page
; float an unsigned double byte integer
; entry: msb in a, lsb in y
nosflt jsr stoint
sec ;sign is positive
jmp floatc
pos sec
jsr k_jplot ;get tab pos in .y
sngflt lda #0
jmp givayf ;float it
;
;subroutine to see if we are in direct mode,
;and complain if so.
errdir bit runmod ;direct mode?
bmi storts ;no
ldx #errid ;input direct error code.
.byte $2c
errguf ldx #erruf
jmp error
stoint ldx #0 ;move int to fac & compute proper exponents
stx valtyp
sta facho
sty facho+1
ldx #$90
storts rts
errind bit runmod ;goto error if not in direct mode
bmi 1$ ;in run mode
rts
1$ ldx #erroid
jmp error
;.end