화요일, 12월 11, 2007

INTEL to AT&T ASM

아나, 꼭 안보다가 볼 때 ... 이런...
GCC Inline Assemble code 도 올려놔야겠다... -_-; 에이씨...

[INTEL]
mov ax, word[msg]
mov ax, 1
mov ah, 1
mov word [ds:si], ax
mov ah, 'a'
int 0x13
jmp 0x1000:0000

msg db 'M'
msg db 0x10, 0x20
dw 0aa55h
times 100 db 0

[AT&T]
movw msg, %ax
movw $1, %ax
movb $1, %ah
movw %ax, %ds:(%si)
movb $'a' , ah
int $int13
ljmp $0x1000, $0

msg: .byte 'M'
msg: .byte 0x10, 0x20
.word 0xaa55
.space 100, 0

댓글 없음:

댓글 쓰기