NASM - The Netwide Assembler
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Search
Calendar
Login
Register
NASM - The Netwide Assembler
»
NASM Forum
»
Programming with NASM
»
Non power of two code alignment
« previous
next »
Print
Pages: [
1
]
Author
Topic: Non power of two code alignment (Read 9169 times)
Olsonist
Jr. Member
Posts: 26
Non power of two code alignment
«
on:
April 14, 2015, 06:24:35 PM »
I have a 2K block of code. I'm adding code at the beginning and aligning addresses to 16 byte boundaries. That much is standard.
However I'd like to have one 16 byte block at the end, the last 16 bytes.
Any clean trick come to mind?
Logged
encryptor256
Full Member
Posts: 250
Country:
Win64 .
Re: Non power of two code alignment
«
Reply #1 on:
April 14, 2015, 07:00:42 PM »
Labeled block at the end of code or data:
At the end write:
Code:
[Select]
myblock: times 512 db 0
Or
Code:
[Select]
align 16
myblock: times 512 db 0
Logged
Encryptor256's Investigation \ Research Department.
Olsonist
Jr. Member
Posts: 26
Re: Non power of two code alignment
«
Reply #2 on:
April 14, 2015, 08:05:43 PM »
So that requires me to manually figure out how many bytes to skip and that's pretty much what I thought I'd have to do. Is it possible to ASSERT that I've done everything correctly? So if I add some instructions to the head of the 2k that the assembler would barf an error saying I'd forgotten the tail end.
Logged
Print
Pages: [
1
]
« previous
next »
NASM - The Netwide Assembler
»
NASM Forum
»
Programming with NASM
»
Non power of two code alignment