2010/04/22 - [Programming/C / Win32 / MFC] - 변수인데 왜 operation on 'variable' may be undefined 야?

디스어셈블된 내용중에
lea         edi,[ebp-48h]
이러한 부분이 있었는데 []의 의미를 몰랐다가 이제서야 찾아본다.
[]는 C언어의 []와 유사하게 그 변수의 내용을 메모리 번지로 해석해서 그 번지의 내용을 받아오는 연산자이다.
그러니까 ebp의 내용에서 0x48을 뺀 주소를 edi에 저정하라는 의미이다. (LEA)

LEA--Load Effective Address

Opcode

Instruction

Description

8D /r

LEA r16,m

Store effective address for m in register r16

8D /r

LEA r32,m

Store effective address for m in register r32


[링크 : http://www.intel.com/software/.../instruct32_hh/vc150.htm]

8.9.6 메모리 참조
------------------

  인텔문법에서 메모리를 간접적으로 참조하는 형식은 다음과 같다.
    SECTION:[BASE + INDEX*SCALE + DISP]
  이것은 다음과 같은 AT&T 방식으로 참조된다.
    SECTION:DISP(BASE, INDEX, SCALE)

[링크 : http://vozlt.tistory.com/8]

'Programming > Assembly(어셈블리)' 카테고리의 다른 글

.DATA? 지시어  (0) 2011.07.31
x86 register  (2) 2011.07.17
PowerPC(PPC) 어셈관련 내용  (0) 2011.04.04
어셈블리 언어  (0) 2010.05.03
어셈블리 언어 기본 템플릿  (0) 2010.04.17
Posted by 구차니

'Programming > Assembly(어셈블리)' 카테고리의 다른 글

.DATA? 지시어  (0) 2011.07.31
x86 register  (2) 2011.07.17
PowerPC(PPC) 어셈관련 내용  (0) 2011.04.04
어셈블리 메모리 참조 (x86 memory addressing)  (0) 2010.05.03
어셈블리 언어 기본 템플릿  (0) 2010.04.17
Posted by 구차니
음.. 역시 모든 언어는 skeleton code를 외우면 상대적으로 익히기가 쉬운듯!
(문득 C언어 배울때 #include <stdio.h> void main() {} 하던 기억이.. OTL)

.386
.MODEL Flat, STDCALL
.DATA
; Your initialized data. <comment>
.DATA?
;Your uninitialized data. <comment>
.CONST
.CODE
label:
    end label

[링크 : http://win32assembly.online.fr/tut1.html]

'Programming > Assembly(어셈블리)' 카테고리의 다른 글

.DATA? 지시어  (0) 2011.07.31
x86 register  (2) 2011.07.17
PowerPC(PPC) 어셈관련 내용  (0) 2011.04.04
어셈블리 메모리 참조 (x86 memory addressing)  (0) 2010.05.03
어셈블리 언어  (0) 2010.05.03
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2009. 3. 19. 16:38
The ORG command is a standard (almost universal) command that tells the assembler where the program is to reside in memory

ORG 명령어는 메모리에 상주할 프로그램의 주소를 알려준다고 되어 있는데,
JMP 와는 다른 듯 한데 무슨 차이일려나..

[출처 :  www.ordersomewherechaos.com/rosso/fetish/m102/web100/docs/assemb-tutorial.html]
링크가 깨져, 구글에서 저장된 페이지로 보시기 바랍니다.


23. ORG
Label     Operation   Operand
optional     ORG      expression

The ORG directive instructs the assembler to continue the assembly from the
memory location specified by the operand. The operand must be an expression
that can be immediately evaluated, and its value must be a valid address (i.e., it
cannot be negative). Thus the operand can be a number, a known symbol, or an
expression that can be evaluated by the assembler at this point. Such an operand
is called “definable.”

[출처 : http://www.davidsalomon.name/assem.advertis/asl.pdf]


ORG expression
Sets the location counter to expression.
[출처 : MASM reference]
Posted by 구차니