Recent

Author Topic: How to declare couple of bytes in inline assembly?  (Read 437 times)

LemonParty

  • Full Member
  • ***
  • Posts: 163
How to declare couple of bytes in inline assembly?
« on: March 18, 2025, 02:45:04 pm »
Hello.
I need to declare a couple of bytes in assembly block to replace unrecognized instruction.
Architecture AARCH64.

Thaddy

  • Hero Member
  • *****
  • Posts: 16805
  • Ceterum censeo Trump esse delendam
Re: How to declare couple of bytes in inline assembly?
« Reply #1 on: March 18, 2025, 02:46:41 pm »
db ?
Changing servers. thaddy.com may be temporary unreachable but restored when the domain name transfer is done.

LemonParty

  • Full Member
  • ***
  • Posts: 163
Re: How to declare couple of bytes in inline assembly?
« Reply #2 on: March 18, 2025, 02:53:51 pm »
"db"
Not work.

Zvoni

  • Hero Member
  • *****
  • Posts: 2961
Re: How to declare couple of bytes in inline assembly?
« Reply #3 on: March 18, 2025, 03:35:28 pm »
Reminds of a WhatsApp-Chat i saw...

User 1: What's this? (Shows a Picture of a USB-C connector)
User 2: Type C
User 1: C
User 1: Doesn't work
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Thaddy

  • Hero Member
  • *****
  • Posts: 16805
  • Ceterum censeo Trump esse delendam
Re: How to declare couple of bytes in inline assembly?
« Reply #4 on: March 18, 2025, 04:03:24 pm »
Usually this is assembler agnostic:
Code: [Select]
DB 0x90, 0x90, 0x90  // Three Intel NOP instructions in a rowYou should be able to use the same for AARCH64. As long as you know the instruction byte order, that is.

You obviously did not know about the db instruction/directive..
It works, the code example is for intel though.
Fully supported for AARCH64 instructions in byte notation.
« Last Edit: March 18, 2025, 04:17:22 pm by Thaddy »
Changing servers. thaddy.com may be temporary unreachable but restored when the domain name transfer is done.

LemonParty

  • Full Member
  • ***
  • Posts: 163
Re: How to declare couple of bytes in inline assembly?
« Reply #5 on: March 18, 2025, 04:21:03 pm »
I found the solution.
Code: ASM  [Select][+][-]
  1. .byte 1,2,3,4

Thaddy

  • Hero Member
  • *****
  • Posts: 16805
  • Ceterum censeo Trump esse delendam
Re: How to declare couple of bytes in inline assembly?
« Reply #6 on: March 18, 2025, 04:32:12 pm »
That is the same indeed.
Changing servers. thaddy.com may be temporary unreachable but restored when the domain name transfer is done.

 

TinyPortal © 2005-2018