School Commit Init

This commit is contained in:
2024-08-31 12:07:21 +03:00
commit 0b130ee18c
2801 changed files with 4720552 additions and 0 deletions
@@ -0,0 +1,13 @@
#include<stdio.h>
void subprogram(char a[], int b[]);
int main(){
char a[]="10100111b01100011b110b101011b";
int b[]={0,0,0,0,0,0,0,0,0,0};
subprogram(a,b);
for (int i=0;b[i]!=0;i++){
printf("%d ",b[i]);
}
return 0;
}
@@ -0,0 +1,32 @@
bits 32
global _subprogram
segment code use32 class=code public
_subprogram:
cld
mov ESI,[ESP+4]
mov EDI,[ESP+8]
mov EAX,0
mov EBX,0
label:
lodsb
cmp byte AL,0
je end
cmp byte AL,'b'
jne skip
mov EAX,EBX
stosd
mov EBX,0
jmp label
skip:
sub AL,'0'
mov ECX,0
mov Cl,AL
mov EAX,EBX
mov EDX,2
mul EDX
mov EBX,EAX
add EBX,ECX
jmp label
end:
ret