当前位置:网站首页>: 0xc0000005: an access conflict occurs when writing position 0x01458000 - to be solved
: 0xc0000005: an access conflict occurs when writing position 0x01458000 - to be solved
2022-07-27 16:07:00 【The heart is like glass】
`#include <stdio.h>
#include <stdio.h>
#define TOTAL 4 // The total number of people
struct {
char name[20];
int num;
char sex;
char profession;
union {
float score;
char course[20];
}sc;
}bodys[TOTAL];
int main()
{
int i; // Enter personnel information
for (i =0;i<TOTAL;i++)
{
printf(“Input info:”);
scanf_s("%s %d %c %c", &(bodys[i].name), &(bodys[i].num), &(bodys[i].sex), &(bodys[i].profession));
if (bodys[i].profession ==‘s’)
{
scanf_s("%f", &(bodys[i].sc.score));
}
else
{
scanf_s("%f", &(bodys[i].sc.course));
}
fflush(stdin);
}
// Output personnel information
printf("\nNam\t\tNum\tSex\tProfession\tScore/Course\n");
for (i =0;i<TOTAL;i++)
{
if (bodys[i].profession ==‘s’)
{
printf("%s\t%d\t%c\t%c\t\t%f\n", bodys[i].name, bodys[i].num, bodys[i].sex, bodys[i].profession, bodys[i].sc.score);
}
else
{
printf("%s\t%d\t%c\t%c\t\t%s\n", bodys[i].name, bodys[i].num, bodys[i].sex, bodys[i].profession, bodys[i].sc.course);
}
}
getchar();
return 0;
}`

