Hey Guys so here I am in my self training assembly coding, and again I encounter a problem. I Was following an example from on line and at compile time I got the following error:
sample.asm:5: fatal: unable to open include file `io.mac’
The message clearly saying that an include file is missing.
What assembler are you running?
Also, make sure that you run simple programs first and understand the code when running.
Blindly running some complex programs obtained online may not teach you anything.
Thank you for your quick response Im using nasm, below is the code
; Inputs: As prompted
; outputs As per input
%include "io.mac"
.DATA
name_msg db 'please enter your name:' 0
query_msg db 'How many times to repeat welcome message? ', 0
confirm_msg1 db 'Repeat welcome message ',0
confirm_msg2 db ' times (y/n) ',0
welcome_msg db 'Welcome to assembly Language Programming ',0
.UDATA
user_name resb 16 ;buffer for user name
response resb 1
.CODE
.STARTUP
PutStr name_msg ;prompt user for his/her name
GetStr user_name,16 ;read name (max. 15 characters)
ask_count:
PutStr query_msg ;prompt for repeat count
GetInt CX ;read repeat count
PutStr confirm_msg2
GetCh [response] ;read user response
cmp byte [response],'y' ;if 'Y' display welcome message
jne ask_count ;otherwise request repeat count
display_msg:
PutStr welcome_msg ;display welcome message
PutStr user_name ;display teh user name
nwln
loop display_msg ;repeat count times
.EXIT
Cant get in touch with the author, now you said that is not conventional linux assembly. Do you or does any one what “%include io.mac” could be replace with to allow input/output
No idea. I/O code would be OS specific. It may be that the book you have is for DOS. Didn’t the book come with listings of needed files or even a CDROM?
No it is a pdf I downloaded from on line. thank you though I will try another road I don’t want to be stuck with this one program. ill prob will be back soon with more questions. I really appreciate everybody’s help
If you want to go into low-level-stuff you should also consider 8 bit microcontrollers. Most of them are far more simple and efficient than the old and always-backward-compatible x86 machines. You also wouldn’t need any external libraries to see your stuff work. And, you would learn to write not just in a low-level language, you would really do low-level-stuff, because you have control over every single pin of your processor without destroying your computer.
I just created an account to point the original poster to the link where he can download the source code of the .asm examples he’s trying to run from the Book “Guide to Assembly Language Programming in Linux”.
Hope someone find it useful as it seems Prof. Sivarama P. Dandamudi passed away before linking it to it’s home website. RIP Prof. & thanks for your teachings.