Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Define program model and data stack
- ; 100h means our stack is 100 bytes long.
- .model small
- .stack 100h
- .data
- ; Allocate bytes under the name "hello" end with byte $ because the dos print interrupt
- ; Needs to know when to stop printing the string, $ is that indication.
- hello db 10,13,'This is my first printed string!$'
- .code
- ; Load our data segment into our ds register.
- mov ax, @data
- mov ds, ax
- ; Prepare our print interrupt
- mov ax, 09h
- ; Load into the DX register (Data MSB/LSB) -> DS:(hello)
- ; Our data segment + the offset of where our hello is located. (Similar to a pointer)
- lea dx, hello
- ; Interrupt into DOS and call our print function.
- int 21h
- ; We need to return the control back to dos so our program doesn't freeze when it ends.
- mov ah, 4ch
- int 21h
- ; And that's how you print a simple string in 8086 ASM xD
- end
Add Comment
Please, Sign In to add comment