Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
7
Task/Include-a-file/Ada/include-a-file.adb
Normal file
7
Task/Include-a-file/Ada/include-a-file.adb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
with Ada.Text_IO, Another_Package; use Ada.Text_IO;
|
||||
-- the with-clause tells the compiler to include the Text_IO package from the Ada standard
|
||||
-- and Another_Package. Subprograms from these packages may be called as follows:
|
||||
-- Ada.Text_IO.Put_Line("some text");
|
||||
-- Another_Package.Do_Something("some text");
|
||||
-- The use-clause allows the program author to write a subprogram call shortly as
|
||||
-- Put_Line("some text");
|
||||
1
Task/Include-a-file/ArkScript/include-a-file-1.ark
Normal file
1
Task/Include-a-file/ArkScript/include-a-file-1.ark
Normal file
|
|
@ -0,0 +1 @@
|
|||
(import file)
|
||||
1
Task/Include-a-file/ArkScript/include-a-file-2.ark
Normal file
1
Task/Include-a-file/ArkScript/include-a-file-2.ark
Normal file
|
|
@ -0,0 +1 @@
|
|||
(import file :foo :bar)
|
||||
1
Task/Include-a-file/ArkScript/include-a-file-3.ark
Normal file
1
Task/Include-a-file/ArkScript/include-a-file-3.ark
Normal file
|
|
@ -0,0 +1 @@
|
|||
(import file:*)
|
||||
4
Task/Include-a-file/COBOL/include-a-file.cob
Normal file
4
Task/Include-a-file/COBOL/include-a-file.cob
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
COPY "copy.cpy". *> The full stop is mandatory, wherever the COPY is.
|
||||
COPY "another-copy.cpy" REPLACING foo BY bar
|
||||
SPACE BY ZERO
|
||||
==text to replace== BY ==replacement text==.
|
||||
2
Task/Include-a-file/Emacs-Lisp/include-a-file-1.el
Normal file
2
Task/Include-a-file/Emacs-Lisp/include-a-file-1.el
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
(defun sum (ls)
|
||||
(apply '+ ls) )
|
||||
3
Task/Include-a-file/Emacs-Lisp/include-a-file-2.el
Normal file
3
Task/Include-a-file/Emacs-Lisp/include-a-file-2.el
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
(add-to-list 'load-path "./")
|
||||
(load "./file1.el")
|
||||
(insert (format "%d" (sum (number-sequence 1 100) )))
|
||||
1
Task/Include-a-file/Euphoria/include-a-file.eu
Normal file
1
Task/Include-a-file/Euphoria/include-a-file.eu
Normal file
|
|
@ -0,0 +1 @@
|
|||
include my_header.e
|
||||
14
Task/Include-a-file/PowerShell/include-a-file.ps1
Normal file
14
Task/Include-a-file/PowerShell/include-a-file.ps1
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<#
|
||||
A module is a set of related Windows PowerShell functionalities, grouped together as a convenient unit (usually saved in a
|
||||
single directory). By defining a set of related script files, assemblies, and related resources as a module, you can
|
||||
reference, load, persist, and share your code much easier than you would otherwise.
|
||||
#>
|
||||
|
||||
Import-Module -Name MyModule
|
||||
|
||||
|
||||
<#
|
||||
When you dot source a script (or scriptblock), all variables and functions defined in the script (or scriptblock) will
|
||||
persist in the shell when the script ends.
|
||||
#>
|
||||
. .\MyFunctions.ps1
|
||||
|
|
@ -66,7 +66,7 @@ conversion2: # INFO: conversion2
|
|||
addi sp, sp, 8
|
||||
ret
|
||||
/**********************************************/
|
||||
/* decimal conversion */
|
||||
/* decimal conversion unsigned */
|
||||
/**********************************************/
|
||||
/* a0 value */
|
||||
/* a1 conversion array address */
|
||||
|
|
@ -78,11 +78,11 @@ conversion10:
|
|||
li t1,LGZONECONV
|
||||
li t2,10 # divisor
|
||||
1:
|
||||
rem t4,a0,t2 # division remainder by 10
|
||||
remu t4,a0,t2 # division remainder by 10
|
||||
addi t4,t4,48 # convert to decimal
|
||||
add t5,a1,t1 # store character position
|
||||
sb t4,(t5) # store byte
|
||||
div a0,a0,t2 # compute quotient
|
||||
divu a0,a0,t2 # compute quotient
|
||||
beq a0,x0,2f # compare to 0
|
||||
addi t1,t1,-1 # decrement store position
|
||||
bgt t1,x0,1b # and loop if position is ok
|
||||
|
|
|
|||
1
Task/Include-a-file/Rye/include-a-file.rye
Normal file
1
Task/Include-a-file/Rye/include-a-file.rye
Normal file
|
|
@ -0,0 +1 @@
|
|||
Import %hello.art
|
||||
8
Task/Include-a-file/VBScript/include-a-file-1.vbs
Normal file
8
Task/Include-a-file/VBScript/include-a-file-1.vbs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
Include "D:\include\pad.vbs"
|
||||
|
||||
Wscript.Echo lpad(12,14,"-")
|
||||
|
||||
Sub Include (file)
|
||||
dim fso: set fso = CreateObject("Scripting.FileSystemObject")
|
||||
if fso.FileExists(file) then ExecuteGlobal fso.OpenTextFile(file).ReadAll
|
||||
End Sub
|
||||
1
Task/Include-a-file/VBScript/include-a-file-2.vbs
Normal file
1
Task/Include-a-file/VBScript/include-a-file-2.vbs
Normal file
|
|
@ -0,0 +1 @@
|
|||
<script id="Connections" language="VBScript" src="D:\include\ConnectionStrings.vbs"/>
|
||||
7
Task/Include-a-file/VBScript/include-a-file-3.vbs
Normal file
7
Task/Include-a-file/VBScript/include-a-file-3.vbs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
Include "%INCLUDE%\StrFuncs.vbs"
|
||||
|
||||
Function Include ( ByVal file )
|
||||
Dim wso: Set wso = CreateObject("Wscript.Shell")
|
||||
Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
|
||||
ExecuteGlobal(fso.OpenTextFile(wso.ExpandEnvironmentStrings(file)).ReadAll)
|
||||
End Function
|
||||
28
Task/Include-a-file/X86-64-Assembly/include-a-file-1.x86-64
Normal file
28
Task/Include-a-file/X86-64-Assembly/include-a-file-1.x86-64
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
;*********************************
|
||||
; MACROS
|
||||
;*********************************
|
||||
displayLib MACRO messa
|
||||
local mess1,LGMESS1C
|
||||
.data
|
||||
mess1 db messa,10,0
|
||||
LGMESS1C equ $ - mess1
|
||||
.code
|
||||
push rax
|
||||
push rcx
|
||||
push rdx
|
||||
push r8
|
||||
push r9
|
||||
push r10
|
||||
push r11
|
||||
mov rcx, offset mess1
|
||||
mov rdx,LGMESS1C
|
||||
call afficherConsole
|
||||
pop r11
|
||||
pop r10
|
||||
pop r9
|
||||
pop r8
|
||||
pop rdx
|
||||
pop rcx
|
||||
pop rax
|
||||
|
||||
ENDM
|
||||
125
Task/Include-a-file/X86-64-Assembly/include-a-file-2.x86-64
Normal file
125
Task/Include-a-file/X86-64-Assembly/include-a-file-2.x86-64
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
.code
|
||||
|
||||
;**************************************
|
||||
; console display
|
||||
;**************************************
|
||||
; rcx : string address
|
||||
; rdx : length string
|
||||
afficherConsole PROC public
|
||||
push rbx
|
||||
push r12
|
||||
sub rsp,28h ; 40 bytes on stack (shadow variables)
|
||||
mov rbx,rcx ; string address
|
||||
mov r12,rdx ; size string
|
||||
|
||||
cmp QWORD ptr hConsole,0 ; console handle ?
|
||||
jne @B3
|
||||
mov rcx,STD_OUTPUT_HANDLE
|
||||
call GetStdHandle ; load console handle
|
||||
mov hConsole, rax ; save in data
|
||||
@B3:
|
||||
mov rcx,hConsole ; handle
|
||||
mov rdx,rbx ; string address
|
||||
mov r8,r12 ; string length
|
||||
mov r9,0 ;
|
||||
|
||||
sub rsp,8 ; stack alignement (one push)
|
||||
push 0
|
||||
sub rsp,20h ; stack for shadow variable
|
||||
call WriteFile ; winapi function
|
||||
add rsp,20h
|
||||
add rsp,10h ; 1 push and alignement
|
||||
add rsp,28h ; stack alignement
|
||||
pop r12
|
||||
pop rbx
|
||||
ret
|
||||
afficherConsole ENDP
|
||||
;***************************************************
|
||||
;conversion to unsigned base 10
|
||||
;with removal of unnecessary zeros
|
||||
;and left shift
|
||||
;****************************************************
|
||||
; rcx : value to convert
|
||||
; rdx : conversion area address length > 22
|
||||
LONGUEUR equ 24
|
||||
conversion10 PROC public
|
||||
push rbx
|
||||
push rdi
|
||||
mov rdi,rdx ; conversion area address
|
||||
mov BYTE ptr [rdi+LONGUEUR],0 ; 0 final conversion area
|
||||
mov rax,rcx ; value
|
||||
mov rcx,LONGUEUR-1
|
||||
mov rbx ,10
|
||||
CA1: ; loop begin
|
||||
mov rdx,0 ; division rax by 10
|
||||
div rbx
|
||||
add rdx,'0' ; remainder conversion ascii
|
||||
mov byte ptr [rdi+rcx],dl
|
||||
dec rcx
|
||||
cmp rax,0 ; end ?
|
||||
jne CA1
|
||||
xor rax,rax
|
||||
inc rcx
|
||||
CA5: ; copy loop
|
||||
mov dl,[rdi+rcx] ; load a result character
|
||||
mov byte ptr [rdi+rax],dl ; and store at conversion area begin
|
||||
inc rcx
|
||||
inc rax
|
||||
cmp rcx,LONGUEUR ; loop if not zero final
|
||||
jle CA5
|
||||
pop rdi
|
||||
pop rbx
|
||||
ret
|
||||
conversion10 ENDP
|
||||
;***************************************************
|
||||
; string concatenation
|
||||
;**************************************************
|
||||
; rcx destination area address
|
||||
; rdx destination area length
|
||||
; r8 strings number
|
||||
; r9 0
|
||||
; on stack address and length of each string
|
||||
; in order of insertion
|
||||
grouperChaines PROC public
|
||||
enter 0,0
|
||||
push rbx
|
||||
push r12
|
||||
push r13
|
||||
cmp r8,0
|
||||
je fingrp
|
||||
mov r12,rdx
|
||||
mov r9,0 ; indice strings
|
||||
mov r10,0 ; number of characters inserted
|
||||
bouclezone:
|
||||
mov r13,r8
|
||||
shl r13,1
|
||||
mov rbx,[rbp+8+(r13 * 8)] ; string address
|
||||
mov rax,[rbp+(r13 * 8)] ; sring length
|
||||
mov r11,0
|
||||
bouclecopie: ; loop string copy
|
||||
mov dl,byte ptr[rbx+r11]
|
||||
mov byte ptr[rcx+r10],dl
|
||||
inc r11
|
||||
cmp r11,rax
|
||||
jg finbouclecopie
|
||||
inc r10 ;number of characters inserted
|
||||
cmp r10,r12 ; max?
|
||||
jge erreur
|
||||
jmp bouclecopie
|
||||
finbouclecopie:
|
||||
dec r8 ; other string
|
||||
jnz bouclezone
|
||||
|
||||
mov rax,r10 ; return size final string
|
||||
jmp fingrp
|
||||
erreur:
|
||||
displayLib "reception area too small"
|
||||
mov rax,0
|
||||
fingrp:
|
||||
pop r13
|
||||
pop r12
|
||||
pop rbx
|
||||
leave
|
||||
ret
|
||||
grouperChaines ENDP
|
||||
end
|
||||
65
Task/Include-a-file/X86-64-Assembly/include-a-file-3.x86-64
Normal file
65
Task/Include-a-file/X86-64-Assembly/include-a-file-3.x86-64
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
; include examples
|
||||
; assembly X86 window
|
||||
; download and install visual studio 2022 free site microsoft
|
||||
; search and open X64 native tools command prompt
|
||||
; compil and link program with this command :
|
||||
; ml64 lenString.asm /link /ENTRY:main /SUBSYSTEM:console kernel32.lib user32.lib Shell32.lib
|
||||
; this program respects the 64-bit calling convention :
|
||||
; registers arguments : rcx rdx r8 r9 and stack
|
||||
; registers saved : rbx,rbp,rdi,rsi, r12-r15
|
||||
; ATTENTION les registres rax,rcx,rdx,r8-r11 peuvent être
|
||||
; perdus lors d'un appel de fonction
|
||||
;*********************************
|
||||
; constantes
|
||||
;*********************************
|
||||
STD_OUTPUT_HANDLE equ -11
|
||||
|
||||
;*********************************
|
||||
; macros
|
||||
;*********************************
|
||||
; macros file
|
||||
include macrosInclude.asm
|
||||
|
||||
;*********************************
|
||||
; user data
|
||||
;*********************************
|
||||
.data
|
||||
szMessAccueil db "Hello word.",0
|
||||
LGMESSACCUEIL equ $ - szMessAccueil
|
||||
|
||||
szCarriageReturn db 10,0
|
||||
|
||||
|
||||
align 8
|
||||
hConsole dq 0
|
||||
sConvArea db 24
|
||||
;*********************************
|
||||
; user code fonction principale
|
||||
;*********************************
|
||||
.code
|
||||
|
||||
extern WriteFile : proc, GetStdHandle : proc, ExitProcess : proc
|
||||
extern GetLastError : proc
|
||||
|
||||
main PROC public
|
||||
displayLib "Program X86-64 start." ; call macro label display
|
||||
|
||||
mov rcx,offset szMessAccueil ; message address
|
||||
mov rdx,LGMESSACCUEIL ; message length
|
||||
call afficherConsole ; call display routine
|
||||
|
||||
mov rcx, offset szCarriageReturn ; message address
|
||||
mov rdx,1 ; display 1 character
|
||||
call afficherConsole
|
||||
|
||||
|
||||
finProgramme:
|
||||
displayLib "Programm end." ; call macro label display
|
||||
sub rsp,28h
|
||||
mov rcx,0 ; return code
|
||||
call ExitProcess
|
||||
main ENDP
|
||||
;
|
||||
; routines file
|
||||
include routinesInclude.asm
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue