0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

axxで80286のハンドリング

Last updated at Posted at 2025-01-17

axx で、80286のアセンブルをしてみました。Hello Worldだけですが、マシンコードは正しく出ました。

パターンファイル

ビットパターンの解析をしていず、文字列リテラルが多いです。

80286.axx
MOV AX,CS   :: 0x8c,0xc8
MOV DS,AX   :: 0x8e,0xd8
MOV ES,AX   :: 0x8e,0xc0
MOV AH,!c   :: 0xb4,c
MOV DX,!a   :: 0xba,a,a>>8,a>>16,a>>24
MOV AX,!a   :: 0xb8,a,a>>8,a>>16,a>>24
INT !a      :: 0xcd,a
DB !a :: a
プログラム
hw.s
section .text
_start:
    mov ax, cs
    mov ds, ax
    mov es, ax

    mov ah, 0x09
    mov dx,hello_message
    int 0x21

    mov ax, 0x4C00
    int 0x21

hello_message: .ascii "Hello, World!"
    db 0xa
    .ascii "$"
アセンブル
$ axx 80286.axx hw.s
0000000000000000 hw.s 1 section .text 
0000000000000000 hw.s 2 _start: 
0000000000000000 hw.s 3     mov ax, cs  0x8c 0xc8
0000000000000002 hw.s 4     mov ds, ax  0x8e 0xd8
0000000000000004 hw.s 5     mov es, ax  0x8e 0xc0
0000000000000006 hw.s 6  
0000000000000006 hw.s 7     mov ah, 0x09  0xb4 0x09
0000000000000008 hw.s 8     mov dx,hello_message  0xba 0x16 0x00 0x00 0x00
000000000000000d hw.s 9     int 0x21  0xcd 0x21
000000000000000f hw.s 10  
000000000000000f hw.s 11     mov ax, 0x4C00  0xb8 0x00 0x4c 0x00 0x00
0000000000000014 hw.s 12     int 0x21  0xcd 0x21
0000000000000016 hw.s 13  
0000000000000016 hw.s 14 hello_message: .ascii "Hello, World!"  0x48 0x65 0x6c 0x6c 0x6f 0x2c 0x20 0x57 0x6f 0x72 0x6c 0x64 0x21
0000000000000023 hw.s 15     db 0xa  0x0a
0000000000000024 hw.s 16     .ascii "$"  0x24
0000000000000025 hw.s 17 

テストアセンブルです。今どき、80286なんか使っている人はいないと思いますが、一応やってみました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?