page ,132
title memset - set sections of memory all to one byte
;***
;memset.asm - set a section of memory to all one byte
;
; Copyright Microsoft Corporation. All rights reserved.
;
;Purpose:
; contains the memset() routine
;
;*******************************************************************************
.xlist
include vcruntime.inc
.list
.xmm
page
;***
;char memset(dst, value, count) - sets “count” bytes at “dst” to “value”
;
;Purpose:
; Sets the first “count” bytes of the memory starting
; at “dst” to the character value “value”.
;
; Algorithm:
; char *
; memset (dst, value, count)
; char dst;
; char value;
; unsigned int count;
; {
; char start = dst;
;
; while (count–)
; dst++ = value;
; return(start);
; }
;
;Entry:
; char dst - pointer to memory to fill with value
; char value - value to put in dst bytes
; int count - number of bytes of dst to fill
;
;Exit:
; returns dst, with filled bytes
;
;Uses:
;
;Exceptions:
;
;**************************************************************************
CODESEG
extrn __isa_available:dword
extrn __isa_enabled:dword
extrn __favor:dword
public memset
memset proc
dst:ptr byte,
value:byte,
count:dword
OPTION PROLOGUE:NONE, EPILOGUE:NONE
.FPO ( 0, 3, 0, 0, 0, 0 )
mov ecx, [esp + 0ch] ; the number of bytes to be set
movzx eax, byte ptr[esp + 08h] ; the value to be stored
mov edx, edi ; saving non-volatile edi
mov edi, [esp + 04h]; the dest pointer
test ecx, ecx; 0 ?
jz toend; if so, nothing to do
imul eax, 01010101h
cmp ecx, 020h; < 32 bytes use SmallMov
jle SmallMov
cmp ecx, 080h; For copies 32 < length < 128
jl XmmMovSmall
bt __favor, __FAVOR_ENFSTRG
jnc XMMMov; no jump
; Enhanced Fast Strings
rep stosb ; store the values in the destination buffer
mov eax, dword ptr[esp + 04h] ; return the original destination pointer
mov edi, edx ; restoring non-volatile edi
ret
; XMM register usage
XMMMov :
bt __isa_enabled, __ISA_AVAILABLE_SSE2
jnc SmallMov ; if yes, use xmm large block set
movd xmm0, eax
pshufd xmm0, xmm0, 0
add ecx, edi ; ecx points to end of buffer
movups [edi], xmm0
add edi, 16 ; point to next xmmword
and edi, -16 ; align xmmword ptr
sub ecx, edi ; ecx is offset to end of buffer
cmp ecx, 080h
jle XmmMovSmall
align 16
LargeRangeBytes :
movdqa [edi], xmm0
movdqa [edi + 010h], xmm0
movdqa [edi + 020h], xmm0
movdqa [edi + 030h], xmm0
movdqa [edi + 040h], xmm0
movdqa [edi + 050h], xmm0
movdqa [edi + 060h], xmm0
movdqa [edi + 070h], xmm0
lea edi, [edi + 080h]
sub ecx, 080h
test ecx, 0FFFFFF00h
jnz LargeRangeBytes
jmp XmmSmallLoop
; Do not require 16-byte alignment for sizes lesser than 128 bytes when using XMM registers
XmmMovSmall :
bt __isa_enabled, __ISA_AVAILABLE_SSE2
jnc SmallMov ; if yes, use xmm large block set
movd xmm0, eax
pshufd xmm0, xmm0, 0
align 16
XmmSmallLoop :
cmp ecx, 32
jb XMMTrailingBytes
MidRangeBytes :
movdqu [edi], xmm0
movdqu [edi + 010h], xmm0
add edi, 020h
sub ecx, 020h
cmp ecx, 32 ; checking number of 32 byte blocks left
jnb MidRangeBytes
test ecx, 01Fh ; check to see if there are bytes left
jz toend
XMMTrailingBytes:
; Remaining bytes written with two stores that may overlap instead of 1 byte at a time
lea edi, [edi + ecx - 020h]
movdqu [edi], xmm0
movdqu [edi + 010h], xmm0
mov eax, dword ptr [esp + 04h] ; return the original destination pointer
mov edi, edx ; restoring non-volatile edi
ret
; Copying less than or equal to 32 bytes
SmallMov:
test ecx, 03h ; check if there are bytes that can be stored
jz DwordTest
ByteLoop:
mov [edi], al
inc edi
sub ecx, 1
test ecx, 03h
jnz ByteLoop
DwordTest:
test ecx, 04h ; checking if there are dword blocks that can be set
jz QwordTest
mov [edi], eax
add edi, 4
sub ecx, 4
QwordTest:
test ecx, 0FFFFFFF8h
jz toend
align 16
QwordLoop:
mov [edi], eax
mov [edi + 04h], eax
add edi, 8
sub ecx, 8
test ecx, 0FFFFFFF8h
jnz QwordLoop
toend:
mov eax, dword ptr[esp + 04h] ; return the original destination pointer
mov edi, edx ; restore non-volatile edi
ret
memset endp
end
边栏推荐
- [sword finger offer] interview question 46: translating numbers into strings - dynamic programming
- Delete node quickly and efficiently_ modules
- openwrt 增加RTC(MCP7940 I2C总线)驱动详解
- Taking advantage of 5g Dongfeng, does MediaTek want to fight the high-end market again?
- 传音控股披露被华为起诉一事:已立案,涉案金额2000万元
- ARIMA模型选择与残差
- Flask connects to existing tables in MySQL database
- Join hands with sifive, Galanz will enter the semiconductor field! Exposure of two self-developed chips
- Scratch crawler framework
- Division of entity classes (VO, do, dto)
猜你喜欢

DeFi安全之DEX与AMMs

C language: string function and memory function

Is the array name the address of the first element?

Mapreduce实例(二):求平均值

Sword finger offer 51. reverse pairs in the array

DRF学习笔记(五):视图集ViewSet

Mlx90640 infrared thermal imager temperature sensor module development notes (VII)

Flask连接mysql数据库已有表

Six capabilities of test and development

centos上mysql5.7主从热备设置
随机推荐
文本截取图片(哪吒之魔童降世壁纸)
借5G东风,联发科欲再战高端市场?
busybox login: can't execute '/bin/bash': No such file or directory 解决方法
DRF学习笔记(准备)
Stock account opening commission discount, stock trading account opening which securities company is good, is online account opening safe
Sword finger offer 51. reverse pairs in the array
DRF学习笔记(五):视图集ViewSet
C: What is the return value (revolution) in a function
Addition, deletion, query and modification of MySQL table data
[sword finger offer] interview question 51: reverse pairs in the array - merge sort
C language: custom type
Mlx90640 infrared thermal imager temperature sensor module development notes (VII)
禁令之下,安防巨头海康与大华的应对之策!
Security software related to wireless network analysis (airtrack ng)
webRTC中的coturn服务安装
Inter thread wait and wake-up mechanism, singleton mode, blocking queue, timer
[sword finger offer] interview question 41: median in data flow - large and small heap implementation
快速高效删除node_modules
C language: data storage
网络设备硬核技术内幕 路由器篇 小结(下)