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?

GitHubに公開してるvfd.macの使い方

Posted at

フロッピーディスクのイメージファイルを作るNASM用のマクロをGitHubに公開してるんだが、ソースを読んでも使い方がよく分からないかも知れないので、使い方を簡単に書いておく。

https://github.com/himaprog/vfd.mac

hello.asm
; ***** メッセージ「Hello.」を表示する(1.44MB FD用)

%define VFD_DISKSIZE 1440
%define VFD_DISKLABEL_OEM "HELLO"
%define VFD_DISKLABEL_VOL "HELLO"

%include "..\_nasm_include\vfd.mac"


VFD_MBR_BEGIN

start:
	xor	ax, ax
	mov	ds, ax
	;mov	es, ax
	mov	ss, ax
	mov	sp, VFD_MBR_HEAD

	; カーソル位置の属性と文字の取得
	xor	bx, bx
	mov	ah, 8
	int	0x10

	; 文字列の表示
	mov	bp, Msg
	mov	cx, MsgLen
	xor	dx, dx
	xor	bh, bh
	mov	bl, ah
	mov	ax, 0x1301
	int	0x10

	cli
	hlt


dataArea:
; データ
	Msg	db "Hello.", 0Dh, 0Ah
	MsgLen	equ $ - Msg

VFD_MBR_END


VFD_BLANK_DISK

ディスク情報などの煩雑な物をマクロに任せて、殆どが目的の処理内容のコードだけで書くことが出来る。
また、VFD_の各種マクロ定義は、必要な物だけ使えば良い。例えば、VFD_DISKLABEL_VOLをソースに書かなければ、標準的な物として"NO LABEL"というボリューム名が付くようになってる。

マクロのインクルードの場所は、使う環境に合わせて適当な物にしてほしい。

以上、簡単な説明。

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?