[OS] made 30 days day02: Register and Makefile

The basic register

  • AX (accumulator): accumulator register
  • CX (counter): Count Register
  • DX (data): Data Register
  • BX (base): Base Register
  • SP (stack pointer): stack pointer register
  • BP (base pointer): base pointer register
  • SI (source index): index register Source
  • DI (destination index): index register Objective

Segment register

  • ES (extra segment): additional segment register
  • CS (code segment): code segment register
  • SS (stack segment): stack segment register
  • DS (data segment): Data segment register
  • FS (...): Unknown
  • GS (...): Unknown

Makefile

TOOLPATH = ../z_tools/
MAKE     = $(TOOLPATH)make.exe -r
NASK     = $(TOOLPATH)nask.exe
EDIMG    = $(TOOLPATH)edimg.exe
IMGTOL   = $(TOOLPATH)imgtol.com
COPY     = copy
DEL      = del

default :
	$(MAKE) img

ipl10.bin : ipl10.nas Makefile
	$(NASK) ipl10.nas ipl10.bin ipl10.lst

haribote.sys : haribote.nas Makefile
	$(NASK) haribote.nas haribote.sys haribote.lst

haribote.img : ipl10.bin haribote.sys Makefile
	$(EDIMG)   imgin:../z_tools/fdimg0at.tek \
		wbinimg src:ipl10.bin len:512 from:0 to:0 \
		copy from:haribote.sys to:@: \
		imgout:haribote.img

img :
	$(MAKE) haribote.img

run :
	$(MAKE) img
	$(COPY) haribote.img ..\z_tools\qemu\fdimage0.bin
	$(MAKE) -C ../z_tools/qemu

install :
	$(MAKE) img
	$(IMGTOL) w a: haribote.img

clean :
	-$(DEL) ipl10.bin
	-$(DEL) ipl10.lst
	-$(DEL) haribote.sys
	-$(DEL) haribote.lst

src_only :
	$(MAKE) clean
	-$(DEL) haribote.img

  

Guess you like

Origin www.cnblogs.com/flashsun/p/11626723.html