Skip to content

Commit

Permalink
add(Demo): add Hello World Demo
Browse files Browse the repository at this point in the history
  • Loading branch information
sabertazimi committed Mar 13, 2016
1 parent 59ab8fb commit e6f0aa4
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 4 deletions.
Binary file added demo/helloWorld/HELLO.EXE
Binary file not shown.
20 changes: 20 additions & 0 deletions demo/helloWorld/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
NAME = hello

EXE = $(NAME).exe
OBJS = $(NAME).obj
SRCS = $(NAME).asm

LINK_FLAG = /subsystem:windows
ML_FLAG = /c/coff
MASM_FLAG = /Zi/Zd

$(EXE): $(OBJS)
LINK $(LINK_FLAG) $(OBJS)
$(OBJS): $(SRCS)
MASM $(SRCS)

clean:
del *.obj

test:
td $(EXE) && del *.tr
23 changes: 23 additions & 0 deletions demo/helloWorld/hello.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
; Hello World

.386
STACK SEGMENT USE16 STACK
DB 200 DUP(0)
STACK ENDS

DATA SEGMENT USE16
MSG DB 'HELLO WORLD$'
DATA ENDS

CODE SEGMENT USE16
ASSUME CS:CODE, DS:DATA, SS:STACK
START:
MOV AX, DATA
MOV DS, AX
LEA DX, MSG
MOV AH, 9
INT 21H
MOV AH, 4CH
INT 21H
CODE ENDS
END START
7 changes: 3 additions & 4 deletions demo/Makefile → demo/sum/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NAME = c1
NAME = sum

EXE = $(NAME).exe
OBJS = $(NAME).obj
Expand All @@ -10,12 +10,11 @@ MASM_FLAG = /Zi/Zd

$(EXE): $(OBJS)
link $(LINK_FLAG) $(OBJS)

$(OBJS): $(SRCS)
masm $(MASM_FLAG) $(SRCS)

clean:
del *.obj && del *.tr
del *.obj

test:
td $(EXE)
td $(EXE) && del *.tr
File renamed without changes.
File renamed without changes.

0 comments on commit e6f0aa4

Please sign in to comment.