about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2018-06-27 22:58:08 -0700
committerKartik K. Agaram <vc@akkartik.com>2018-06-27 22:58:08 -0700
commit5cce54ebf3088b0411e4026de0545f3f9eb01828 (patch)
treeecc08ed4eb1dd593789961291308984d6ea63cce
parent582875bf3ae0a9e266fe9b49b93b8b8e1748c918 (diff)
downloadmu-5cce54ebf3088b0411e4026de0545f3f9eb01828.tar.gz
4280 - fix test program to use subx instructions
I don't know how to tell nasm to generate an imm32. It's a minor stepping-stone
anyway; just emit the machine code directly.
-rwxr-xr-xsubx/teensy/test5bin91 -> 99 bytes
-rw-r--r--subx/teensy/test5.s11
2 files changed, 7 insertions, 4 deletions
diff --git a/subx/teensy/test5 b/subx/teensy/test5
index da1c8cd6..a67a5299 100755
--- a/subx/teensy/test5
+++ b/subx/teensy/test5
Binary files differdiff --git a/subx/teensy/test5.s b/subx/teensy/test5.s
index 3049615a..54a79846 100644
--- a/subx/teensy/test5.s
+++ b/subx/teensy/test5.s
@@ -35,9 +35,12 @@ phdr:                                                 ; Elf32_Phdr
 phdrsize  equ  $ - phdr
 
 _start:
-  mov     bl, 42
-  xor     eax, eax
-  inc     eax
-  int     0x80
+  mov ebx, 42
+  xor eax, eax
+  ; add eax, 0x00000001
+    db 0x81  ; op
+    db 0xc0  ; modr/m
+    dd 0x00000001  ; imm32 operand
+  int 0x80
 
 filesize      equ     $ - $$