汇编程序求解,编译环境Freescale CodeWarrior,输入年月,求当月是几天,该怎么改,或是帮忙写一个,急等
MONTHds.w1YEARds.w1main:_Startup:Entry:LDS#__SEG_END_SSTACK;initializethestackpointer...
MONTH ds.w 1
YEAR ds.w 1
main:
_Startup:
Entry:
LDS #__SEG_END_SSTACK ; initialize the stack pointer
CLI ; enable interrupts
LDAA #2
STAA MONTH
LDD #2008
STD YEAR
M_LEGTH LDAA #30
LDAB #2
CMPB MONTH
BEQ CALL2
BRA NEXT
CALL2 JSR FEBRARY
BRA Endlessloop
NEXT LDAB MONTH
CMPB #8
BLT ODDBIG
INCB
ODDBIG ANDB #1
ABA
Endlessloop:
BRA Endlessloop
FEBRARY: DECA
LDD YEAR
IDIV #400
XGDX
ANDX #FF
BEQ FINI
LDAB YEAR+1
ANDB #3
BEQ FIII
DECA
FIII: LDD YEAR
IDIV #100
ANDA #$FF
BNE FINI
DECA
FINI: RTS 展开
YEAR ds.w 1
main:
_Startup:
Entry:
LDS #__SEG_END_SSTACK ; initialize the stack pointer
CLI ; enable interrupts
LDAA #2
STAA MONTH
LDD #2008
STD YEAR
M_LEGTH LDAA #30
LDAB #2
CMPB MONTH
BEQ CALL2
BRA NEXT
CALL2 JSR FEBRARY
BRA Endlessloop
NEXT LDAB MONTH
CMPB #8
BLT ODDBIG
INCB
ODDBIG ANDB #1
ABA
Endlessloop:
BRA Endlessloop
FEBRARY: DECA
LDD YEAR
IDIV #400
XGDX
ANDX #FF
BEQ FINI
LDAB YEAR+1
ANDB #3
BEQ FIII
DECA
FIII: LDD YEAR
IDIV #100
ANDA #$FF
BNE FINI
DECA
FINI: RTS 展开
1个回答
展开全部
ORG $2000
MONTH RMB 1
YEAR ds.w 1
ORG $2FF0
YEAR1 RMB 100
ORG $4000
main:
_Startup:
Entry:
LDS #$3000 ; initialize the stack pointer
CLI ; enable interrupts
LDAA #2
STAA MONTH
LDD #2100
STD YEAR
M_LEGTH LDAA #30
LDAB #2
CMPB MONTH
BEQ CALL2
BRA NEXT
CALL2 JSR FEBRARY
BRA Endlessloop
NEXT LDAB MONTH
CMPB #8
BLT ODDBIG
INCB
ODDBIG ANDB #1
ABA
Endlessloop:
BRA Endlessloop
FEBRARY: DECA
PSHA
LDD YEAR
LDX #400
IDIV
XGDX
ANDX #$FFFF
BEQ FINI
LDAB YEAR+1
ANDB #3
BEQ FIII
PULA
DECA
RTS
FIII: LDD YEAR
LDX #100
IDIV
ANDB #$FF
BNE FINI
PULA
DECA
RTS
FINI: PULA
RTS
MONTH RMB 1
YEAR ds.w 1
ORG $2FF0
YEAR1 RMB 100
ORG $4000
main:
_Startup:
Entry:
LDS #$3000 ; initialize the stack pointer
CLI ; enable interrupts
LDAA #2
STAA MONTH
LDD #2100
STD YEAR
M_LEGTH LDAA #30
LDAB #2
CMPB MONTH
BEQ CALL2
BRA NEXT
CALL2 JSR FEBRARY
BRA Endlessloop
NEXT LDAB MONTH
CMPB #8
BLT ODDBIG
INCB
ODDBIG ANDB #1
ABA
Endlessloop:
BRA Endlessloop
FEBRARY: DECA
PSHA
LDD YEAR
LDX #400
IDIV
XGDX
ANDX #$FFFF
BEQ FINI
LDAB YEAR+1
ANDB #3
BEQ FIII
PULA
DECA
RTS
FIII: LDD YEAR
LDX #100
IDIV
ANDB #$FF
BNE FINI
PULA
DECA
RTS
FINI: PULA
RTS
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询