Skip to content
Permalink
Browse files

Add test case for .align, .aligna and .fill.

  • Loading branch information...
Prof9 committed May 3, 2019
1 parent 58700a8 commit 8260786b9f06dabb3fdea7f202be3f6b87c99018
@@ -0,0 +1,11 @@
.gba
.create "output.bin",0

; Invalid align
.align 3
.aligna 3
; But fill works fine
.fill 3, 0x11
.fill 3

.close
@@ -0,0 +1,2 @@
Errors.asm(5) error: Invalid alignment 3
Errors.asm(6) error: Invalid alignment 3
@@ -0,0 +1,34 @@
.gba
.create "output.bin",0

; Align+fill
.db 0x01
.align 2, 0x22 ; 1 byte
.db 0x03
.align 4, 0x44 ; 1 byte
.db 0x05
.align 8, 0x66 ; 3 bytes

; Align where it isn't needed
.align 1, 0x77 ; 0 bytes
.align 2, 0x88 ; 0 bytes
.align 4, 0x99 ; 0 bytes
.align 8, 0xAA ; 0 bytes

; Default align
.db 0xB
.align ; 3 bytes

; Fill
.fill 0x40, 0xCC ; 64 bytes
.fill 0x40 ; 64 bytes

; Align virtual address
.headersize 2
.org 0x80 ; org=0x80, orga=0x7E
.db 0xDD
.align 4, 0xEE ; Produces 3 bytes
; Align physical address
.aligna 4, 0xFF ; org=0x84, orga=0x82, so produces 2 bytes

.close
Binary file not shown.

0 comments on commit 8260786

Please sign in to comment.
You can’t perform that action at this time.