다음과 같은 경우는 어떤 순서로 실행되는건가요?

sweetcorn의 이미지

H8/300 계열의 어셈블리 코드입니다만, 그건 중요하지 않구요.
다음과 같이 .global 심볼이 여러 개 선언되어 있으면 어떤 순서로 프로그램이 실행되는지 궁금합니다. 인터넷을 뒤져도 못 찾겠네요...

아래 보시면
.global _systime_handler
.global _systime_tm_return

이렇게 되어있는데 실행은 순서되로 되는것인지요....(분기문을 제외한다면요)
소스 나갑니당.

extern void systime_handler(void);

__asm__("
.text
.align 1
.global _systime_handler
.global _systime_tm_return
_systime_handler:
; r6 saved by ROM

push r0 ; both motors & task
; switcher need this reg.

; increment system timer

mov.w @_sys_time+2,r6 ; LSW -> r6
add.b #0x1,r6l ; 16 bit: add 1
addx #0x0,r6h
mov.w r6,@_sys_time+2
bcc sys_nohigh ; speedup for 65535 cases

mov.w @_sys_time,r6 ; MSW -> r6
add.b #0x1,r6l
addx #0x0,r6h
mov.w r6,@_sys_time
sys_nohigh:
"
#ifdef CONF_DMOTOR
"
jsr _dm_handler ; call motor driver
"
#endif

#ifdef CONF_DSOUND
"
jsr _dsound_handler ; call sound handler
"
#endif

#ifdef CONF_LNP
"
mov.w @_lnp_timeout_counter,r6 ; check LNP timeout counter
subs #0x1,r6
mov.w r6,r6 ; subs doesn't change flags!
bne sys_noreset
jsr _lnp_integrity_reset
mov.w @_lnp_timeout,r6 ; reset timeout

sys_noreset:mov.w r6,@_lnp_timeout_counter
"
#endif

#ifdef CONF_DKEY
" jsr _dkey_handler
"
#endif

#ifdef CONF_BATTERY_INDICATOR
"
mov.w @_battery_refresh_counter,r6
subs #0x1,r6
bne batt_norefresh
jsr _battery_refresh
mov.w @_battery_refresh_period,r6
batt_norefresh:mov.w r6,@_battery_refresh_counter
"
#endif

#ifdef CONF_AUTOSHUTOFF
"
mov.w @_auto_shutoff_counter,r6
subs #0x1,r6
bne auto_notshutoff
jsr _autoshutoff_check
mov.w @_auto_shutoff_period,r6
auto_notshutoff:
mov.w r6,@_auto_shutoff_counter
"
#endif

#ifdef CONF_VIS
"
mov.b @_vis_refresh_counter,r6l
dec r6l
bne vis_norefresh
jsr _vis_handler
mov.b @_vis_refresh_period,r6l
vis_norefresh: mov.b r6l,@_vis_refresh_counter
"
#endif

#ifdef CONF_LCD_REFRESH
"
mov.b @_lcd_refresh_counter,r6l
dec r6l
bne lcd_norefresh
jsr _lcd_refresh_next_byte
mov.b @_lcd_refresh_period,r6l
lcd_norefresh:mov.b r6l,@_lcd_refresh_counter
"
#endif

#ifdef CONF_TM
"
mov.b @_tm_current_slice,r6l
dec r6l
bne sys_noswitch ; timeslice elapsed?

mov.w @_tm_switcher_vector,r6
jsr @r6 ; call task switcher
_systime_tm_return:
mov.b @_tm_timeslice,r6l ; new timeslice

sys_noswitch:mov.b r6l,@_tm_current_slice
"
#endif
"
pop r0

bclr #3,@0x91:8 ; reset compare A IRQ flag

rts
");

댓글 달기

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
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.