|
Programming C, bash, Python, Perl, PHP, Java, you name it. |
|
Thread Tools | Display Modes |
|
|||
[solved] at&t assembly question
writing a game in assembly on netbsd.. i'm used to flat assembler, but i'm trying out gas syntax a little bit. its actually not that bad.
my question is this: in flat assembler i have: Code:
MY_OFFSET = $29 ... input: rb $ff ; reserve $ff bytes in .bss ... mov byte [input + MY_OFFSET], $01 BUT in gas i have something like this: Code:
.global MY_OFFSET .equ MY_OFFSET, 0x29 ... .bss .lcomm input, 0xff ... movb $0x01, input + MY_OFFSET (%rip) error: invalid operands (*und* and *und* sections) for '+' if i put the value instead of MY_OFFSET it works Code:
movb $0x01, input + 0x29 (%rip) whats the proper way to do what i want in gas? Last edited by billy_bazooka; 3rd October 2019 at 10:28 PM. Reason: solved this thing |
|
|||
actually. solved it.
.equ was in the different file/section, i though .global would make it properly accessible to the main program, when i put .equ in the same file as the code, it works. problem solved. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
why does this simple assembly program abort trap? | billy_bazooka | Programming | 1 | 26th July 2017 04:45 AM |
learn assembly | ephemera | Book reviews | 5 | 26th December 2012 06:29 PM |
Sparc assembly anyone? | Randux | Programming | 4 | 24th June 2011 07:10 AM |
Undertaking computer science degree, which BSD for learning professional assembly? | lionsong | Programming | 15 | 18th October 2009 11:26 PM |
Assembly and kernel programming. | bsdnewbie999 | Programming | 9 | 17th May 2009 05:52 AM |