via威盛——笔试题1
来源:互联网 发布:前端内置数据库 编辑:程序博客网 时间:2024/06/06 02:47
威盛笔试试题
2002年软件笔试题
1.三组程序,找出你认为的错误。
a.c b.c c.c 代表的是三个文件名,以下extern后面的long都可以省略
(1)a.c long temp[255];
b.c extern long *temp;
不可以,程序运行时会告诉你非法访问。原因在于,指向类型T的指针并不等价于类型T的数组。extern long *temp声明的是一个指针变量而不是字符数组,因此与实际的定义不同,从而造成运行时非法访问。应该将声明改为extern long temp[]。
(2)a.c long temp[255];
b.c extern long temp[256];
可能越界
(3)a.c long temp[255];
b.c extern long temp[];
正确
2.在第一个声明处编译出了奇怪的错误,为什么?
#include
#include “myfun1.h”
#include “myfun2.h”
int myInt1;
int myInt2;
3.printf(“0x%x”, (&0)[1]); 请问打印了什么?
4.汇编,用ax,bx,cx,dx,求1000×1000/30(四舍五入),结果放在ax中。
5.编最优化Bubble(int *pIntArray,int L),要求:交换元素不能用临时变量,如果有序需要最优。
6.用任意一种编程语言写n!的算法。
F(n)
{
If(n==1) return 1;
Else return n*f(n-1);
}
3, printf("0x%x", (&0)[-1]); 请问打印了什么?
4, 结构体内某项偏移地址
#define list_entry(ptr, type, member) /
((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
struct test{
int a;
int b;
double c;
};
int main(int argc, char *argv[])
{
cout << &((test *)0)->b;
return 0;
}
000004
5, 汇编,用ax,bx,cx,dx, 求1000*1000/30(四舍五入), 结果放在ax中.
6, 1,2,3,4,5,6,7,8,9从栈里出来的可能性.
7, 求一个struct的sizeof.(略)
8, 编最优化Bubble(int *pIntArray,int L),要求:交换元素不能用临时变量,如果有序,
需要最优.
:交换元素不能用临时变量
void exchange1( int &a, int &b)
{
a=a+b;
b=a-b;
a=a-b;
}
依照上面的顺序得出来一行:a = (a = a + b) - (b = a - b);
void exchange2(int& a,int& b)
{
a=a^b;
b=a^b;
a=a^b;
}
依照上面的顺序得出来一行:a = (a = a ^ b) ^ (b = a ^ b);
设一交换标志,无交换就停止执行
2003 Software Engineer笔试题
1. Describe x86 PC’s architecture in a diagram cpu,core chipset, Cache,DRAM, IO-subsystem, IO-Bus
2. SWI instruction is often called a “supervisor call”, describe the actions in detail
* Save the address of the instruction after the SWI in rl4_svc.
* Save the CPSR in SPSR_svc.
* Enter supervisor mode and disable IRQs.
* Set the PC to 08 and begin executing the instruction there.
3.
* What is PIO operation? advantage and disadvantage?
* DMA operation? advantage and disadvantage?
直接内存访问(DMA)方式是一种完全由硬件执行I/O交换的工作方式。DMA控制器从CPU完全接管对总线的控制。数据交换不经过CPU,而直接在内存和I/O设备之间进行。
* Scatter/Gather DMA engine? how does it operate?
Scatter-gather DMA方式使用一个链表描述物理上不连续的存储空间,然后把链表首地址告诉DMA master。DMA master在传输完一块物理连续的数据后,不用发起中断,而是根据链表来传输下一块物理上连续的数据,直到传输完毕后再发起一次中断。
4. MP3 decoder related. (a flow chart of decoding is presented)
* advantages of Huffman encoding?
* why the aliasing reduction is necessary?
* analytical expression in mathematics of the IMDCT?
* which block in the flow chart is suitable for the software implementation and which for the hardware? why?
5. Assembly codes -> C language (about 15 lines).
6. Graduation thesis description.
5。说出你的最大弱点及改进方法。
6。说出你的理想。说出你想达到的目标。
发信人: luckyok (小丫头骗子),
信区: job
标 题: 【合集】威盛笔试题目(大家一起回忆)
发信站: 饮水思源 (2002年11月18日22:04:53 星期一), 站内信件
☆──────────────────────────────────────☆
mikelish (困了) 于 2002年11月18日18:40:40 星期一 提到:
1。说明线程和进程的关系。
2。C程序写结果。
#include <stdio.h>
#define ADD(p) {p++;(*p)++;}
Add(int *p) {p++;(*p)++;}
int a[]={0,1,2};
int main()
{
int *p=a;
ADD(p)
ADD(p)
printf("%d,%d,%d/n",a[0],a[1],a[2]);
p=a;
Add(p);
Add(p);
printf("%d,%d,%d/n",a[0],a[1],a[2]);
}
0,2,3
0,4,3
3。说明下面的的表达有没有不同,如果不同,请说明不同在哪里。
char* s1="hello";
char s2[]="world";
VC下编译无错,执行是出现非法错误。但是TC2下编译运行都没有错误。
第一题:hellopello
第二天:hi 【在 risesun (offer) 的大作中提到: 】 : 头两题VC中编译没有错误,但是运行时有内存不能写的错误。 : 第一题中char* str1 = "hello"; : 系统先给字符串常量"hello"分配内存,其中"hello"是const的,然后分配指针空间,把 : "hello"的首地址赋给str1。所以*str1是不能作为lvalue的。 : 第二题的问题类似。 : 但是如果改成char str1[] = "hello"; : 就行了。因为此时系统先给字符串常量"hello"分配内存,然后为字符数组str1分配空间 : ,执行strcpy的操作,这样str1指向的空间就没有const属性了。 : 第三题中,reti是中断返回,此时不能带参数返回(指ret 4之类的),而且还要清除中断 : 标志。
4.说明下面程序的作用。
func(char*a,char*b)
{
while(*a++=*b++);
return;
}
Strcpy
5.printf可以接受多个参数,为什么,请写出printf的原型。
_CRTIMP int __cdecl printf(const char *, ...);
_CRTIMP int __cdecl vprintf(const char *, va_list);
6.说明malloc和calloc的区别。
Calloc初始化内存为0
7。int31h function 06写出在C中使用x86汇编指令 程序。 (本题记不清了,反正就是考C中嵌入汇编指令。)
8。写程序。
Struct A { Struct A * next; } A组成了一个单向链表,请写出一个程序,用于检测单向链表是否形成环。
// 威盛面试题 // X86汇编程序的等价 C 程序V0.1
struct NODE
{
int val;
struct NODE *curr;
};
void g()
{
....;
NODE a[3];
for (int i = 0; i < 3; i++)
{
f(&a[i], i);
}
}
void f(NODE *pN, int val)
{
pN->val = val;
pN->curr = pN; // 这一句是依据ASM程序直译的, // 感觉有些怪怪的!? }
在 sjhcool (sjhcool) 的大作中提到: 】 :
把下面一段汇编翻译成C代码:
XOR SI,SI
JMP 02DC:02CB
MOV AX,SI
MUL BX
BX = Sizeof struct NODE
ADD AX,NODE
PUSH AX
PUSH SI
CALL 02E4
ADD SP,+04
- via威盛——笔试题1
- via威盛——笔试题2
- via威盛——笔试题3
- via笔试
- 威盛电子- via ASIC 笔试题
- via威盛——屡败屡战,被bs了三次
- 要求:不申请变量和空间反转字符串,用一个函数实现。VIA笔试题
- CJV_1——ImageViewer via swing
- CLR via C# —— 线程
- 属性——CLR via C# 读书笔记
- 泛型——CLR via C# 读书笔记
- 笔试题—sql
- 笔试题—股神
- windows via C/C++ Read Notes (1) ——Kernel Object (1)
- 《CLR via C#》笔记——CLR的执行模型(1)
- Windows Via C/C++ Part Ⅰ Chapter4: 进程—第一个Windows程序(1)
- ClR VIA C# 1
- VIA
- 帮叔叔洗衣服呀
- via威盛——屡败屡战,被bs了三次
- TextArea中使用embedFonts以及asfunction
- dwr与spring集成的错误分析
- asp用户界面
- via威盛——笔试题1
- 链接集合
- via威盛——笔试题2
- CMM LEVEL2 KAP:SCM PROCESS
- access内置函数:(适用access2000)
- ACCESS支持的时间日期函数
- 用asp.net实现将上传的图片变小存入数据库
- 重构与模式
- CSDN的Blog有相册?上传不了图片?