about summary refs log tree commit diff stats
path: root/tests
Commit message (Expand)AuthorAgeFilesLines
...
* Add OMEMO in prefs commandPaul Fariello2019-04-101-0/+1
* Add required OMEMO stub for unit-testPaul Fariello2019-04-103-3/+69
* Fix broken support for case-sensitive account namesPhilip Flohr2019-02-223-8/+32
* Update copyright to include 2019Michael Vetter2019-01-221-1/+1
* tests: remove cflag -w and fix warningsDmitry Podgorny2018-10-318-101/+106
* Merge pull request #991 from paulfariello/feature/xep-0050Michael Vetter2018-09-276-15/+17
|\
| * Remove unused stup session_get_domainPaul Fariello2018-09-051-5/+0
| * Add connection_get_domain stub for testsPaul Fariello2018-09-051-0/+5
| * Add support for command config executionPaul Fariello2018-09-051-1/+1
| * Add conf win callbackPaul Fariello2018-09-051-2/+2
| * Rename mucconf wins into conf winsPaul Fariello2018-09-055-12/+12
| * Add command subcommands: list and execPaul Fariello2018-09-051-0/+2
* | Move p_sha1_hash() to stanza.cMichael Vetter2018-09-063-71/+0
|/
* fix: Missing pthread includeRafael Sadowski2018-08-131-0/+1
* Add room /me functional testsJames Booth2018-04-213-0/+58
* Add preferences for tab displayJames Booth2018-03-091-2/+7
* Add prefs for empty tabs and tab namesJames Booth2018-03-081-0/+1
* Show name in statusbar tabs WIPJames Booth2018-03-081-2/+2
* Use jid argument for /bookmark when in roomJames Booth2018-03-043-1/+139
* Add /rooms cacheJames Booth2018-02-052-0/+2
* Filter rooms by simple case insensitive textJames Booth2018-02-041-0/+9
* Fix tests, move glob creationJames Booth2018-01-275-11/+35
* Only send ping requests to client that support itJames Booth2017-06-163-9/+100
* Change server name in functional testsJames Booth2017-06-151-1/+1
* Show message when server does not support pingJames Booth2017-06-153-0/+28
* Set locale in unit testsJames Booth2017-04-291-1/+17
* Allow previous autocompletion with shift tabJames Booth2017-04-017-32/+51
* Add test for case insensitive autocompleteJames Booth2017-03-253-0/+14
* Autocomplete accent and case insensitiveJames Booth2017-03-253-0/+60
* Allow installing plugins from directoryJames Booth2017-02-051-1/+0
* Update CopyrightJames Booth2017-01-281-34/+0
* Fix multibyte chars in prof_occurrencesJames Booth2017-01-262-0/+34
* Add carbons from checkJames Booth2017-01-231-1/+1
* Allow room display properies to be set by pluginsJames Booth2017-01-201-0/+5
* Allow chat prefix char to be set by pluginsJames Booth2017-01-201-0/+4
* Add titlebar encryption text to plugins apiJames Booth2017-01-191-0/+3
* Fix testsJames Booth2017-01-161-1/+0
* Remove status from cl_ev_presence_sendJames Booth2017-01-155-5/+33
* Allow clearing account resourceJames Booth2016-11-223-2/+3
* Use server features for account muc serviceJames Booth2016-11-205-18/+2
* Remove ui_current_print_formatted_lineJames Booth2016-10-163-15/+6
* Remove ui_current_print_lineJames Booth2016-10-163-7/+15
* Use varargs in win_println_indentJames Booth2016-10-151-1/+1
* Add win_appendlnJames Booth2016-10-151-0/+1
* Add win_printJames Booth2016-10-151-1/+2
* Rename win_println -> win_println_indentJames Booth2016-10-151-1/+1
* Remove win_vprintln_chJames Booth2016-10-151-1/+0
* Remove ui_current_error_lineJames Booth2016-10-151-2/+0
* Remove ui_win_error_lineJames Booth2016-10-151-1/+0
* Rename win_get_string -> win_to_stringJames Booth2016-10-151-1/+1
55:26 -0700 committer Kartik Agaram <vc@akkartik.com> 2019-08-26 11:59:21 -0700 5592 - switch register names to lowercase' href='/akkartik/mu/commit/070new-stream.subx?h=main&id=333525360b22f3d3ea31db46a4d2f1b4edbfebdb'>33352536 ^
c88b9e31 ^
bc20cc3d ^
33352536 ^
bc20cc3d ^
bc20cc3d ^
c88b9e31 ^
bc20cc3d ^
33352536 ^



bc20cc3d ^


33352536 ^
bc20cc3d ^


33352536 ^

bc20cc3d ^

33352536 ^

bc20cc3d ^


33352536 ^

bc20cc3d ^


33352536 ^
bc20cc3d ^


33352536 ^
bc20cc3d ^
7a583220 ^
33352536 ^

bc20cc3d ^


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
107
108
109
110
111
112
113
114
115
116
117
118
                                          





                                                                                                                                                 
                                                                                                
                

                                                                                                                                                                       
                      
               
                                                             




                                                                                                                                                                                   
                         
                                                                                                                                                                   
                                                 



                                                                                                                                                                       

                     

                                                                                                                                                                     


                            



                                                                                                                                                                            
                   
               


                                
                                                                                                                                                                  

                         
                 
                

                                                                                                                                                                       




                               
                                                 



                           
                                                                                                                                                                  
                        

                                



                         
                


                                                                                                                                                                       

                          
                                                                                                                                                                       
                             
                   
               
                        
              
                               
                      



                                                                                                                                                                        


                    
               


                              

                                                                                                                                                                  

                                                                                          

               


                                    

                                                                                                                                                                  


                                                               
                                                                                                                                                                     


                                    
                                                                                                                                                                  
                                                                            
                

                                                                                                                                                                       


                            
# Helper to allocate a stream on the heap.

== code
#   instruction                     effective address                                                   register    displacement    immediate
# . op          subop               mod             rm32          base        index         scale       r32
# . 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes

new-stream:  # ad : (address allocation-descriptor), length : int, elemsize : int -> address/eax
    # . prologue
    55/push-ebp
    89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
    # . save registers
    52/push-edx
    # n = elemsize * length + 12 (for read, write and length)
    # . eax = elemsize
    8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           0/r32/eax   0x10/disp8      .                 # copy *(ebp+16) to eax
    # . eax *= length
    31/xor                          3/mod/direct    2/rm32/edx    .           .             .           2/r32/edx   .               .                 # clear edx
    f7          4/subop/multiply    1/mod/*+disp8   5/rm32/ebp    .           .                                     0xc/disp8       .                 # multiply *(ebp+12) into eax
    # . if overflow abort
    81          7/subop/compare     3/mod/direct    2/rm32/edx    .           .             .           .           .               0/imm32           # compare edx
    75/jump-if-not-equal  $new-stream:abort/disp8
    # . edx = elemsize*length
    89/copy                         3/mod/direct    2/rm32/edx    .           .             .           0/r32/eax   .               .                 # copy eax to edx
    # . eax += 12
    05/add-to-eax  0xc/imm32
    # allocate(ad, n)
    # . . push args
    50/push-eax
    ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
    # . . call
    e8/call  allocate/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
    # eax->length = elemsize*length
    89/copy                         1/mod/*+disp8   0/rm32/eax    .           .             .           2/r32/edx   8/disp8         .                 # copy edx to *(eax+8)
    # clear-stream(eax)
    # . . push args
    50/push-eax
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
$new-stream:end:
    # . restore registers
    5a/pop-to-edx
    # . epilogue
    89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
    5d/pop-to-ebp
    c3/return

$new-stream:abort:
    # . _write(2/stderr, error)
    # . . push args
    68/push  "new-stream: size too large\n"/imm32
    68/push  2/imm32/stderr
    # . . call
    e8/call  _write/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
    # . syscall(exit, 1)
    bb/copy-to-ebx  1/imm32
    b8/copy-to-eax  1/imm32/exit
    cd/syscall  0x80/imm8
    # never gets here

test-new-stream:
    # . prologue
    55/push-ebp
    89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
    # var heap/ecx : (address allocation-descriptor) = {0, 0}
    68/push  0/imm32/limit
    68/push  0/imm32/curr
    89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
    # heap = new-segment(512)
    # . . push args
    51/push-ecx
    68/push  0x200/imm32
    # . . call
    e8/call  new-segment/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
    # var start/edx = ad->curr
    8b/copy                         0/mod/indirect  1/rm32/ecx    .           .             .           2/r32/edx   .               .                 # copy *ecx to edx
    # eax = new-stream(heap, 3, 2)
    # . . push args
    68/push  2/imm32
    68/push  3/imm32
    51/push-ecx
    # . . call
    e8/call  new-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # check-ints-equal(eax, edx, msg)
    # . . push args
    68/push  "F - test-new-stream: returns current pointer of allocation descriptor"/imm32
    52/push-edx
    50/push-eax
    # . . call
    e8/call  check-ints-equal/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # check-ints-equal(eax->length, 6, msg)
    # . . push args
    68/push  "F - test-new-stream: sets length correctly"/imm32
    68/push  6/imm32
    ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           .               8/disp8           # push *(eax+8)
    # . . call
    e8/call  check-ints-equal/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # the rest is delegated to clear-stream() so we won't bother checking it
    # . epilogue
    89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
    5d/pop-to-ebp
    c3/return

# . . vim:nowrap:textwidth=0