Kingcom / armips

An assembler for various ARM and MIPS platforms. Builds available at http://buildbot.orphis.net/armips/
MIT License
359 stars 77 forks source link

Am I using it improperly or is it a bug? #171

Closed XXXXXX-Diwa closed 4 years ago

XXXXXX-Diwa commented 4 years ago

.gba .open "zm.gba","abandoned.gba",0x8000000

.definelabel AreaHeaderDataOffset,0x875FAC4 .definelabel CurrentArea,3000054h .definelabel CurrSprite,0x3000738

.org 82b5b68h
push r4-r7 ldr r4,=AreaHeaderDataOffset ldr r5,=CurrentArea
ldrb r0,[r5] ;区号 lsl r0,r0,2h add r4,r4,r0 ;加上偏移值 ldr r4,[r4] ;获得当前区HeaderDATA地址 ldrb r0,[r5,1h] ;房间号 lsl r6,r0,4 sub r6,r0 ;十五倍 lsl r6,r6,2 ;60倍 add r4,r6 add r5,26h ldrb r0,[r5] ;精灵set激活号 lsl r0,r0,3 ;乘以8 add r4,20h add r0,r4 ;得到当前房间激活的精灵set数据坐标 ldr r4,[r0] ldr r5,=CurrSprite add r5,23h ldrb r0,[r5] ;得到主精灵序号 lsl r6,r0,1 add r6,r0 ;三倍 add r4,r6 ldrb r0,[r4,2h] ;读取设置的属性 mov r6,0F0h and r0,r6 ;去掉序号 lsr r0,r0,4 ;去掉末位 pop r4-r7 bx r14 .pool .close

the line 26 "ldr r4,[r0]" can't patch(Auto ignore??)

XXXXXX-Diwa commented 4 years ago

It seems that the document code is ASNI, which will cause this bug