当前位置:网站首页>: 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 41: median in data flow - large and small heap implementation
- Personal perception of project optimization
- Content ambiguity occurs when using transform:translate()
- Openwrt compilation driver module (write code at any position outside the openwrt source code, and compile independently in a modular manner.Ko)
- webRTC中的coturn服务安装
- [sword finger offer] interview question 42: the maximum sum of continuous subarrays -- with 0x80000000 and int_ MIN
- First acquaintance with MySQL database
- flume增量采集mysql数据到kafka
- vant-ui toast和dialog使用
- 这些题~~
猜你喜欢

Addition, deletion, query and modification of MySQL table data

CAS compares the knowledge exchanged, ABA problems, and the process of lock upgrading

: 0xC0000005: 写入位置 0x01458000 时发生访问冲突----待解

Pychart imports the existing local installation package

数据表的约束以及设计、联合查询——8千字攻略+题目练习解答

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

centos上mysql5.7主从热备设置

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

QT (VI) value and string conversion

Penetration test - dry goods | 80 + network security interview experience post (interview)
随机推荐
数据表的约束以及设计、联合查询——8千字攻略+题目练习解答
Text capture picture (Wallpaper of Nezha's demon child coming to the world)
Flask连接mysql数据库已有表
编码技巧——全局日志开关
A powerful web vulnerability scanning and verification tool (vulmap)
Makefile specifies the path of the library file loaded when the program runs
openwrt 增加RTC(MCP7940 I2C总线)驱动详解
busybox login: can't execute '/bin/bash': No such file or directory 解决方法
openwrt 编译驱动模块(在openwrt源代码外部任意位置编写代码,独立模块化编译.ko)
Samsung closes its last mobile phone factory in China
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
Reduce program ROM ram, GCC -ffunction sections -fdata sections -wl, – detailed explanation of GC sections parameters
drf使用:get请求获取数据(小例子)
C language: Sanzi game
编码技巧——全局异常捕获&统一的返回体&业务异常
DRF学习笔记(准备)
QT (VI) value and string conversion
Solve the compilation warning of multiple folders with duplicate names under the openwrt package directory (call subdir function)
Leetcode-1: sum of two numbers