【BA4988】_853B函数(未完成)

反汇编:

_853B()
{
	A=Lcd_WriteData
	X=Lcd_X
	Y=Lcd_Y
	_8714() // 00E97714
	A=Lcd_X
	X=A&0x07
	20B8=0x80

	while (X != 0x00)
	{
		20B8>>=1
		X-=1
	}
	20B9=20B8^0xFF
	if (Lcd_X >= 0x08)
	{
		if ((03F8 == 0x01) && (003B == 03FA) && (003A == 03F9))
		{
			003A=03FB
			003B=03FC
			if (Lcd_WriteData == 0x00)
			{
				goto 85A6
			}
			*3A=((*3A &20B9)|0x01)
			003A=03F9
			003B=03FA
			return
		}
		if (Lcd_WriteData == 0x00)
		{
			goto 85D4
		}
		0420 = (0420&0xFE)|0x01
		return
	}
	else
	{
		goto 85E0
	}
}

汇编:

[00E9753B]853B [AD 80 20]: LDA $2080 = #$01 @ 送累加器
[00E9753E]853E [AE 81 20]: LDX $2081 = #$0F @ 送变址寄存器X
[00E97541]8541 [AC 82 20]: LDY $2082 = #$4A @ 送变址寄存器Y
[00E97544]8544 [20 14 87]: JSR $8714 @ 转子$00E97714
[00E97547]8547 [AD 81 20]: LDA $2081 = #$0F @ 送累加器
[00E9754A]854A [29 07 AA]: AND #$07 @ 逻辑与
[00E9754C]854C [AA A9 80]: TAX @ 累加器送变址寄存器X
[00E9754D]854D [A9 80 8D]: LDA #$80 @ 送累加器
[00E9754F]854F [8D B8 20]: STA $20B8 = #$80 @ 存累加器
[00E97552]8552 [8A C9 00]: TXA @ 变址寄存器X送累加器
[00E97553]8553 [C9 00 F0]: CMP #$00 @ 累加器与存储器比较
[00E97555]8555 [F0 07 4E]: BEQ $855E @ 结果为0分支
[00E97557]8557 [4E B8 20]: LSR $20B8 = #$40 @ 右移
[00E9755A]855A [CA 4C 52]: DEX @ 变址寄存器X减1
[00E9755B]855B [4C 52 85]: JMP $8552 @ 转移$00E97552
[00E9755E]855E [AD B8 20]: LDA $20B8 = #$01 @ 送累加器
[00E97561]8561 [49 FF 8D]: EOR #$FF @ 逻辑异或
[00E97563]8563 [8D B9 20]: STA $20B9 = #$FE @ 存累加器
[00E97566]8566 [AD 81 20]: LDA $2081 = #$0F @ 送累加器
[00E97569]8569 [C9 08 90]: CMP #$08 @ 累加器与存储器比较
[00E9756B]856B [90 73 AD]: BCC $85E0 @ 进位为0分支
[00E9756D]856D [AD F8 03]: LDA $03F8 = #$01 @ 送累加器
[00E97570]8570 [C9 01 D0]: CMP #$01 @ 累加器与存储器比较
[00E97572]8572 [D0 4A AD]: BNE $85BE @ 结果不为0分支
[00E97574]8574 [AD 3B 00]: LDA $003B = #$0D @ 送累加器
[00E97577]8577 [CD FA 03]: CMP $03FA = #$04 @ 累加器与存储器比较
[00E9757A]857A [D0 42 AD]: BNE $85BE @ 结果不为0分支
[00E9757C]857C [AD 3A 00]: LDA $003A = #$00 @ 送累加器
[00E9757F]857F [CD F9 03]: CMP $03F9 = #$00 @ 累加器与存储器比较
[00E97582]8582 [D0 3A AD]: BNE $85BE @ 结果不为0分支
[00E97584]8584 [AD FB 03]: LDA $03FB = #$00 @ 送累加器
[00E97587]8587 [8D 3A 00]: STA $003A = #$00 @ 存累加器
[00E9758A]858A [AD FC 03]: LDA $03FC = #$10 @ 送累加器
[00E9758D]858D [8D 3B 00]: STA $003B = #$10 @ 存累加器
[00E97590]8590 [AD 80 20]: LDA $2080 = #$01 @ 送累加器
[00E97593]8593 [C9 00 F0]: CMP #$00 @ 累加器与存储器比较
[00E97595]8595 [F0 0F A0]: BEQ $85A6 @ 结果为0分支
[00E97597]8597 [A0 00 B1]: LDY #$00 @ 送变址寄存器Y
[00E97599]8599 [B1 3A 2D]: LDA ($3A),Y @ $1000 = #$00 @ 送累加器
[00E9759B]859B [2D B9 20]: AND $20B9 = #$FE @ 逻辑与
[00E9759E]859E [0D B8 20]: ORA $20B8 = #$01 @ 逻辑或
[00E975A1]85A1 [91 3A 4C]: STA ($3A),Y @ $1000 = #$01 @ 存累加器
[00E975A3]85A3 [4C AF 85]: JMP $85AF @ 转移$00E975AF

[00E975AF]85AF [AD F9 03]: LDA $03F9 = #$00 @ 送累加器
[00E975B2]85B2 [8D 3A 00]: STA $003A = #$00 @ 存累加器
[00E975B5]85B5 [AD FA 03]: LDA $03FA = #$04 @ 送累加器
[00E975B8]85B8 [8D 3B 00]: STA $003B = #$04 @ 存累加器
[00E975BB]85BB [4C DD 85]: JMP $85DD @ 转移$00E975DD
[00E975BE]85BE [AD 80 20]: LDA $2080 = #$01 @ 送累加器
[00E975C1]85C1 [C9 00 F0]: CMP #$00 @ 累加器与存储器比较
[00E975C3]85C3 [F0 0F A0]: BEQ $85D4 @ 结果为0分支
[00E975C5]85C5 [A0 00 B1]: LDY #$00 @ 送变址寄存器Y
[00E975C7]85C7 [B1 3A 2D]: LDA ($3A),Y @ $0420 = #$00 @ 送累加器
[00E975C9]85C9 [2D B9 20]: AND $20B9 = #$FE @ 逻辑与
[00E975CC]85CC [0D B8 20]: ORA $20B8 = #$01 @ 逻辑或
[00E975CF]85CF [91 3A 4C]: STA ($3A),Y @ $0420 = #$01 @ 存累加器
[00E975D1]85D1 [4C 02 86]: JMP $8602 @ 转移$00E97602

[00E975DD]85DD [4C 02 86]: JMP $8602 @ 转移$00E97602

[00E97602]8602 [60 A2 00]: RTS @ 子程序返回

上一篇:KBP310-ASEMI开关小电源扁桥KBP310


下一篇:MapReduce学习一:概述及简单案例编写