1
0
Fork 0
mirror of https://github.com/pnx/m16vm synced 2026-06-16 03:44:55 +02:00

examples/asm/hello_world.as: fix movl with 7+ offsets.

movl (type RI) have signed 4 byte offset. Resulting in errors with offsets larger than 7.
This commit is contained in:
Henrik Hautakoski 2019-01-04 21:15:30 +01:00
parent dea723ad7a
commit df58899353
No known key found for this signature in database
GPG key ID: 839F3A7EAFAEAFAA

View file

@ -15,14 +15,16 @@ movl $0x1, 87 ; W
sw $0x0, $0x1, 6
movl $0x1, 79 ; O
sw $0x0, $0x1, 7
movl $0x0, 8
movl $0x1, 82 ; R
sw $0x0, $0x1, 8
sw $0x0, $0x1, 0
movl $0x1, 76 ; L
sw $0x0, $0x1, 9
sw $0x0, $0x1, 1
movl $0x1, 68 ; D
sw $0x0, $0x1, 10
sw $0x0, $0x1, 2
; -- setup print loop.
movl $0x0, 0
movl $0x1, 1 ; Load 1 in R1 (used for increment the counter)
_start:
ld $0xF, $0x0, 0 ; Load memory address stored in R0 into R15