Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; BASM - 1.00, by bobo87
- ; **********************
- ; compile command : nasm -f bin test.asm -o test.com
- ORG 100h
- SECTION .text
- ; Basic Hello World! program
- JMP Line_50
- Line_30:
- MOV EAX, StaticString_1_Y4AZCWSSES
- CALL PrintString
- JMP ProgramEnd
- Line_50:
- MOV EAX, StaticString_0_G0E4QX0NZX
- CALL PrintString
- JMP Line_30
- ProgramEnd:
- MOV AH, 0x4C
- XOR AL, AL
- INT 0x21
- PrintChar:
- PUSH AX
- MOV AH, 0x02
- INT 0x21
- POP AX
- RET
- PrintString:
- MOV CL, [EAX]
- PrintStringLoop:
- INC AX
- MOV DL, [EAX]
- CALL PrintChar
- DEC CL
- CMP CL, 0
- JNZ PrintStringLoop
- RET
- SECTION .data
- ; string constants
- StaticString_0_G0E4QX0NZX DB 7, "Hello", 0x0D, 0x0A
- StaticString_1_Y4AZCWSSES DB 8, "World!", 0x0D, 0x0A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement