Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BUF_LEN EQU 41
- %include "io.mac"
- .STACK 100H
- .DATA
- prompt1_msg db "Input a string: ",0
- prompt2_msg db "Input a number between 1 - 10: "
- output1_msg db "Here is the first ",0
- output2_msg db "characters of your string: ",0
- .UDATA
- string resb BUF_LEN
- .CODE
- .STARTUP
- PutStr prompt1_msg
- GetStr string,BUF_LEN
- mov EAX, string
- nwln
- PutStr prompt2_msg
- nwln
- GetInt BX
- PutStr output1_msg
- nwln
- PutStr output2_msg
- nwln
- PutInt BX
- push BX
- call print_string
- done:
- .EXIT
- .CODE
- print_string:
- pop ECX
- l1:
- PutCh [EAX]
- inc EAX
- loop l1
- ret 8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement