interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / apps / hop / Linux / window.om

948 lines · 16921 bytes Raw Blame History
1om2
2note Hop Linux desktop boundary. X11 requests are emitted directly from Omega; no UI host library.
3note X Consortium X11 protocol release 7.7, chapters 8/9/11 and Appendix B.
4note X11 core fonts render Latin-1. Unicode input is retained as UTF-8; unrenderable glyphs show ?. Native Wayland is not implied.
5note Color names below map to aienos-brand/reference/tokens.json dark theme. No display polling service is installed.
6const lx_bg ulong 0x0a0a0f
7const lx_card ulong 0x14141f
8const lx_ink ulong 0xffffff
9const lx_accent ulong 0x2563eb
10const lx_muted ulong 0x88888b
11global lx_query uchar *
12global lx_rows uchar *
13global lx_qn ulong 1
14global lx_rn ulong 1
15global lx_pick ulong 1
16global lx_fd long 1
17global lx_s ulong 32
18global lx_buf uchar *
19global lx_auth uchar *
20global lx_keys uchar *
21global lx_host uchar *
22global lx_hn ulong 2
23global lx_req uchar 512
24global lx_env uchar 4096
25global lx_path uchar 4096
26global lx_addr uchar 110
27global lx_piece uchar 256
28text lx_display "DISPLAY="
29text lx_xauth "XAUTHORITY="
30text lx_home "HOME="
31text lx_local "/tmp/.X11-unix/X"
32text lx_dotauth "/.Xauthority"
33text lx_cookie "MIT-MAGIC-COOKIE-1"
34text lx_hostname "/proc/sys/kernel/hostname"
35text lx_name "Hop"
36text lx_font "fixed"
37text lx_wmp "WM_PROTOCOLS"
38text lx_wmd "WM_DELETE_WINDOW"
39text lx_hint "Type to find an app, a file, or ask a question"
40text lx_help "Up / Down choose Enter opens Escape closes"
41text lx_errdisp "Hop: open it from a Linux desktop (DISPLAY is missing or is not a local X11 display).\n"
42text lx_errsock "Hop: cannot connect to the desktop display.\n"
43text lx_errauth "Hop: the desktop refused its X11 login. Check DISPLAY and XAUTHORITY.\n"
44text lx_errwire "Hop: the desktop connection ended or returned an invalid response.\n"
45text lx_errmem "Hop: the system could not allocate memory for the desktop.\n"
46
47fn lx_bad to void
48k = write 2 lx_errwire 0 len lx_errwire
49exit 1
50end
51fn lx_grow n ulong to void
52r = enlarge lx_buf n
53if lt r 0
54k = write 2 lx_errmem 0 len lx_errmem
55exit 1
56end
57end
58fn lx_u16 o ulong to ulong
59ret or ulong get lx_buf o shl ulong get lx_buf add o 1 8
60end
61fn lx_u32 o ulong to ulong
62ret or lx_u16 o shl lx_u16 add o 2 16
63end
64fn lx_a16 o ulong to ulong
65ret or shl ulong get lx_auth o 8 ulong get lx_auth add o 1
66end
67fn lx_p16 o ulong v ulong to void
68put lx_req o uchar and v 255
69put lx_req add o 1 uchar and shr v 8 255
70end
71fn lx_p32 o ulong v ulong to void
72lx_p16 o v
73lx_p16 add o 2 shr v 16
74end
75fn lx_request op uchar n ulong to void
76for i ulong n bound 512
77put lx_req i 0
78end
79put lx_req 0 op
80lx_p16 2 div n 4
81end
82fn lx_send n ulong to void
83p = ulong 0
84while lt p n bound 9223372036854775807
85k = send int get lx_fd 0 lx_req p sub n p 0
86if eq k -4
87continue
88end
89if le k 0
90lx_bad
91end
92p = add p ulong k
93end
94end
95fn lx_read off ulong n ulong to void
96lx_grow add off n
97p = ulong 0
98while lt p n bound 9223372036854775807
99k = read int get lx_fd 0 lx_buf add off p sub n p
100if eq k -4
101continue
102end
103if le k 0
104lx_bad
105end
106p = add p ulong k
107end
108end
109fn lx_reply to void
110while true bound 9223372036854775807
111lx_read 0 32
112kind = and get lx_buf 0 127
113if eq kind 0
114lx_bad
115end
116if eq kind 1
117n = mul lx_u32 4 4
118lx_read 32 n
119ret
120end
121end
122end
123fn lx_envget key view uchar * to ulong
124for i ulong ulong envcnt bound 9223372036854775807
125n = envread i lx_env 0 len lx_env
126if ge n long len key
127ok = true
128for j ulong len key bound 4096
129if ne get key j get lx_env j
130ok = false
131end
132end
133if ok
134count = sub ulong n len key
135for j ulong count bound 4096
136put lx_path j get lx_env add len key j
137end
138ret count
139end
140end
141end
142ret 0
143end
144fn lx_number n ulong to ulong
145v = ulong 0
146i = ulong 0
147if and ge n 5 eq get lx_path 0 117
148note unix: and unix/: are local display spellings
149if and eq get lx_path 1 110 eq get lx_path 2 105
150if eq get lx_path 3 120
151i = 4
152if eq get lx_path 4 47
153i = 5
154end
155end
156end
157end
158if ge i n
159ret 0
160end
161if ne get lx_path i 58
162ret 0
163end
164i = add i 1
165start = i
166while lt i n bound 4096
167c = get lx_path i
168if eq c 46
169break
170end
171if or lt c 48 gt c 57
172ret 0
173end
174if gt v 999999
175ret 0
176end
177v = add mul v 10 ulong sub c 48
178i = add i 1
179end
180if eq start i
181ret 0
182end
183put lx_s 24 v
184put lx_s 25 sub i start
185for j ulong sub i start bound 4096
186put lx_piece j get lx_path add start j
187end
188screen = ulong 0
189if lt i n
190i = add i 1
191if eq i n
192ret 0
193end
194while lt i n bound 4096
195c = get lx_path i
196if or lt c 48 gt c 57
197ret 0
198end
199if gt screen 999999
200ret 0
201end
202screen = add mul screen 10 ulong sub c 48
203i = add i 1
204end
205end
206put lx_s 26 screen
207ret 1
208end
209note FamilyLocal credentials name this machine, not merely a display number. The kernel hostname is read once per authority scan.
210note FamilyWild explicitly bypasses the address match, as before; display and authentication-scheme checks remain in force.
211fn lx_loadhost to void
212put lx_hn 0 0
213put lx_hn 1 0
214fd = fopen lx_hostname 0 len lx_hostname 0 0
215if lt fd 0
216ret
217end
218used = ulong 0
219while true bound 9223372036854775807
220r = enlarge lx_host add used 256
221if lt r 0
222k = fclose int fd
223ret
224end
225k = read int fd lx_host used 256
226if eq k -4
227continue
228end
229if lt k 0
230k = fclose int fd
231ret
232end
233if eq k 0
234break
235end
236used = add used ulong k
237end
238k = fclose int fd
239note proc appends exactly one line feed; remove that delimiter, preserving any line feed in the hostname itself.
240if gt used 0
241if eq get lx_host sub used 1 10
242used = sub used 1
243end
244end
245put lx_hn 0 used
246put lx_hn 1 1
247end
248fn lx_hostmatch offset ulong size ulong to bool
249if eq get lx_hn 1 0
250ret false
251end
252if ne size get lx_hn 0
253ret false
254end
255for i ulong size bound 65536
256if ne get lx_auth add offset i get lx_host i
257ret false
258end
259end
260ret true
261end
262fn lx_findauth n ulong to ulong
263lx_loadhost
264p = ulong 0
265while lt p n bound 9223372036854775807
266if gt add p 2 n
267ret 0
268end
269family = lx_a16 p
270p = add p 2
271ok = or eq family 256 eq family 65535
272for fld ulong 4 bound 4
273if gt add p 2 n
274ret 0
275end
276size = lx_a16 p
277p = add p 2
278if gt add p size n
279ret 0
280end
281if and eq fld 0 eq family 256
282if not lx_hostmatch p size
283ok = false
284end
285end
286if eq fld 1
287if ne size get lx_s 25
288ok = false
289else
290for j ulong size bound 65536
291if ne get lx_auth add p j get lx_piece j
292ok = false
293end
294end
295end
296end
297if eq fld 2
298if ne size len lx_cookie
299ok = false
300else
301for j ulong size bound 65536
302if ne get lx_auth add p j get lx_cookie j
303ok = false
304end
305end
306end
307end
308if eq fld 3
309if and ok eq size 16
310put lx_s 27 p
311ret size
312end
313end
314p = add p size
315end
316end
317ret 0
318end
319fn lx_authload to ulong
320n = lx_envget lx_xauth
321if eq n 0
322n = lx_envget lx_home
323if eq n 0
324ret 0
325end
326if gt add n len lx_dotauth 4095
327ret 0
328end
329for i ulong len lx_dotauth bound 32
330put lx_path add n i get lx_dotauth i
331end
332n = add n len lx_dotauth
333end
334fd = fopen lx_path 0 n 0 0
335if lt fd 0
336ret 0
337end
338used = ulong 0
339while true bound 9223372036854775807
340r = enlarge lx_auth add used 4096
341if lt r 0
342k = fclose int fd
343ret 0
344end
345k = read int fd lx_auth used 4096
346if eq k -4
347continue
348end
349if le k 0
350break
351end
352used = add used ulong k
353end
354k = fclose int fd
355ret lx_findauth used
356end
357fn lx_setup to int
358n = lx_envget lx_display
359if eq n 0
360k = write 2 lx_errdisp 0 len lx_errdisp
361ret 1
362end
363if eq lx_number n 0
364k = write 2 lx_errdisp 0 len lx_errdisp
365ret 1
366end
367for i ulong len lx_local bound 32
368put lx_addr add i 2 get lx_local i
369end
370for i ulong get lx_s 25 bound 16
371put lx_addr add add 2 len lx_local i get lx_piece i
372end
373put lx_addr 0 1
374n = add add 3 len lx_local get lx_s 25
375fd = socknew 1 1 0
376if lt fd 0
377k = write 2 lx_errsock 0 len lx_errsock
378ret 1
379end
380put lx_fd 0 fd
381r = connect int fd lx_addr 0 n
382if lt r 0
383k = write 2 lx_errsock 0 len lx_errsock
384k = fclose int fd
385ret 1
386end
387an = lx_authload
388lx_request 108 48
389lx_p16 2 11
390lx_p16 4 0
391if gt an 0
392lx_p16 6 len lx_cookie
393lx_p16 8 an
394for i ulong len lx_cookie bound 32
395put lx_req add 12 i get lx_cookie i
396end
397for i ulong an bound 32
398put lx_req add 32 i get lx_auth add get lx_s 27 i
399end
400lx_send 48
401else
402lx_send 12
403end
404lx_read 0 8
405if ne get lx_buf 0 1
406k = write 2 lx_errauth 0 len lx_errauth
407k = fclose int fd
408ret 1
409end
410n = mul lx_u16 6 4
411lx_read 0 n
412ret lx_screen n
413end
414fn lx_screen n ulong to int
415if lt n 32
416lx_bad
417end
418put lx_s 7 lx_u32 4
419put lx_s 8 lx_u32 8
420put lx_s 13 ulong get lx_buf 26
421put lx_s 14 ulong get lx_buf 27
422roots = ulong get lx_buf 20
423if ge get lx_s 26 roots
424lx_bad
425end
426p = add 32 mul div add lx_u16 16 3 4 4
427p = add p mul ulong get lx_buf 21 8
428for screen ulong add get lx_s 26 1 bound 65536
429if gt add p 40 n
430lx_bad
431end
432if eq screen get lx_s 26
433put lx_s 4 lx_u32 p
434put lx_s 16 lx_u16 add p 20
435put lx_s 17 lx_u16 add p 22
436ret 0
437end
438depths = ulong get lx_buf add p 39
439p = add p 40
440for j ulong depths bound 256
441if gt add p 8 n
442lx_bad
443end
444p = add add p 8 mul lx_u16 add p 2 24
445end
446end
447ret 1
448end
449fn lx_id k ulong to ulong
450v = get lx_s 7
451mask = get lx_s 8
452bit = ulong 1
453for i ulong 32 bound 32
454if ne and mask shl ulong 1 i 0
455if ne and k bit 0
456v = or v shl ulong 1 i
457end
458bit = shl bit 1
459end
460end
461ret v
462end
463fn lx_atom name view uchar * to ulong
464n = mul div add add 8 len name 3 4 4
465lx_request 16 n
466lx_p16 4 len name
467for i ulong len name bound 256
468put lx_req add 8 i get name i
469end
470lx_send n
471lx_reply
472ret lx_u32 8
473end
474fn lx_property atom ulong ty ulong fmt uchar data ulong n ulong to void
475lx_request 18 28
476lx_p32 4 get lx_s 1
477lx_p32 8 atom
478lx_p32 12 ty
479put lx_req 16 fmt
480lx_p32 20 n
481lx_p32 24 data
482lx_send 28
483end
484fn lx_color fg ulong bg ulong to void
485lx_request 56 20
486lx_p32 4 get lx_s 2
487lx_p32 8 12
488lx_p32 12 fg
489lx_p32 16 bg
490lx_send 20
491end
492fn lx_fill x ulong y ulong w ulong h ulong color ulong to void
493lx_color color lx_bg
494lx_request 70 20
495lx_p32 4 get lx_s 1
496lx_p32 8 get lx_s 2
497lx_p16 12 x
498lx_p16 14 y
499lx_p16 16 w
500lx_p16 18 h
501lx_send 20
502end
503fn lx_text x ulong y ulong count ulong to void
504note ImageText8 has an 8-bit glyph count. Split long strings in caller at the visible edge.
505n = mul div add add 16 count 3 4 4
506lx_request 76 n
507put lx_req 1 uchar count
508lx_p32 4 get lx_s 1
509lx_p32 8 get lx_s 2
510lx_p16 12 x
511lx_p16 14 y
512for i ulong count bound 256
513put lx_req add 16 i get lx_piece i
514end
515lx_send n
516end
517fn lx_label textv view uchar * x ulong y ulong to void
518n = len textv
519if gt n 100
520n = 100
521end
522for i ulong n bound 256
523put lx_piece i get textv i
524end
525lx_text x y n
526end
527fn lx_querytext to void
528n = get lx_qn 0
529start = ulong 0
530if gt n 90
531start = sub n 90
532while lt start n bound 9223372036854775807
533c = get lx_query start
534if ne and c 192 128
535break
536end
537start = add start 1
538end
539end
540count = ulong 0
541i = start
542while and lt i n lt count 100 bound 9223372036854775807
543c = get lx_query i
544if lt c 128
545put lx_piece count c
546count = add count 1
547else
548if ne and c 192 128
549put lx_piece count 63
550count = add count 1
551end
552end
553i = add i 1
554end
555lx_text 24 78 count
556end
557fn lx_rowtext start ulong last ulong y ulong to void
558count = ulong 0
559i = start
560while and lt i last lt count 92 bound 9223372036854775807
561c = get lx_rows i
562if lt c 128
563if ge c 32
564put lx_piece count c
565count = add count 1
566end
567else
568if ne and c 192 128
569put lx_piece count 63
570count = add count 1
571end
572end
573i = add i 1
574end
575lx_text 32 y count
576end
577fn lx_rowcount to ulong
578n = get lx_rn 0
579count = ulong 0
580for i ulong n bound 9223372036854775807
581if eq get lx_rows i 10
582count = add count 1
583end
584end
585if gt n 0
586if ne get lx_rows sub n 1 10
587count = add count 1
588end
589end
590ret count
591end
592fn lx_draw to void
593put lx_s 19 lx_rowcount
594if ge get lx_pick 0 get lx_s 19
595put lx_pick 0 0
596end
597visible = div sub get lx_s 12 150 30
598if lt get lx_pick 0 get lx_s 20
599put lx_s 20 get lx_pick 0
600end
601if ge get lx_pick 0 add get lx_s 20 visible
602put lx_s 20 add sub get lx_pick 0 visible 1
603end
604lx_request 61 16
605lx_p32 4 get lx_s 1
606lx_send 16
607lx_color lx_ink lx_bg
608lx_label lx_name 24 32
609lx_color lx_muted lx_bg
610if eq get lx_qn 0 0
611lx_label lx_hint 24 78
612else
613lx_color lx_ink lx_bg
614lx_querytext
615end
616lx_fill 24 96 sub get lx_s 11 48 1 lx_card
617start = ulong 0
618row = ulong 0
619n = get lx_rn 0
620i = ulong 0
621while le i n bound 9223372036854775807
622last = eq i n
623if lt i n
624last = eq get lx_rows i 10
625end
626if last
627if and ge row get lx_s 20 lt row add get lx_s 20 visible
628if gt i start
629y = add 126 mul sub row get lx_s 20 30
630if eq row get lx_pick 0
631lx_fill 24 sub y 18 sub get lx_s 11 48 28 lx_accent
632lx_color lx_ink lx_accent
633else
634lx_color lx_ink lx_bg
635end
636lx_rowtext start i y
637end
638end
639row = add row 1
640start = add i 1
641end
642i = add i 1
643end
644lx_color lx_muted lx_bg
645lx_label lx_help 24 sub get lx_s 12 20
646end
647fn lx_makewin to void
648put lx_s 1 lx_id 1
649put lx_s 2 lx_id 2
650put lx_s 3 lx_id 3
651put lx_s 11 640
652put lx_s 12 440
653lx_request 1 40
654lx_p32 4 get lx_s 1
655lx_p32 8 get lx_s 4
656x = ulong 0
657y = ulong 0
658if gt get lx_s 16 640
659x = div sub get lx_s 16 640 2
660end
661if gt get lx_s 17 440
662y = div sub get lx_s 17 440 2
663end
664lx_p16 12 x
665lx_p16 14 y
666lx_p16 16 640
667lx_p16 18 440
668lx_p16 22 1
669lx_p32 28 2050
670lx_p32 32 lx_bg
671lx_p32 36 or or ulong 1 4 or ulong 32768 131072
672lx_send 40
673put lx_s 9 lx_atom lx_wmp
674put lx_s 10 lx_atom lx_wmd
675lx_property get lx_s 9 4 32 get lx_s 10 1
676lx_request 18 28
677lx_p32 4 get lx_s 1
678lx_p32 8 39
679lx_p32 12 31
680put lx_req 16 8
681lx_p32 20 len lx_name
682for i ulong len lx_name bound 16
683put lx_req add 24 i get lx_name i
684end
685lx_send 28
686lx_request 45 20
687lx_p32 4 get lx_s 3
688lx_p16 8 len lx_font
689for i ulong len lx_font bound 16
690put lx_req add 12 i get lx_font i
691end
692lx_send 20
693lx_request 55 28
694lx_p32 4 get lx_s 2
695lx_p32 8 get lx_s 1
696lx_p32 12 16396
697lx_p32 16 lx_ink
698lx_p32 20 lx_bg
699lx_p32 24 get lx_s 3
700lx_send 28
701lx_request 101 8
702put lx_req 4 uchar get lx_s 13
703put lx_req 5 uchar add sub get lx_s 14 get lx_s 13 1
704lx_send 8
705lx_reply
706put lx_s 15 ulong get lx_buf 1
707n = mul lx_u32 4 4
708r = enlarge lx_keys n
709if lt r 0
710lx_bad
711end
712for i ulong n bound 9223372036854775807
713put lx_keys i get lx_buf add 32 i
714end
715lx_request 8 8
716lx_p32 4 get lx_s 1
717lx_send 8
718note SetInputFocus follows MapWindow; the window manager may override placement and focus according to user policy.
719lx_request 42 12
720put lx_req 1 1
721lx_p32 4 get lx_s 1
722lx_send 12
723end
724fn lx_keyvalue code ulong column ulong to ulong
725if or lt code get lx_s 13 gt code get lx_s 14
726ret 0
727end
728if ge column get lx_s 15
729ret 0
730end
731p = mul add mul sub code get lx_s 13 get lx_s 15 column 4
732if gt add p 4 len lx_keys
733ret 0
734end
735v = ulong 0
736for i ulong 4 bound 4
737v = or v shl ulong get lx_keys add p i mul i 8
738end
739ret v
740end
741fn lx_append cp ulong to void
742n = get lx_qn 0
743r = enlarge lx_query add n 4
744if lt r 0
745lx_bad
746end
747if lt cp 128
748put lx_query n uchar cp
749n = add n 1
750else
751if lt cp 2048
752put lx_query n uchar or 192 shr cp 6
753put lx_query add n 1 uchar or 128 and cp 63
754n = add n 2
755else
756if lt cp 65536
757put lx_query n uchar or 224 shr cp 12
758put lx_query add n 1 uchar or 128 and shr cp 6 63
759put lx_query add n 2 uchar or 128 and cp 63
760n = add n 3
761else
762put lx_query n uchar or 240 shr cp 18
763put lx_query add n 1 uchar or 128 and shr cp 12 63
764put lx_query add n 2 uchar or 128 and shr cp 6 63
765put lx_query add n 3 uchar or 128 and cp 63
766n = add n 4
767end
768end
769end
770put lx_qn 0 n
771end
772fn lx_changed to void
773put lx_pick 0 0
774put lx_s 20 0
775hop_query
776lx_draw
777end
778fn lx_key to void
779code = ulong get lx_buf 1
780state = lx_u16 28
781key = lx_keyvalue code 0
782if ne and state 1 0
783other = lx_keyvalue code 1
784if ne other 0
785key = other
786end
787end
788if ne and state 2 0
789if and ge key 97 le key 122
790key = sub key 32
791else
792if and ge key 65 le key 90
793key = add key 32
794end
795end
796end
797if eq key 65307
798put lx_s 18 1
799ret
800end
801if eq key 65293
802if eq hop_activate 1
803put lx_s 18 1
804else
805lx_draw
806end
807ret
808end
809if eq key 65362
810if gt get lx_pick 0 0
811put lx_pick 0 sub get lx_pick 0 1
812end
813lx_draw
814ret
815end
816if eq key 65364
817if lt add get lx_pick 0 1 get lx_s 19
818put lx_pick 0 add get lx_pick 0 1
819end
820lx_draw
821ret
822end
823if eq key 65288
824n = get lx_qn 0
825if gt n 0
826n = sub n 1
827while gt n 0 bound 9223372036854775807
828if ne and get lx_query n 192 128
829break
830end
831n = sub n 1
832end
833put lx_qn 0 n
834lx_changed
835end
836ret
837end
838if eq key 65289
839ret
840end
841if ne and state 4 0
842if or eq key 117 eq key 85
843put lx_qn 0 0
844lx_changed
845end
846ret
847end
848if ne and state 72 0
849ret
850end
851if and ge key 32 lt key 256
852lx_append key
853lx_changed
854ret
855end
856if and ge key 16777248 le key 17891327
857cp = sub key 16777216
858if or lt cp 55296 gt cp 57343
859lx_append cp
860lx_changed
861end
862end
863end
864fn lx_click to void
865button = get lx_buf 1
866if eq button 4
867if gt get lx_pick 0 0
868put lx_pick 0 sub get lx_pick 0 1
869end
870lx_draw
871ret
872end
873if eq button 5
874if lt add get lx_pick 0 1 get lx_s 19
875put lx_pick 0 add get lx_pick 0 1
876end
877lx_draw
878ret
879end
880if ne button 1
881ret
882end
883y = lx_u16 26
884if lt y 108
885ret
886end
887offset = div sub y 108 30
888if ge offset div sub get lx_s 12 150 30
889ret
890end
891row = add get lx_s 20 offset
892if ge row get lx_s 19
893ret
894end
895put lx_pick 0 row
896if eq hop_activate 1
897put lx_s 18 1
898else
899lx_draw
900end
901end
902fn lx_main to int
903if ne lx_setup 0
904ret 1
905end
906lx_makewin
907lx_changed
908while eq get lx_s 18 0 bound 9223372036854775807
909lx_read 0 32
910kind = and get lx_buf 0 127
911if eq kind 0
912lx_bad
913end
914if eq kind 1
915lx_read 32 mul lx_u32 4 4
916end
917if eq kind 2
918lx_key
919end
920if eq kind 4
921lx_click
922end
923if eq kind 12
924lx_draw
925end
926if eq kind 17
927put lx_s 18 1
928end
929if eq kind 22
930w = lx_u16 20
931h = lx_u16 22
932if and ge w 200 ge h 200
933put lx_s 11 w
934put lx_s 12 h
935lx_draw
936end
937end
938if eq kind 33
939if eq lx_u32 8 get lx_s 9
940if eq lx_u32 12 get lx_s 10
941put lx_s 18 1
942end
943end
944end
945end
946k = fclose int get lx_fd 0
947ret 0
948end