Permalink
Browse files

Replace nask with nasm

  • Loading branch information...
tatsumack committed Mar 22, 2017
1 parent b210e37 commit 877ec9db70ce54de7cf49a2950f80396c2e5386f
Showing with 15 additions and 16 deletions.
  1. +6 −2 src/haribote/Makefile
  2. +5 −7 src/haribote/asmhead.nas
  3. +3 −3 src/haribote/ipl09.nas
  4. +1 −4 src/haribote/naskfunc.nas
View
@@ -7,6 +7,7 @@ INCPATH = ../../z_tools/haribote/
MAKE = make -r
NASK = $(TOOLPATH)nask
+NASM = nasm
CC1 = $(TOOLPATH)gocc1 -I$(INCPATH) -Os -Wall -quiet
GAS2NASK = $(TOOLPATH)gas2nask -a
OBJ2BIM = $(TOOLPATH)obj2bim
@@ -29,10 +30,13 @@ default :
# ファイル生成規則
ipl09.bin : ipl09.nas Makefile
- $(NASK) ipl09.nas ipl09.bin ipl09.lst
+ $(NASM) ipl09.nas -o ipl09.bin -l ipl09.lst
asmhead.bin : asmhead.nas Makefile
- $(NASK) asmhead.nas asmhead.bin asmhead.lst
+ $(NASM) asmhead.nas -o asmhead.bin -l asmhead.lst
+
+naskfunc.obj : naskfunc.nas Makefile
+ $(NASM) -fwin32 naskfunc.nas -o naskfunc.obj -l naskfunc.lst
hankaku.bin : hankaku.txt Makefile
$(MAKEFONT) hankaku.txt hankaku.bin
View
@@ -1,8 +1,6 @@
; haribote-os boot asm
; TAB=4
-[INSTRSET "i486p"]
-
VBEMODE EQU 0x105 ; 1024 x 768 x 8bit�J���[
; �i��ʃ��[�h�ꗗ�j
; 0x100 : 640 x 400 x 8bit�J���[
@@ -71,7 +69,7 @@ VRAM EQU 0x0ff8 ;
MOV [SCRNY],AX
MOV EAX,[ES:DI+0x28]
MOV [VRAM],EAX
- JMP keystatus
+ JMP SHORT keystatus
scrn320:
MOV AL,0x13 ; VGA�O���t�B�b�N�X�A320x200x8bit�J���[
@@ -118,7 +116,7 @@ keystatus:
AND EAX,0x7fffffff ; bit31��0�ɂ���i�y�[�W���O�֎~�̂��߁j
OR EAX,0x00000001 ; bit0��1�ɂ���i�v���e�N�g���[�h�ڍs�̂��߁j
MOV CR0,EAX
- JMP pipelineflush
+ JMP SHORT pipelineflush
pipelineflush:
MOV AX,1*8 ; �ǂݏ����”\�Z�O�����g32bit
MOV DS,AX
@@ -188,9 +186,9 @@ memcpy:
RET
; memcpy�̓A�h���X�T�C�Y�v���t�B�N�X����Y��Ȃ���΁A�X�g�����O���߂ł�����
- ALIGNB 16
+ ALIGN 16, DB 0
GDT0:
- RESB 8 ; �k���Z���N�^
+ TIMES 8 DB 0 ; �k���Z���N�^
DW 0xffff,0x0000,0x9200,0x00cf ; �ǂݏ����”\�Z�O�����g32bit
DW 0xffff,0x0000,0x9a28,0x0047 ; ��s�”\�Z�O�����g32bit�ibootpack�p�j
@@ -199,5 +197,5 @@ GDTR0:
DW 8*3-1
DD GDT0
- ALIGNB 16
+ ALIGN 16, DB 0
bootpack:
View
@@ -7,7 +7,7 @@ CYLS EQU 9 ;
; �ȉ��͕W���I��FAT12�t�H�[�}�b�g�t���b�s�[�f�B�X�N�̂��߂̋L�q
- JMP entry
+ JMP SHORT entry
DB 0x90
DB "HARIBOTE" ; �u�[�g�Z�N�^�̖��O��R�ɏ����Ă悢�i8�o�C�g�j
DW 512 ; 1�Z�N�^�̑傫���i512�ɂ��Ȃ���΂����Ȃ��j
@@ -26,7 +26,7 @@ CYLS EQU 9 ;
DD 0xffffffff ; ���Ԃ�{�����[���V���A���ԍ�
DB "HARIBOTEOS " ; �f�B�X�N�̖��O�i11�o�C�g�j
DB "FAT12 " ; �t�H�[�}�b�g�̖��O�i8�o�C�g�j
- RESB 18 ; �Ƃ肠����18�o�C�g�����Ă���
+ TIMES 18 DB 0 ; �Ƃ肠����18�o�C�g�����Ă���
; �v���O�����{��
@@ -148,6 +148,6 @@ next:
.ret:
RET
- RESB 0x7dfe-$ ; 0x7dfe�܂ł�0x00�Ŗ��߂閽��
+ TIMES 0x1fe-($-$$) DB 0 ; 0x7dfe�܂ł�0x00�Ŗ��߂閽��
DB 0x55, 0xaa
@@ -1,10 +1,7 @@
; naskfunc
; TAB=4
-[FORMAT "WCOFF"] ; �I�u�W�F�N�g�t�@�C�����郂�[�h
-[INSTRSET "i486p"] ; 486�̖��߂܂Ŏg�������Ƃ����L�q
[BITS 32] ; 32�r�b�g���[�h�p�̋@�B����点��
-[FILE "naskfunc.nas"] ; �\�[�X�t�@�C�������
GLOBAL _io_hlt, _io_cli, _io_sti, _io_stihlt
GLOBAL _io_in8, _io_in16, _io_in32
@@ -174,7 +171,7 @@ _asm_inthandler0c:
MOV ES,AX
CALL _inthandler0c
CMP EAX,0
- JNE _asm_end_app
+ JNE NEAR _asm_end_app
POP EAX
POPAD
POP DS

0 comments on commit 877ec9d

Please sign in to comment.