summaryrefslogtreecommitdiffstats
path: root/yotlibc/bccfunc.s
blob: 7aedaac98966b826d89a6fd024ec02ae70cfd972 (plain) (blame)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
; 專門給 bcc 用的,我不知道為什麼它會缺基本功能
global _env_load
global _env_save
global _env_def
global isru
global isr
global isl
global islu
global imul_
global imul_u
global imodu
global idiv_u
global imod
global imodu

idiv_:
    cwd
    idiv    bx
    ret
    

idiv_u:
    xor dx,dx
    div bx
    ret
    

imod:
    cwd
    idiv    bx
    mov ax,dx   
    ret
    

imodu:
    xor dx,dx
    div bx
    mov ax,dx
    ret
    

imul_:
imul_u:
    imul    bx
    ret
    
    
isl:
islu:
    mov cl,bl
    shl ax,cl
    ret


isr:
    mov cl,bl
    sar ax,cl
    ret
    

isru:
    mov cl,bl
    shr ax,cl
    ret
    

_env_def:
    push    bp
    mov     bp, sp
    push    cx
    push    si
    mov     cx, [bp+6]
    mov     si, [bp+4]
    int     0x52
    pop     si
    pop     cx
    mov     sp, bp
    pop     bp
    ret
    

_env_save:
    int     0x53
    ret
    

_env_load:
    int     0x54
    ret