From f02a1ed42758c38ab97d5a58a4dd821b8daaf0eb Mon Sep 17 00:00:00 2001 From: Homer Hsing Date: Fri, 14 Sep 2012 13:40:08 +0800 Subject: [PATCH] Make the entry point padding code logic looks nicer --- assembler/src/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assembler/src/main.c b/assembler/src/main.c index 8307c8b..1da9fe7 100644 --- a/assembler/src/main.c +++ b/assembler/src/main.c @@ -300,7 +300,8 @@ int main(int argc, char **argv) entry->inst_offset = inst_offset; entry1 = entry->next; if (entry1 && entry1->islabel && is_entry_point(entry1->string)) { - while (((inst_offset+1) & 0x3) != 0) { + // insert empty instructions until (inst_offset+1) % 4 == 0 + while (((inst_offset+1) % 4) != 0) { tmp_entry = calloc(sizeof(*tmp_entry), 1); entry->next = tmp_entry; tmp_entry->next = entry1; -- 2.7.4