Jump to content

Need help with this assembly code


0xygen

1 post in this topic

Recommended Posts

Posted

I am trying to unlink using assembly but I cannot wrap my head around it

Here's my code:

int get_Damage()
1B5B0E0		LDRB            W8, [X0,#0x49]		;; load isCPU into W8
1B5B0E4		CMP             W8, #0			;; compare if isCPU is false
1B5B0E8		B.EQ            loc_1B5B0F4		;; branch if false
1B5B0EC		CMP             W8, #1			;; compare if isCPU is true
1B5B0F0		B.EQ            loc_1B5B0FC		;; branch if true

1B5B0F4		MOV             X0, #0x1000000		;; first branch for player so high value
1B5B0F8		B               locret_1B5B104		;; branch to RET

1B5B0FC		MOV             X0, #0			;; second branch for CPU so no value
1B5B100		B               locret_1B5B104		;; branch to RET

1B5B104		RET					;; end our function

I am not particular about optimizing my code to look short or nice, I did as simple as I could but somehow it shows blank screen when dmg comes xD

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines