[완료]공부하다 어셈명령어 해석이 해깔려서 질문드립니다.

dbcw8951의 이미지

leal 관련되서 구글에서 검색하다보니 자주 이사이트로 연결되더군요 ^^

어셈블러 관련 공부하면서 (주변의 질타를 받으며... 왜 요즘 이걸 배우냐는... )

각설하구요 ^^

leal 이 movl와 비슷하지만 연산을 살짝해서 목적지에 전달해 줄수 있다...정도는 이해했습니다.

그런데 leal 16(%eax) , (%ebx) 와

add 4,(%eax) 후 movl (%eax),(%ebx) 와 같다고 하는데

주소연산인 경우는 +1 하면 마치 +4한것과 같은 효과를 주는데
왜 여기서는 eax에 16을 더한것인데 왜 4를 더해주는지 모르겠습니다. ^^

학교 숙제에서 이런걸 물어볼리도 없구요... 그냥 혼자서 공부하는 것입니다.

영어독해처럼 어셈독해 리더스 뱅크 이런거 하나 있었으면 참 좋겠네요 ㅜㅜ

jachin의 이미지

주소공간에 대한 구분은 byte 단위로 하게 됩니다.

eax 에 들어가는 값이 주소공간을 지정하는 값이라면

eax 에 16을 더한다는 의미는 16 byte, 즉 4 Word(IA32 에서)를 더한 것과 같습니다.

반대로 주소연산에서 사용하는 Operand 형식이

Offset 이거나 메모리 모드가 Word 단위로 되어 있으면

+1 을 한다는 것은 1 Word 를 더하는 것과 같습니다.

따라서 주소공간으로 표현할 때에는 4 byte 를 더하는 것과 같습니다.

Intel Architecture Software Developer's Manual, Volume 2: Instruction Set Reference Manual

처음과 끝(중간 Instruction Set Reference 부분은 빼고)을 읽어보시면 도움이 되시리라 생각합니다.
====
하나는 전부, 전부는 하나

익명 사용자의 이미지

상식적으로 leal 16(%eax) , (%ebx)가 말이 된다고 생각????

dbcw8951의 이미지

....존경의 눈 ^^

ukyoukyo의 이미지


답변은 아닙니다만,,,

어셈블러 관련 공부하면서 (주변의 질타를 받으며... 왜 요즘 이걸 배우냐는... )

<--- 저는 이게 직업인데, 넘 하기 싫어서 큰일입니다... -_-;;

MASM, GAS 둘다 해야해요... 에효...


------------------ System programmer...^^


------------------ System programmer...^^

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.