-
Notifications
You must be signed in to change notification settings - Fork 0
/
irc.fasm
106 lines (99 loc) · 5.71 KB
/
irc.fasm
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
format elf64 executable
use64
entry __init__
__debug__ fix true
;__debug__ fix false
__tmp2__ fix r12
__tmp3__ fix r13
__tmp4__ fix r14
__tmp5__ fix r15
__tmpA__ fix rax
__tmpB__ fix rbx
__yentry__ fix r14
__page__ fix r15
__file__ fix r15
;( stat )
;{
include 'libs/main.fasm'
xstat 'main'
xstat 'buffers'
xstat 'echo'
xstat 'environment'
xstat 'files'
xstat 'on'
;}
segment executable
;( code )
;{
__init__:
;{
code 'main'
exit
;}
xcode 'buffers'
xcode 'echo'
xcode 'environment'
xcode 'files'
xcode 'threads'
xcode 'time'
;}
times ( 0x1000 - ( $ and 0xfff )) db 0x90
segment readable writeable
_base_ = ( $ and 0xfffffffffffff000 )
dq ( 0x0000000000000000 )
addBase0 dq ( _base_ + _length_ )
addBase1 dq ( _here_ )
dq ( 0x0000000000000000 )
dw ( buffers.lenFull )
dw ( _base_ + _length_ - _here_ )
dw ( _here_ - _base_ - buffers.lenMeta )
dw ( 0x0000 )
_cobj_ = ( 1 )
;( text )
;{
xtext 'buffers'
xtext 'echo'
xtext 'environment'
xtext 'files'
xtext 'threads'
;}
buffers.list dq ( _base_ )
buffers.full dd ( _length_ ) ;sum full_size
buffers.used dd ( _here_ - _base_ - buffers.lenMeta ) ;sum used_size
buffers.meta dd ( buffers.lenMeta ) ;sum meta_size
buffers.spam dd ( 0x00000000 ) ;sum spam_size
buffers.free dd ( _base_ + _length_ - _here_ ) ;sum free_size
buffers.count dd ( _objs_ ) ;count objects
;( vars )
;{
xvars 'echo'
xvars 'environment'
;}
_vars_ = ( $ )
_alloc_ = ( $ )
buffers.save aq ( 1 ) ;save of *list while debug
buffers.saveDebug aq ( 1 ) ;save of *list while debug
buffers.lastPage aq ( 1 ) ;last used *page
buffers.last aq ( 1 ) ;last used *buffer
;( resv )
;{
xresv 'echo'
xresv 'environment'
xresv 'files'
xresv 'time'
;}
_here_ = ( _alloc_ )
_size_ = ( _here_ - _base_ )
_resv_ = 0x8000
if ( _resv_ > _size_ )
_size_ = ( _resv_ )
end if
if ( _size_ and 0x0000000000000fff )
_size_ = (( _size_ + 4096 ) and 0xfffffffffffff000 )
end if
if (( _size_ ) > ( buffers.lenFull ))
display '[asm:main] error: lenUsed > maxLenFull!'
end if
rb ( _base_ + _size_ - $ )
_length_ = ( _size_ )
_objs_ = ( _cobj_ )