2. GCC Assembler와 AVR Assembler의차이 A. GCC Assembler 를사용하는경우 i. Assembly Language Program은.S Extension 을갖는다. ii. C Language Program은.c Extension 을갖는다.

Size: px
Start display at page:

Download "2. GCC Assembler와 AVR Assembler의차이 A. GCC Assembler 를사용하는경우 i. Assembly Language Program은.S Extension 을갖는다. ii. C Language Program은.c Extension 을갖는다."

Transcription

1 C 언어와 Assembly Language 을사용한 Programming 경희대학교조원경 1. AVR Studio 에서사용하는 Assembler AVR Studio에서는 GCC Assembler와 AVR Assmbler를사용한다. A. GCC Assembler : GCC를사용하는경우 (WinAVR 등을사용하는경우 ) 사용할수있다. New Project 를만들때 Project Type Window에서 AVR GCC를선택한다. B. AVR Assembler : AVR Studio를설치하면함께설치된다. New Project 를만들때 Project Type Window에서 Atmel AVR Assembler를선택한다. C. GCC C와 Assembly 언어를혼합한프로그램을작성할경우에는 AVR GCC Project를선택한다.

2 2. GCC Assembler와 AVR Assembler의차이 A. GCC Assembler 를사용하는경우 i. Assembly Language Program은.S Extension 을갖는다. ii. C Language Program은.c Extension 을갖는다. iii. GCC Assembler는 GCC C/C++ 와같은 Preprocessor을사용한다. #include, #define 등을사용할수있다. iv. Data Segment 에정의된변수를초기화할수있다. Assembler 는 Initialized Data 를초기화하는데필요한 Startup Code 를발생 시키고, 이프로그램에서 Initialized Data 를 SRAM 에 Copy 한다. B. Atmel AVR Assembler 를사용하는경우 i. Assembly Language Program 은.asm Extension 을갖는다. ii. Atmel AVR Assembler는 Data Segment 영역을초기화하지않는다. 만약초기화가필요한경우에는 Code Segment 내에초기화에필요한 Data를포함시키고, 이값을 Data Segment 영역으로복사하여주는초기화프로그램을작성하여실행하여야한다. C. 기타차이 GCC Assembler hi8 lo8.asciz hello.section.data.section.text <avr/io.h> Atmel AVR Assembler high low.db hello,0.dseg.cseg m128def.inc 3. GCC Assembly Language Program 예 // Project Name : sw_led_basic # ifndef atmega128 #define atmega128 # endif

3 #define FOSC // Clock Speed #include <avr/io.h> // Definition file for ATmega128 // [Add all hardware information here] // Program Constants // Program Variables Definitions #define RG_TEMP r0 // Temporary Register #define RG_ZERO r1 // #define AC0 r16 // #define AC1 r17 // // SRAM Definitions #define SFR_OFFSET 0.section.data.ORG 0x0000 //cbyte:.byte 0x00 // Define Constant Byte //cword:.word 0x0000 // Define Constant Word //clongword:.long 0x // Define Constant Long Word.section.text.global main // Main Entry into program main: // I/O Port Init clr AC0 sts PORTF, AC0 // PORTF : Memory Mapped I/O Port

4 out DDRD, AC0 // PORTD : I/O Maped Inputport ser AC0 out PORTD, AC0 sts DDRF, AC0 // Input Port PullUp // PORTF : Output Port loop:.end in AC0, PIND andi AC0, 0x03 sts PORTF, AC0 rjmp loop // Loop Indefinitly 4. Atmel AVR Assembly Language Program 예.NOLIST.include "m128def.inc" ; Definition file for ATmega128 ; Interrupt Vectors Table.include "avr128_interrupt_table.inc" ; [Add all hardware information here].device ATmega128.LIST ; Program Constants.equ const = $00 ; Generic Constant Structure ; ; Program Variables Definitions.def AC0 = r16 ;.def AC1 = r17 ; ; SRAM Definitions

5 .DSEG.ORG 0x0100 ;cgbyte:.db $00 ;cgword:.dw $0000 ;vgbyte:.byte 1 ;vgword:.byte 2 ;vgdword:.byte 4 ; Define Constant Byte ; Define Constant Word ; Reserve 1 Byte to Global Variable ; Reserve 2 Byte to Global Variable ; Reserve 4 Byte to Global Variable.CSEG ; Func: RESET Handler Routine RESET: ; Stack Pointer Init ldi AC0, LOW(RAMEND) out SPL, AC0 ldi AC0, HIGH(RAMEND) out SPH, AC0 rjmp MAIN ; Main Entry into program MAIN: ; I/O Port Init clr AC0 sts PORTF, AC0 out DDRD, AC0 ser AC0 out PORTD, AC0 sts DDRF, AC0 ; PORTF : Memory Mapped I/O Port ; PORTD : I/O Maped Inputport ; Input Port PullUp ; PORTF : Output Port LOOP: in AC0, PIND ;

6 andi AC0, $03 sts PORTF, AC0 rjmp LOOP ; Loop Indefinitly 5. C와 Assembly Language을혼합한 Program에서 Register의사용 C Program에서 Assembly 언어로작성된 Subroutine을 Call 하는경우호환성을위하여 C Compiler에서 Rg를사용하는규칙을아는것이중요하다. A. C Compiler에서 Register 사용 i. r0 : Temporary Register 로사용한다. Assembly 언어로작성된프로그램에서 C 함수를호출하는경우이 Rg는 Assembly Code 내에서 Save 되고, Restore 되어야한다. 그러나, Compiler에의하여생성된 Interrupt Routine은 r0 Rg를 Save 하고 Restore 한다. ii. r1 : Compiler는이 Rg의값이 zero라고가정한다. iii. r2 r17, r28, r29 : 이 Rg 들은 Compiler에의하여생성된 Code 에서임시저장장소로이용되기때문에 Assembly Code에서이 Rg가사용되고, Compiler에의하여생성된 Code에서 Call 된다면이 Rg들은 Assembly Code 내에서 Save 되고, Restore 되어야한다. Y Index Register(r29:r28) 는 Function의 Stack Frame Pointer 로사용된다. iv. r18 r27, r30, r31 : 이 Rg 들도 Assembly Code에서사용되고, Assembly Code에서 Compiler에의하여생성된 Code를 Call 하여야한다면 Assembly Code 내에서 Save 되고, Restore 되어야한다. 6. Function Call을할때 Argument Passing과 Return Values A. Register를이용한 Parameter Passing i. 미리약속된 Rg를사용하여 Function Arguments를 Passing 한다. ii. Function Arguments 는좌측에서우측으로배치되어있고, r25 로 부터 r8 까지할당된다. iii. 모든 Arguments 는짝수개의 Rg 에할당된다. C Compiler 가

7 MOVW 명령을사용하여 Word 단위로 Data 를처리하도록하여 보다효과적으로데이터를처리할수있다. iv. 만약보다더많은 Arguments 를 Pass 하여야하는경우에는나머 지 Arguments 는 Stack 을이용하여 Pass 한다. v. Rg 를이용한 Arguments Passing 예 Void lcd_cursor_xy(uint8_t x, uint8_t y); lcd_cursor_xy(2,3); // 이함수는아래와같이 Compile 된다. eor r25, r25 ; r25 clear ldi r24, 0x02 eor r23, r23 ; r23 clear ldi r22, 0x03 call lcd_cursor_xy B. Stack을이용한 Parameter Passing i. 일부함수 (Printf, scanf, etc) 는 모든 Arguments를 Stack을이용 하여 Pass 한다. ii. 이때 char parameters는 Integer(Word) 로확장되어 Pass 된다. iii. Parameters는오른쪽에있는 parameter 부터 Stack에 Push 된다. iv. 8-bit 변수는 16-bit로확장되어 Pass 된다. v. 이때상위 8-bit는 zero로 set 된다. C. Return Values i. 8-bit 값은 r24을이용하여 Return 된다. ii. 16-bit 값은 r25:r24을이용하여 Return 된다. iii. 32-bit 값은 r25:r24:r23:r22을이용하여 Return 된다. iv. 64-bit 값은 r25:r24:r23:r22:r21:r20:r19:r18 을이용하여 Return 된다. 7. Assembly Language 로작성된 Program 에서 C 프로그램함수를 Call 하는

8 경우의예 GCC Assembly 언어로작성된 main 프로그램, 이프로그램에서 GCC c언어로작성된함수를 Call 한다. // Project Name : asm_call_c_func_3v_add // // Author: chowk // Lab: KHU // Date: // Assembly 프로그램에서 C 로작성된 Subroutine 을 Call 하는예제이다. # ifndef atmega128 #define atmega128 # endif #define FOSC // Clock Speed #include <avr/io.h> // Definition file for ATmega128 // [Add all hardware information here] // Program Constants // Program Variables Definitions #define RG_TEMP r0 // Temporary Register #define RG_ZERO r1 //

9 #define AC0 r16 // #define AC1 r17 // // SRAM Definitions #define SFR_OFFSET 0.section.data.ORG 0x0000 // Global 변수 sum을선언하고 0x0000 으로초기화한다. sum:.word 0x0000 // Global 변수 x1을선언하고 0x0104 으로초기화한다. x1:.word 0x0104 // Global 변수 x2을선언하고 0x0205 으로초기화한다. x2:.word 0x0205 // Global 변수 x3을선언하고 0x0306 으로초기화한다. x3:.word 0x0306.section.text.global main // Main Entry into program main: // I/O Port Init clr AC0

10 sts PORTF, AC0 // PORTF : Memory Mapped I/O Port out DDRD, AC0 // PORTD : I/O Maped Inputport ser AC0 out PORTD, AC0 sts DDRF, AC0 // Input Port PullUp // PORTF : Output Port // Y Pointer 에 Global 변수 x1 의시작번지를 Load 한다. ldi r29, hi8(x1) // Y : r29:r28 ldi r28, lo8(x1) // x1 값을 r25:r24 을이용하여 Subroutne에 Pass 한다. ld r24, Y+ ld r25, Y+ // 일반적으로 x2의 Pointer를다시 Load 하여야하나 // 이 Assembly 프로그램에서는 x2가다음번지에할당된것을알기때문에생략할수있다 // ldi r29, hi8(x2) // ldi r28, lo8(x2). // x2 값을 r23:r22 을이용하여 Subroutne에 Pass 한다. ld r22, Y+ ld r23, Y+ // 일반적으로 x3 의 Pointer 를다시 Load 하여야하나 // 이 Assembly 프로그램에서는 x3 가다음번지에할당된것을알기때 문에생략할수있다. 이경우 2 개의명령을생략할수있다.

11 // ldi r29, hi8(x3) // ldi r28, lo8(x3) // x3 값을 r21:r20 을이용하여 Subroutne에 Pass 한다. ld r20, Y+ ld r21, Y // c 언어로작성된 Subroutine을호출한다. call add // Y Pointer 에 Global 변수 sum의시작번지를 Load 한다. ldi r29, hi8(sum) ldi r28, lo8(sum) // Subroutine 으로부터 Return 된결과를 sum에저장한다. st Y+, r24 st Y, r25 loop: in AC0, PIND // SW의상태를읽는다. andi AC0, 0x01 // SW0 를테스트한다. breq NEXT1 // SW0 가 Open 된경우 sum의 LSD(8-bit) 를 LED에출력한다. sts PORTF, r24 rjmp NEXT2 // SW0 가 Closed 된경우 sum의 MSD(8-bit) 를 LED에출력한다. NEXT1: sts PORTF, r25 NEXT2: rjmp loop // Loop Indefinitly

12 .end C 언어로작성된 Subroutine(Fuction) 예 #include <avr/io.h> #include <stdio.h> int short add( int short, int short, int short); // function call 과정 (parameter passing, frame pointer 의저장 ) 의이해하기위함. int short add( int short x1, int short x2, int short x3) { int short z; z = x1 + x2 + x3; return(z); } 8. C 프로그램에서 Program 에서 Assembly Language 작성된함수를 Call 하는경우의예 C 언어로작성된 main 프로그램, 이프로그램에서 Assembly 언어로작성된함수를 Call 한다. // S/W Environment : AVR Studio + WINAVR Compiler // Made by chowk. # ifndef atmega128 #define atmega128 # endif

13 #define FOSC // Clock Speed #include <avr/io.h> #include <stdio.h> #include <avr/interrupt.h> int short asm_add( int short, int short, int short); void init_devices(void); //Initialize all peripherals void init_devices(void) { cli(); DDRF = 0xff; // Disable all interrupts // PORTF : Output PORT PORTF = 0x00; DDRD = 0x00; PORTD = 0xff; sei(); // PORTD : Input PORT // Input PORT Pull up // Re-enable interrupts } int short sum = 0 ; // global variable, bss section에할당된다. int main(void){ init_devices(); // Assembly subroutine을 call 할때 Parameter passing 과

14 // call 및 ret 과정을이해하기위함. // 이프로그램실험 ( Listing File에서 Parameter passing 등을 // 이해하기위함 ) 을위하여는 Compile Option Os 를사용 // 하면안된다. ( 상수만 Pass 하고그연산결과를 Return 하는 // 함수는최적화과정에서생략되기때문 ) sum = asm_add(0x0104, 0x0205, 0x0306); for( ; ; ){ // SW의상태를읽어서, // SW0가 Open 된경우 sum의 LSD(8-bit) 를 LED에출력하고, // SW0가 Closed 된경우 sum의 MSD(8-bit) 를 LED에출력한다. if((pind & 0x01)!= 0) PORTF = (char)(sum & 0x00ff); else PORTF = (char)((sum >> 8) & 0x00ff); } return 0; } Assembly 언어로작성된 c 함수 // Project Name : c_call_asm_func_3v_add // Author: chowk // Lab: KHU // c언어로작성된프로그램에서 Assembly 언어로작성된함수를 call 할때인수의전달과연산결과를 Return하는과정을이해하기위한예제임.

15 # ifndef atmega128 #define atmega128 # endif #define FOSC // Clock Speed #include <avr/io.h> // Definition file for ATmega128 #include <avr/interrupt.h> // [Add all hardware information here] // Program Constants // Program Variables Definitions #define RG_TEMP r0 // Temporary Register #define RG_ZERO r1 // #define AC0 r16 // #define AC1 r17 // // SRAM Definitions // Needed to subtract 0x20 from I/O addresses #define SFR_OFFSET 0.section.data.ORG 0x0100

16 //cbyte:.byte 0x00 // Allocata byte(s) of storage with initialized values //cword:.word 0x0000 // Allocata word(s) of storage with initialized values //clongword:.long 0x // Allocata 32-bit long word(s) of storage with initialized values.global asm_add.section.text // Function Entry asm_add: add r22, r24 // x1의 LSD(r24) 와 x2의 LSD(r22) 를더한다. adc r23, r25 // x1의 MSD(r25), x2의 MSD(r23) 와 Carry를 더한다. add r22, r20 // ((x1의 LSD(r24) + (x2의 LSD(r22))) 에 X3 의 LSD(r20) 를더한다. adc r23, r21 // ((x1의 MSD(r25) + (x2의 MSD(r23))) 에 X3의 MSD(r21) 와 Carry를더한다. movw r24, r22 // r25:r24 를이용하여결과를 Return 하기위하여계산결과를 r25:r24에복사한다. ret.end

슬라이드 1

슬라이드 1 마이크로컨트롤러 2 (MicroController2) 2 강 ATmega128 의 external interrupt 이귀형교수님 학습목표 interrupt 란무엇인가? 기본개념을알아본다. interrupt 중에서가장사용하기쉬운 external interrupt 의사용방법을학습한다. 1. Interrupt 는왜필요할까? 함수동작을추가하여실행시키려면? //***

More information

Microsoft Word - FunctionCall

Microsoft Word - FunctionCall Function all Mechanism /* Simple Program */ #define get_int() IN KEYOARD #define put_int(val) LD A val \ OUT MONITOR int add_two(int a, int b) { int tmp; tmp = a+b; return tmp; } local auto variable stack

More information

Microsoft Word - ExecutionStack

Microsoft Word - ExecutionStack Lecture 15: LM code from high level language /* Simple Program */ external int get_int(); external void put_int(); int sum; clear_sum() { sum=0; int step=2; main() { register int i; static int count; clear_sum();

More information

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202839C1D6C2F7207E203135C1D6C2F >

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202839C1D6C2F7207E203135C1D6C2F > 10주차 문자 LCD 의인터페이스회로및구동함수 Next-Generation Networks Lab. 5. 16x2 CLCD 모듈 (HY-1602H-803) 그림 11-18 19 핀설명표 11-11 번호 분류 핀이름 레벨 (V) 기능 1 V SS or GND 0 GND 전원 2 V Power DD or V CC +5 CLCD 구동전원 3 V 0 - CLCD 명암조절

More information

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202834C1D6C2F7207E2038C1D6C2F729>

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202834C1D6C2F7207E2038C1D6C2F729> 8주차중간고사 ( 인터럽트및 A/D 변환기문제및풀이 ) Next-Generation Networks Lab. 외부입력인터럽트예제 문제 1 포트 A 의 7-segment 에초시계를구현한다. Tact 스위치 SW3 을 CPU 보드의 PE4 에연결한다. 그리고, SW3 을누르면하강 에지에서초시계가 00 으로초기화된다. 동시에 Tact 스위치 SW4 를 CPU 보드의

More information

C# Programming Guide - Types

C# Programming Guide - Types C# Programming Guide - Types 최도경 lifeisforu@wemade.com 이문서는 MSDN 의 Types 를요약하고보충한것입니다. http://msdn.microsoft.com/enus/library/ms173104(v=vs.100).aspx Types, Variables, and Values C# 은 type 에민감한언어이다. 모든

More information

lecture4(6.범용IO).hwp

lecture4(6.범용IO).hwp 제 2 부 C-언어를 사용한 마이크로컨트롤러 활용기초 66 C-언어는 수학계산을 위해 개발된 FORTRAN 같은 고급언어들과는 달 리 Unix 운영체제를 개발하면서 같이 개발된 고급언어이다. 운영체제의 특성상 C-언어는 다른 고급언어에 비해 컴퓨터의 하드웨어를 직접 제어할 수 있는 능력이 탁월하여 마이크로프로세서의 프로그램에 있어서 어셈블 리와 더불어 가장

More information

6주차.key

6주차.key 6, Process concept A program in execution Program code PCB (process control block) Program counter, registers, etc. Stack Heap Data section => global variable Process in memory Process state New Running

More information

untitled

untitled Step Motor Device Driver Embedded System Lab. II Step Motor Step Motor Step Motor source Embedded System Lab. II 2 open loop, : : Pulse, 1 Pulse,, -, 1 +5%, step Step Motor (2),, Embedded System Lab. II

More information

MicrocontrollerAcademy_Lab_ST_040709

MicrocontrollerAcademy_Lab_ST_040709 Micro-Controller Academy Program Lab Materials STMicroelectronics ST72F324J6B5 Seung Jun Sang Sa Ltd. Seung Jun Sang Sa Ltd. Seung Jun Sang Sa Ltd. Seung Jun Sang Sa Ltd. Seung Jun Sang Sa Ltd. Seung Jun

More information

슬라이드 1

슬라이드 1 AVR(Atmega128) Interrupt 1 Interrupt Polling 사용자가명령어를사용하여입력핀의값을계속읽어서변화를알아냄 모든경우의입력또는값의변화에대응하여처리가가능 Interrupt MCU 자체가하드웨어적으로그변화를체크하여변화시에만일정한동작 하드웨어적으로지원되는몇개의입력또는값의변화에만대응처리가가능 처리속도는일반적인경우인터럽트가빠름 인터럽트발생시

More information

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어 개나리 연구소 C 언어 노트 (tyback.egloos.com) 프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어먹고 하더라구요. 그래서,

More information

K&R2 Reference Manual 번역본

K&R2 Reference Manual 번역본 typewriter structunion struct union if-else if if else if if else if if if if else else ; auto register static extern typedef void char short int long float double signed unsigned const volatile { } struct

More information

MAX+plus II Getting Started - 무작정따라하기

MAX+plus II Getting Started - 무작정따라하기 무작정 따라하기 2001 10 4 / Version 20-2 0 MAX+plus II Digital, Schematic Capture MAX+plus II, IC, CPLD FPGA (Logic) ALTERA PLD FLEX10K Series EPF10K10QC208-4 MAX+plus II Project, Schematic, Design Compilation,

More information

강의10

강의10 Computer Programming gdb and awk 12 th Lecture 김현철컴퓨터공학부서울대학교 순서 C Compiler and Linker 보충 Static vs Shared Libraries ( 계속 ) gdb awk Q&A Shared vs Static Libraries ( 계속 ) Advantage of Using Libraries Reduced

More information

BMP 파일 처리

BMP 파일 처리 BMP 파일처리 김성영교수 금오공과대학교 컴퓨터공학과 학습내용 영상반전프로그램제작 2 Inverting images out = 255 - in 3 /* 이프로그램은 8bit gray-scale 영상을입력으로사용하여반전한후동일포맷의영상으로저장한다. */ #include #include #define WIDTHBYTES(bytes)

More information

02 C h a p t e r Java

02 C h a p t e r Java 02 C h a p t e r Java Bioinformatics in J a va,, 2 1,,,, C++, Python, (Java),,, (http://wwwbiojavaorg),, 13, 3D GUI,,, (Java programming language) (Sun Microsystems) 1995 1990 (green project) TV 22 CHAPTER

More information

C++-¿Ïº®Çؼ³10Àå

C++-¿Ïº®Çؼ³10Àå C C++. (preprocessor directives), C C++ C/C++... C++, C. C++ C. C C++. C,, C++, C++., C++.,.. #define #elif #else #error #if #itdef #ifndef #include #line #pragma #undef #.,.,. #include #include

More information

hlogin2

hlogin2 0x02. Stack Corruption off-limit Kernel Stack libc Heap BSS Data Code off-limit Kernel Kernel : OS Stack libc Heap BSS Data Code Stack : libc : Heap : BSS, Data : bss Code : off-limit Kernel Kernel : OS

More information

UART.h #ifndef _UART_H_ #define _UART_H_ #define DIR_TXD #define DIR_RXD sbi(portd,4) cbi(portd,4) #define CPU_CLOCK_HZ UL UART PORT1 void UAR

UART.h #ifndef _UART_H_ #define _UART_H_ #define DIR_TXD #define DIR_RXD sbi(portd,4) cbi(portd,4) #define CPU_CLOCK_HZ UL UART PORT1 void UAR IMC-V0.1 예제소스파일 1. UART 소스코드 (page 1-3) 2. Encoder 소스코드 (page 4-7) 3. ADC 소스코드 (page 8-10) UART.h #ifndef _UART_H_ #define _UART_H_ #define DIR_TXD #define DIR_RXD sbi(portd,4) cbi(portd,4) #define CPU_CLOCK_HZ

More information

3. 1 포인터란 3. 2 포인터변수의선언과사용 3. 3 다차원포인터변수의선언과사용 3. 4 주소의가감산 3. 5 함수포인터

3. 1 포인터란 3. 2 포인터변수의선언과사용 3. 3 다차원포인터변수의선언과사용 3. 4 주소의가감산 3. 5 함수포인터 - Part2-3 3. 1 포인터란 3. 2 포인터변수의선언과사용 3. 3 다차원포인터변수의선언과사용 3. 4 주소의가감산 3. 5 함수포인터 3.1 포인터란 ü ü ü. ü. ü. ü ( ) ? 3.1 ü. ü C ( ).? ü ü PART2-4 ü ( ) PART3-4 3.2 포인터변수의선언과사용 3.2 포인터 변수의 선언과 사용 (1/8) 포인터 변수의

More information

untitled

untitled Embedded System Lab. II Embedded System Lab. II 2 RTOS Hard Real-Time vs Soft Real-Time RTOS Real-Time, Real-Time RTOS General purpose system OS H/W RTOS H/W task Hard Real-Time Real-Time System, Hard

More information

(Asynchronous Mode) ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 -

(Asynchronous Mode) ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 - (Asynchronous Mode) - - - ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 - UART (Univ ers al As y nchronous Receiver / T rans mitter) 8250A 8250A { COM1(3F8H). - Line Control Register

More information

Deok9_Exploit Technique

Deok9_Exploit Technique Exploit Technique CodeEngn Co-Administrator!!! and Team Sur3x5F Member Nick : Deok9 E-mail : DDeok9@gmail.com HomePage : http://deok9.sur3x5f.org Twitter :@DDeok9 > 1. Shell Code 2. Security

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Web server porting 2 Jo, Heeseung Web 을이용한 LED 제어 Web 을이용한 LED 제어프로그램 web 에서데이터를전송받아타겟보드의 LED 를조작하는프로그램을작성하기위해다음과같은소스파일을생성 2 Web 을이용한 LED 제어 LED 제어프로그램작성 8bitled.html 파일을작성 root@ubuntu:/working/web# vi

More information

INTRO Basic architecture of modern computers Basic and most used assembly instructions on x86 Installing an assembly compiler and RE tools Practice co

INTRO Basic architecture of modern computers Basic and most used assembly instructions on x86 Installing an assembly compiler and RE tools Practice co Basic reverse engineering on x86 This is for those who want to learn about basic reverse engineering on x86 (Feel free to use this, email me if you need a keynote version.) v0.1 SeungJin Beist Lee beist@grayhash.com

More information

Microsoft PowerPoint - ch07 - 포인터 pm0415

Microsoft PowerPoint - ch07 - 포인터 pm0415 함수의인수 (argument) 전달방법 C 에서함수의인수전달방법 값에의한호출 (call-by-value): 기본적인방법 포인터에의한호출 (call-by-pointer): 포인터이용 참조에의한호출 (call-by-reference): 참조 (reference) 이용 7-35 값에의한호출 (call-by-value) 함수호출시에변수의값을함수에복사본으로전달 복사본이전달되며,

More information

No Slide Title

No Slide Title Copyright, 2017 Multimedia Lab., UOS 시스템프로그래밍 (Assembly Code and Calling Convention) Seong Jong Choi chois@uos.ac.kr Multimedia Lab. Dept. of Electrical and Computer Eng. University of Seoul Seoul, Korea

More information

hlogin7

hlogin7 0x07. Return Oriented Programming ROP? , (DEP, ASLR). ROP (Return Oriented Programming) (excutable memory) rop. plt, got got overwrite RTL RTL Chain DEP, ASLR gadget Basic knowledge plt, got call function

More information

Microsoft PowerPoint - a10.ppt [호환 모드]

Microsoft PowerPoint - a10.ppt [호환 모드] Structure Chapter 10: Structures t and Macros Structure 관련된변수들의그룹으로이루어진자료구조 template, pattern field structure를구성하는변수 (cf) C언어의 struct 프로그램의 structure 접근 entire structure 또는 individual fields Structure는

More information

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202834C1D6C2F7207E2038C1D6C2F729>

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202834C1D6C2F7207E2038C1D6C2F729> 7주차 AVR의 A/D 변환기제어레지스터및관련실습 Next-Generation Networks Lab. 3. 관련레지스터 표 9-4 레지스터 ADMUX ADCSRA ADCH ADCL 설명 ADC Multiplexer Selection Register ADC 의입력채널선택및기준전압선택외 ADC Control and Status Register A ADC 의동작을설정하거나동작상태를표시함

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 System Software Experiment 1 Lecture 5 - Array Spring 2019 Hwansoo Han (hhan@skku.edu) Advanced Research on Compilers and Systems, ARCS LAB Sungkyunkwan University http://arcs.skku.edu/ 1 배열 (Array) 동일한타입의데이터가여러개저장되어있는저장장소

More information

MPLAB C18 C

MPLAB C18 C MPLAB C18 C MPLAB C18 MPLAB C18 C MPLAB C18 C #define START, c:\mcc18 errorlevel{0 1} char isascii(char ch); list[list_optioin,list_option] OK, Cancel , MPLAB IDE User s Guide MPLAB C18 C

More information

Microsoft Word - ASG AT90CAN128 모듈.doc

Microsoft Word - ASG AT90CAN128 모듈.doc ASG AT90128 Project 3 rd Team Author Cho Chang yeon Date 2006-07-31 Contents 1 Introduction... 3 2 Schematic Revision... 4 3 Library... 5 3.1 1: 1 Communication... 5 iprinceps - 2-2006/07/31

More information

[ 마이크로프로세서 1] 2 주차 3 차시. 포인터와구조체 2 주차 3 차시포인터와구조체 학습목표 1. C 언어에서가장어려운포인터와구조체를설명할수있다. 2. Call By Value 와 Call By Reference 를구분할수있다. 학습내용 1 : 함수 (Functi

[ 마이크로프로세서 1] 2 주차 3 차시. 포인터와구조체 2 주차 3 차시포인터와구조체 학습목표 1. C 언어에서가장어려운포인터와구조체를설명할수있다. 2. Call By Value 와 Call By Reference 를구분할수있다. 학습내용 1 : 함수 (Functi 2 주차 3 차시포인터와구조체 학습목표 1. C 언어에서가장어려운포인터와구조체를설명할수있다. 2. Call By Value 와 Call By Reference 를구분할수있다. 학습내용 1 : 함수 (Function) 1. 함수의개념 입력에대해적절한출력을발생시켜주는것 내가 ( 프로그래머 ) 작성한명령문을연산, 처리, 실행해주는부분 ( 모듈 ) 자체적으로실행되지않으며,

More information

C 프로그래밍 언어 입문 C 프로그래밍 언어 입문 김명호저 숭실대학교 출판국 머리말..... C, C++, Java, Fortran, Python, Ruby,.. C. C 1972. 40 C.. C. 1999 C99. C99. C. C. C., kmh ssu.ac.kr.. ,. 2013 12 Contents 1장 프로그래밍 시작 1.1 C 10 1.2 12

More information

4. #include <stdio.h> #include <stdlib.h> int main() { functiona(); } void functiona() { printf("hihi\n"); } warning: conflicting types for functiona

4. #include <stdio.h> #include <stdlib.h> int main() { functiona(); } void functiona() { printf(hihi\n); } warning: conflicting types for functiona 이름 : 학번 : A. True or False: 각각항목마다 True 인지 False 인지적으세요. 1. (Python:) randint 함수를사용하려면, random 모듈을 import 해야한다. 2. (Python:) '' (single quote) 는한글자를표현할때, (double quote) 는문자열을표현할때사용한다. B. 다음에러를수정하는방법을적으세요.

More information

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A638C0CFC2F72E BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A638C0CFC2F72E BC8A3C8AF20B8F0B5E55D> 뻔뻔한 AVR 프로그래밍 The Last(8 th ) Lecture 유명환 ( yoo@netplug.co.kr) INDEX 1 I 2 C 통신이야기 2 ATmega128 TWI(I 2 C) 구조분석 4 ATmega128 TWI(I 2 C) 실습 : AT24C16 1 I 2 C 통신이야기 I 2 C Inter IC Bus 어떤 IC들간에도공통적으로통할수있는 ex)

More information

[8051] 강의자료.PDF

[8051] 강의자료.PDF CY AC F0 RS1 RS0 OV - P 0xFF 0x80 0x7F 0x30 0x2F 0x20 0x1F 0x18 0x17 0x10 0x0F 0x08 0x07 0x00 0x0000 0x0FFF 0x1000 0xFFFF 0x0000 0xFFFF RAM SFR SMOD - - - GF1 GF0 PD IDL 31 19 18 9 12 13 14 15 1 2 3 4

More information

슬라이드 1

슬라이드 1 -Part3- 제 4 장동적메모리할당과가변인 자 학습목차 4.1 동적메모리할당 4.1 동적메모리할당 4.1 동적메모리할당 배울내용 1 프로세스의메모리공간 2 동적메모리할당의필요성 4.1 동적메모리할당 (1/6) 프로세스의메모리구조 코드영역 : 프로그램실행코드, 함수들이저장되는영역 스택영역 : 매개변수, 지역변수, 중괄호 ( 블록 ) 내부에정의된변수들이저장되는영역

More information

Microsoft PowerPoint - ch07 - 포인터 pm0415

Microsoft PowerPoint - ch07 - 포인터 pm0415 2015-1 프로그래밍언어 7. 포인터 (Pointer), 동적메모리할당 2015 년 4 월 4 일 교수김영탁 영남대학교공과대학정보통신공학과 (Tel : +82-53-810-2497; Fax : +82-53-810-4742 http://antl.yu.ac.kr/; E-mail : ytkim@yu.ac.kr) Outline 포인터 (pointer) 란? 간접참조연산자

More information

SRC PLUS 제어기 MANUAL

SRC PLUS 제어기 MANUAL ,,,, DE FIN E I N T R E A L L O C E N D SU B E N D S U B M O TIO

More information

C 언어 프로그래밊 과제 풀이

C 언어 프로그래밊 과제 풀이 과제풀이 (1) 홀수 / 짝수판정 (1) /* 20094123 홍길동 20100324 */ /* even_or_odd.c */ /* 정수를입력받아홀수인지짝수인지판정하는프로그램 */ int number; printf(" 정수를입력하시오 => "); scanf("%d", &number); 확인 주석문 가필요한이유 printf 와 scanf 쌍

More information

Microsoft PowerPoint - chap6 [호환 모드]

Microsoft PowerPoint - chap6 [호환 모드] 제 6 장프로세스 (Process) 숙대창병모 1 내용 프로세스시작 / 종료 명령중인수 / 환경변수 메모리배치 / 할당 비지역점프 숙대창병모 2 프로세스시작 / 종료 숙대창병모 3 Process Start Kernel exec system call user process Cstart-up routine call return int main(int argc,

More information

컴파일러

컴파일러 YACC 응용예 Desktop Calculator 7/23 Lex 입력 수식문법을위한 lex 입력 : calc.l %{ #include calc.tab.h" %} %% [0-9]+ return(number) [ \t] \n return(0) \+ return('+') \* return('*'). { printf("'%c': illegal character\n",

More information

歯9장.PDF

歯9장.PDF 9 Hello!! C printf() scanf() getchar() putchar() gets() puts() fopen() fclose() fprintf() fscant() fgetc() fputs() fgets() gputs() fread() fwrite() fseek() ftell() I/O 2 (stream) C (text stream) : `/n'

More information

Microsoft PowerPoint - 03_(C_Programming)_(Korean)_Pointers

Microsoft PowerPoint - 03_(C_Programming)_(Korean)_Pointers C Programming 포인터 (Pointers) Seo, Doo-Ok Clickseo.com clickseo@gmail.com 목 차 포인터의이해 다양한포인터 2 포인터의이해 포인터의이해 포인터변수선언및초기화 포인터연산 다양한포인터 3 주소연산자 ( & ) 포인터의이해 (1/4) 변수와배열원소에만적용한다. 산술식이나상수에는주소연산자를사용할수없다. 레지스터변수또한주소연산자를사용할수없다.

More information

untitled

untitled while do-while for break continue while( ) ; #include 0 i int main(void) int meter; int i = 0; while(i < 3) meter = i * 1609; printf("%d %d \n", i, meter); i++; return 0; i i< 3 () 0 (1)

More information

C. KHU-EE xmega Board 에서는 Button 을 2 개만사용하기때문에 GPIO_PUSH_BUTTON_2 과 GPIO_PUSH_BUTTON_3 define 을 Comment 처리 한다. D. AT45DBX 도사용하지않기때문에 Comment 처리한다. E.

C. KHU-EE xmega Board 에서는 Button 을 2 개만사용하기때문에 GPIO_PUSH_BUTTON_2 과 GPIO_PUSH_BUTTON_3 define 을 Comment 처리 한다. D. AT45DBX 도사용하지않기때문에 Comment 처리한다. E. ASF(Atmel Software Framework) 환경을이용한프로그램개발 1. New Project Template 만들기 A. STK600 Board Template를이용한 Project 만들기 i. New Project -> Installed(C/C++) -> GCC C ASF Board Project를선택하고, 1. Name: 창에 Project Name(

More information

임베디드시스템설계강의자료 6 system call 2/2 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과

임베디드시스템설계강의자료 6 system call 2/2 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과 임베디드시스템설계강의자료 6 system call 2/2 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과 System call table and linkage v Ref. http://www.ibm.com/developerworks/linux/library/l-system-calls/ - 2 - Young-Jin Kim SYSCALL_DEFINE 함수

More information

13주-14주proc.PDF

13주-14주proc.PDF 12 : Pro*C/C++ 1 2 Embeded SQL 3 PRO *C 31 C/C++ PRO *C NOT! NOT AND && AND OR OR EQUAL == = SQL,,, Embeded SQL SQL 32 Pro*C C SQL Pro*C C, C Pro*C, C C 321, C char : char[n] : n int, short, long : float

More information

<BDC7C7E83120B0E1B0FABAB8B0EDBCAD202832C1D6C2F7292E687770>

<BDC7C7E83120B0E1B0FABAB8B0EDBCAD202832C1D6C2F7292E687770> 제목 : 실험 #1 결과보고서 GPIO LED 제어 실험일 : 2013. 03. 12. (2 주차 ) 실험내용 - 예비과제 : ATmega126의 8개의핀에연결되어있는 LED 점멸하는프로그램 - 실험과제 : ATmega126의 8개의 LED를순차적으로켜고끄는프로그램 실험결과 - 예비과제 - 해결방법 : 점멸되는시간 (Delay) 를구현하기위해임의의변수 i를적당한지연시간이생길정도의크기만큼증가시킨후,

More information

Microsoft PowerPoint - chap02-C프로그램시작하기.pptx

Microsoft PowerPoint - chap02-C프로그램시작하기.pptx #include int main(void) { int num; printf( Please enter an integer "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; } 1 학습목표 을 작성하면서 C 프로그램의

More information

Microsoft PowerPoint APUE(Intro).ppt

Microsoft PowerPoint APUE(Intro).ppt 컴퓨터특강 () [Ch. 1 & Ch. 2] 2006 년봄학기 문양세강원대학교컴퓨터과학과 APUE 강의목적 UNIX 시스템프로그래밍 file, process, signal, network programming UNIX 시스템의체계적이해 시스템프로그래밍능력향상 Page 2 1 APUE 강의동기 UNIX 는인기있는운영체제 서버시스템 ( 웹서버, 데이터베이스서버

More information

Microsoft PowerPoint - 3ÀÏ°_º¯¼ö¿Í »ó¼ö.ppt

Microsoft PowerPoint - 3ÀÏ°_º¯¼ö¿Í »ó¼ö.ppt 변수와상수 1 변수란무엇인가? 변수 : 정보 (data) 를저장하는컴퓨터내의특정위치 ( 임시저장공간 ) 메모리, register 메모리주소 101 번지 102 번지 변수의크기에따라 주로 byte 단위 메모리 2 기본적인변수형및변수의크기 변수의크기 해당컴퓨터에서는항상일정 컴퓨터마다다를수있음 short

More information

Microsoft Word - 1. ARM Assembly 실습_xp2.doc

Microsoft Word - 1. ARM Assembly 실습_xp2.doc ARM asm 의구조 ARM Assembly 실습 1. 기본골격 AREA armex,code, READONLY ;Mark first instruction to execute start MOV r0, #10 MOV r1,#3 ADD r0, r0, r1 ; r0 = r0 + r1 stop NOP NOP B stop ; Mark end of file 위의 asm의구조를이해하고실행해보세요.

More information

2. Deferred Interrupt Processing A. Binary Semaphores를이용한동기 (Synchronization) i. Binary Semaphores는 Interrupt가발생하였을때특정한 를 Unblock 하는데사용할수있다. 이러한기능은 In

2. Deferred Interrupt Processing A. Binary Semaphores를이용한동기 (Synchronization) i. Binary Semaphores는 Interrupt가발생하였을때특정한 를 Unblock 하는데사용할수있다. 이러한기능은 In AVR FreeRTOS : Interrupt Management 1. 이장의개요 Embedded Real Time 시스템은주변장치로부터발생하는 Event 에실시간으로응답하여야하는응용분야에많이이용된다. 응용분야에따라서는여러개의 Interrupt Source로부터발생하는 Event를실시간으로처리하여야하고, 각각의 Interrupt 처리는서로다른처리시간과속도를필요로하기때문에최적의

More information

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D313939392D382E687770>

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D313939392D382E687770> i ii iii iv v vi 1 2 3 4 가상대학 시스템의 국내외 현황 조사 가상대학 플랫폼 개발 이상적인 가상대학시스템의 미래상 제안 5 웹-기반 가상대학 시스템 전통적인 교수 방법 시간/공간 제약을 극복한 학습동기 부여 교수의 일방적인 내용전달 교수와 학생간의 상호작용 동료 학생들 간의 상호작용 가상대학 운영 공지사항,강의록 자료실, 메모 질의응답,

More information

금오공대 컴퓨터공학전공 강의자료

금오공대 컴퓨터공학전공 강의자료 C 프로그래밍프로젝트 Chap 14. 포인터와함수에대한이해 2013.10.09. 오병우 컴퓨터공학과 14-1 함수의인자로배열전달 기본적인인자의전달방식 값의복사에의한전달 val 10 a 10 11 Department of Computer Engineering 2 14-1 함수의인자로배열전달 배열의함수인자전달방식 배열이름 ( 배열주소, 포인터 ) 에의한전달 #include

More information

본 강의에 들어가기 전

본 강의에 들어가기 전 C 기초특강 종합과제 과제내용 구조체를이용하여교과목이름과코드를파일로부터입력받아관리 구조체를이용하여학생들의이름, 학번과이수한교과목의코드와점수를파일로부터입력 학생개인별총점, 평균계산 교과목별이수학생수, 총점및평균을계산 결과를파일에저장하는프로그램을작성 2 Makefile OBJS = score_main.o score_input.o score_calc.o score_print.o

More information

C++ Programming

C++ Programming C++ Programming 연산자다중정의 Seo, Doo-okok clickseo@gmail.com http://www.clickseo.com 목 차 연산자다중정의 C++ 스타일의문자열 2 연산자다중정의 연산자다중정의 단항연산자다중정의 이항연산자다중정의 cin, cout 그리고 endl C++ 스타일의문자열 3 연산자다중정의 연산자다중정의 (Operator

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 2... ( ). ( ). @ vs. logic data method variable behavior attribute method field Flow (Type), ( ) member @ () : C program Method A ( ) Method B ( ) Method C () program : Java, C++, C# data @ Program

More information

<BDC7C7E83220B0E1B0FABAB8B0EDBCAD202833C1D6C2F7292E687770>

<BDC7C7E83220B0E1B0FABAB8B0EDBCAD202833C1D6C2F7292E687770> 제목 : 실험 #2 결과보고서 외부 LED & Dip 스위치제어 실험일 : 2013. 03. 19. (3 주차 ) 실험내용 - 예비과제 : 메모리맵드 IO를통해 Dip 스위치의값을읽고, On 상태의스위치가하나이상있다면외부 LED를점멸하는프로그램 - 실험과제 : 메모리맵드 IO를통해 Dip 스위치의값을읽고, Dip 스위치의조작을통한사칙연산결과를 LED를통해출력하는프로그램.

More information

T100MD+

T100MD+ User s Manual 100% ) ( x b a a + 1 RX+ TX+ DTR GND TX+ RX+ DTR GND RX+ TX+ DTR GND DSR RX+ TX+ DTR GND DSR [ DCE TYPE ] [ DCE TYPE ] RS232 Format Baud 1 T100MD+

More information

Microsoft PowerPoint - [2009] 02.pptx

Microsoft PowerPoint - [2009] 02.pptx 원시데이터유형과연산 원시데이터유형과연산 원시데이터유형과연산 숫자데이터유형 - 숫자데이터유형 원시데이터유형과연산 표준입출력함수 - printf 문 가장기본적인출력함수. (stdio.h) 문법 ) printf( Test printf. a = %d \n, a); printf( %d, %f, %c \n, a, b, c); #include #include

More information

Microsoft PowerPoint - a8a.ppt [호환 모드]

Microsoft PowerPoint - a8a.ppt [호환 모드] 이장의내용 8 장고급프로시저 스택프레임 재귀 (Recursion) Invoke, Addr, Proc, Proto 디렉티브 다중모듈프로그램작성 2 8.2 스택프레임 Stack Frame ( 또는 activation record) procedure 의다음사항을저장한 영역 urn address passed parameter ( 스택매개변수 ) saved register

More information

chap10.PDF

chap10.PDF 10 C++ Hello!! C C C++ C++ C++ 2 C++ 1980 Bell Bjarne Stroustrup C++ C C++ C, C++ C C 3 C C++ (prototype) (type checking) C C++ : C++ 4 C C++ (prototype) (type checking) [ 10-1] #include extern

More information

중간고사

중간고사 중간고사 예제 1 사용자로부터받은두개의숫자 x, y 중에서큰수를찾는알고리즘을의사코드로작성하시오. Step 1: Input x, y Step 2: if (x > y) then MAX

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Network Programming Jo, Heeseung Network 실습 네트워크프로그래밍 멀리떨어져있는호스트들이서로데이터를주고받을수있도록프로그램을구현하는것 파일과는달리데이터를주고받을대상이멀리떨어져있기때문에소프트웨어차원에서호스트들간에연결을해주는장치가필요 이러한기능을해주는장치로소켓이라는인터페이스를많이사용 소켓프로그래밍이란용어와네트워크프로그래밍이랑용어가같은의미로사용

More information

<4D F736F F D20BDBAC5D7C7CE20B6F3C0CEC6AEB7B9C0CCBCADB0ADC1C2202D203420C7C1B7CEB1D7B7A1B9D62E646F63>

<4D F736F F D20BDBAC5D7C7CE20B6F3C0CEC6AEB7B9C0CCBCADB0ADC1C2202D203420C7C1B7CEB1D7B7A1B9D62E646F63> 라인트레이서강좌 4. 프로그래밍 2005년 8월 1일류대우 (davidryu@newtc.co.kr) 1. 라인트레이서란? 라인트레이서는정해진주행선을따라움직이는자율이동로봇이다. 현재공장자동화부분에서이용되고있는무인반송차가라인트레이서이다. 라인트레이서의기본적인원리는주어진주행선을센서로검출하여이것에따라목적위치까지이동하는것이다. 라인트레이서는크게 3부분 - 컨트롤러부,

More information

인터럽트 * 인터럽트처리메커니즘 ATmega128 인터럽트 2

인터럽트 * 인터럽트처리메커니즘 ATmega128 인터럽트 2 ATmega128 인터럽트 1 제 04 강 인터럽트 (Interrupt) 인터럽트개요외부인터럽트참고 ) FND 회로실습및과제 인터럽트 * 인터럽트처리메커니즘 ATmega128 인터럽트 2 인터럽트 ( 계속 ) ATmega128 인터럽트 3 * 인터럽트벡터 (P.104 표 7.1 참조 ) : 35 개 인터럽트 ( 계속 ) * 인터럽트허용 / 금지메커니즘 ATmega128

More information

untitled

untitled 1 hamks@dongguk.ac.kr (goal) (abstraction), (modularity), (interface) (efficient) (robust) C Unix C Unix (operating system) (network) (compiler) (machine architecture) 1 2 3 4 5 6 7 8 9 10 ANSI C Systems

More information

Microsoft Word - FS_ZigBee_Manual_V1.3.docx

Microsoft Word - FS_ZigBee_Manual_V1.3.docx FirmSYS Zigbee etworks Kit User Manual FS-ZK500 Rev. 2008/05 Page 1 of 26 Version 1.3 목 차 1. 제품구성... 3 2. 개요... 4 3. 네트워크 설명... 5 4. 호스트/노드 설명... 6 네트워크 구성... 6 5. 모바일 태그 설명... 8 6. 프로토콜 설명... 9 프로토콜 목록...

More information

chap7.key

chap7.key 1 7 C 2 7.1 C (System Calls) Unix UNIX man Section 2 C. C (Library Functions) C 1975 Dennis Ritchie ANSI C Standard Library 3 (system call). 4 C?... 5 C (text file), C. (binary file). 6 C 1. : fopen( )

More information

untitled

untitled CAN BUS RS232 Line CAN H/W FIFO RS232 FIFO CAN S/W FIFO TERMINAL Emulator COMMAND Interpreter PROTOCOL Converter CAN2RS232 Converter Block Diagram > +- syntax

More information

untitled

untitled 9 hamks@dongguk.ac.kr : Source code Assembly language code x = a + b; ld a, %r1 ld b, %r2 add %r1, %r2, %r3 st %r3, x (Assembler) (bit pattern) (machine code) CPU security (code generator).. (Instruction

More information

디지털공학 5판 7-8장

디지털공학 5판 7-8장 Flip-Flops c h a p t e r 07 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 7.10 7.11 292 flip flop Q Q Q 1 Q 0 set ON preset Q 0 Q 1 resetoff clear Q Q 1 2 SET RESET SET RESET 7 1 crossednand SET RESET SET RESET

More information

ATmega128

ATmega128 ATmega128 외부인터럽트실습 Prof. Jae Young Choi ( 최재영교수 ) (2015 Spring) Prof. Jae Young Choi 외부인터럽트실험 외부인터럽트를사용하기위해관렦레지스터를설정 일반적으로 I/O 포트에대한설정이끝난후에외부인터럽트나타이머 / 카운터설정 PE4~7 번까지 4 개의외부인터럽트 INT4~INT7 까지사용 외부인터럽트사용법요약

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Verilog: Finite State Machines CSED311 Lab03 Joonsung Kim, joonsung90@postech.ac.kr Finite State Machines Digital system design 시간에배운것과같습니다. Moore / Mealy machines Verilog 를이용해서어떻게구현할까? 2 Finite State

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 7-Segment Device Control - Device driver Jo, Heeseung HBE-SM5-S4210 의 M3 Module 에는 6 자리를가지는 7-Segment 모듈이아래그림처럼실장 6 Digit 7-Segment 2 6-Digit 7-Segment LED controller 16비트로구성된 2개의레지스터에의해제어 SEG_Sel_Reg(Segment

More information

iii. Design Tab 을 Click 하여 WindowBuilder 가자동으로생성한 GUI 프로그래밍환경을확인한다.

iii. Design Tab 을 Click 하여 WindowBuilder 가자동으로생성한 GUI 프로그래밍환경을확인한다. Eclipse 개발환경에서 WindowBuilder 를이용한 Java 프로그램개발 이예는 Java 프로그램의기초를이해하고있는사람을대상으로 Embedded Microcomputer 를이용한제어시스템을 PC 에서 Serial 통신으로제어 (Graphical User Interface (GUI) 환경에서 ) 하는프로그램개발예를설명한다. WindowBuilder:

More information

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A634C0CFC2F72E BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A634C0CFC2F72E BC8A3C8AF20B8F0B5E55D> 뻔뻔한 AVR 프로그래밍 The 4 th Lecture 유명환 ( yoo@netplug.co.kr) 1 시간 (Time) 에대한정의 INDEX 2 왜타이머 (Timer) 와카운터 (Counter) 인가? 3 ATmega128 타이머 / 카운터동작구조 4 ATmega128 타이머 / 카운터관련레지스터 5 뻔뻔한노하우 : 레지스터비트설정방법 6 ATmega128

More information

Microsoft PowerPoint - chap06-2pointer.ppt

Microsoft PowerPoint - chap06-2pointer.ppt 2010-1 학기프로그래밍입문 (1) chapter 06-2 참고자료 포인터 박종혁 Tel: 970-6702 Email: jhpark1@snut.ac.kr 한빛미디어 출처 : 뇌를자극하는 C프로그래밍, 한빛미디어 -1- 포인터의정의와사용 변수를선언하는것은메모리에기억공간을할당하는것이며할당된이후에는변수명으로그기억공간을사용한다. 할당된기억공간을사용하는방법에는변수명외에메모리의실제주소값을사용하는것이다.

More information

목차 포인터의개요 배열과포인터 포인터의구조 실무응용예제 C 2

목차 포인터의개요 배열과포인터 포인터의구조 실무응용예제 C 2 제 8 장. 포인터 목차 포인터의개요 배열과포인터 포인터의구조 실무응용예제 C 2 포인터의개요 포인터란? 주소를변수로다루기위한주소변수 메모리의기억공간을변수로써사용하는것 포인터변수란데이터변수가저장되는주소의값을 변수로취급하기위한변수 C 3 포인터의개요 포인터변수및초기화 * 변수데이터의데이터형과같은데이터형을포인터 변수의데이터형으로선언 일반변수와포인터변수를구별하기위해

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 7-Segment Device Control - Device driver Jo, Heeseung HBE-SM5-S4210 의 M3 Module 에는 6 자리를가지는 7-Segment 모듈이아래그림처럼실장 6 Digit 7-Segment 2 6-Digit 7-Segment LED Controller 16비트로구성된 2개의레지스터에의해제어 SEG_Sel_Reg(Segment

More information

A Dynamic Grid Services Deployment Mechanism for On-Demand Resource Provisioning

A Dynamic Grid Services Deployment Mechanism for On-Demand Resource Provisioning C Programming Practice (II) Contents 배열 문자와문자열 구조체 포인터와메모리관리 구조체 2/17 배열 (Array) (1/2) 배열 동일한자료형을가지고있으며같은이름으로참조되는변수들의집합 배열의크기는반드시상수이어야한다. type var_name[size]; 예 ) int myarray[5] 배열의원소는원소의번호를 0 부터시작하는색인을사용

More information

목차 1. 제품 소개... 4 1.1 특징... 4 1.2 개요... 4 1.3 Function table... 5 2. 기능 소개... 6 2.1 Copy... 6 2.2 Compare... 6 2.3 Copy & Compare... 6 2.4 Erase... 6 2

목차 1. 제품 소개... 4 1.1 특징... 4 1.2 개요... 4 1.3 Function table... 5 2. 기능 소개... 6 2.1 Copy... 6 2.2 Compare... 6 2.3 Copy & Compare... 6 2.4 Erase... 6 2 유영테크닉스( 주) 사용자 설명서 HDD014/034 IDE & SATA Hard Drive Duplicator 유 영 테 크 닉 스 ( 주) (032)670-7880 www.yooyoung-tech.com 목차 1. 제품 소개... 4 1.1 특징... 4 1.2 개요... 4 1.3 Function table... 5 2. 기능 소개... 6 2.1 Copy...

More information

Microsoft PowerPoint - chap03-변수와데이터형.pptx

Microsoft PowerPoint - chap03-변수와데이터형.pptx #include int main(void) { int num; printf( Please enter an integer: "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num %d\n", num); return 0; } 1 학습목표 의 개념에 대해 알아본다.

More information

5 167 Python Jon Franklin Python Python Python Python USB USB RS485 C Python DLL Python Python dll Python Python ctypes dll ctypes Python C Linux Wind

5 167 Python Jon Franklin Python Python Python Python USB USB RS485 C Python DLL Python Python dll Python Python ctypes dll ctypes Python C Linux Wind 5 167 Python Jon Franklin Python Python Python Python USB USB RS485 C Python DLL Python Python dll Python Python ctypes dll ctypes Python C Linux Windows Python C ctypes dll C dll C 168 159 168 DLL Windows

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 7-SEGMENT DEVICE CONTROL - DEVICE DRIVER Jo, Heeseung 디바이스드라이버구현 : 7-SEGMENT HBE-SM5-S4210 의 M3 Module 에는 6 자리를가지는 7-Segment 모듈이아래그림처럼실장 6 Digit 7-Segment 2 디바이스드라이버구현 : 7-SEGMENT 6-Digit 7-Segment LED

More information

9

9 9 hamks@dongguk.ac.kr : Source code Assembly language code x = a + b; ld a, %r1 ld b, %r2 add %r1, %r2, %r3 st %r3, x (Assembler) (bit pattern) (machine code) CPU security (code generator).. (Instruction

More information

11장 포인터

11장 포인터 누구나즐기는 C 언어콘서트 제 9 장포인터 이번장에서학습할내용 포인터이란? 변수의주소 포인터의선언 간접참조연산자 포인터연산 포인터와배열 포인터와함수 이번장에서는포인터의기초적인지식을학습한다. 포인터란? 포인터 (pointer): 주소를가지고있는변수 메모리의구조 변수는메모리에저장된다. 메모리는바이트단위로액세스된다. 첫번째바이트의주소는 0, 두번째바이트는 1, 변수와메모리

More information

Chapter #01 Subject

Chapter #01  Subject Device Driver March 24, 2004 Kim, ki-hyeon 목차 1. 인터럽트처리복습 1. 인터럽트복습 입력검출방법 인터럽트방식, 폴링 (polling) 방식 인터럽트서비스등록함수 ( 커널에등록 ) int request_irq(unsigned int irq, void(*handler)(int,void*,struct pt_regs*), unsigned

More information

untitled

untitled if( ) ; if( sales > 2000 ) bonus = 200; if( score >= 60 ) printf(".\n"); if( height >= 130 && age >= 10 ) printf(".\n"); if ( temperature < 0 ) printf(".\n"); // printf(" %.\n \n", temperature); // if(

More information

금오공대 컴퓨터공학전공 강의자료

금오공대 컴퓨터공학전공 강의자료 C 프로그래밍프로젝트 Chap 13. 포인터와배열! 함께이해하기 2013.10.02. 오병우 컴퓨터공학과 13-1 포인터와배열의관계 Programming in C, 정재은저, 사이텍미디어. 9 장참조 ( 교재의 13-1 은읽지말것 ) 배열이름의정체 배열이름은 Compile 시의 Symbol 로서첫번째요소의주소값을나타낸다. Symbol 로서컴파일시에만유효함 실행시에는메모리에잡히지않음

More information

EWAVR 5.1x 프로젝트 옵션 설정(1_2) 2. Project -> > Option -> > General Option -> > Output / Library Configuration Library Configuration 은 사용하게 될 Library file을

EWAVR 5.1x 프로젝트 옵션 설정(1_2) 2. Project -> > Option -> > General Option -> > Output / Library Configuration Library Configuration 은 사용하게 될 Library file을 EWAVR 5.1x 프로젝트 옵션 설정(1) 1. Project -> Option -> General Options General Options Target 은 IAR Compiler 를 사용 프로세서에 맞추는 가장 중요한 초기화 과정이다. Processor configuration 에서 V0~ V6 설정은 Code/ Data Memory 를 기준으로 사용되는

More information

PRO1_09E [읽기 전용]

PRO1_09E [읽기 전용] Siemens AG 1999 All rights reserved File: PRO1_09E1 Information and - ( ) 2 3 4 5 Monitor/Modify Variables" 6 7 8 9 10 11 CPU 12 Stop 13 (Forcing) 14 (1) 15 (2) 16 : 17 : Stop 18 : 19 : (Forcing) 20 :

More information

No Slide Title

No Slide Title Copyright, 2001 Multimedia Lab., CH 3. COM object (In-process server) Eun-sung Lee twoss@mmlab.net Multimedia Lab. Dept. of Electrical and Computer Eng. University of Seoul Seoul, Korea 0. Contents 1.

More information

KEY 디바이스 드라이버

KEY 디바이스 드라이버 KEY 디바이스드라이버 임베디드시스템소프트웨어 I (http://et.smu.ac.kr et.smu.ac.kr) 차례 GPIO 및 Control Registers KEY 하드웨어구성 KEY Driver 프로그램 key-driver.c 시험응용프로그램 key-app.c KEY 디바이스드라이버 11-2 GPIO(General-Purpose Purpose I/O)

More information

목차 1. 개요... 3 2. USB 드라이버 설치 (FTDI DRIVER)... 4 2-1. FTDI DRIVER 실행파일... 4 2-2. USB 드라이버 확인방법... 5 3. DEVICE-PROGRAMMER 설치... 7 3-1. DEVICE-PROGRAMMER

목차 1. 개요... 3 2. USB 드라이버 설치 (FTDI DRIVER)... 4 2-1. FTDI DRIVER 실행파일... 4 2-2. USB 드라이버 확인방법... 5 3. DEVICE-PROGRAMMER 설치... 7 3-1. DEVICE-PROGRAMMER < Tool s Guide > 목차 1. 개요... 3 2. USB 드라이버 설치 (FTDI DRIVER)... 4 2-1. FTDI DRIVER 실행파일... 4 2-2. USB 드라이버 확인방법... 5 3. DEVICE-PROGRAMMER 설치... 7 3-1. DEVICE-PROGRAMMER 실행파일... 7 4. DEVICE-PROGRAMMER 사용하기...

More information