So i was experimenting with printing out arguments that were passed in terminal.
%include "OPCODES.asm"
%include "FILE_DESCRIPTORS.asm"
%include "FUNCTIONS.asm"
SECTION .data
noMsg db "No Arguments Passed!",0
foundMsg db "Argument Found!",0
SECTION .bss
SECTION .text
global _start
_start:
POP RCX
CMP RCX , 1
JE noArgs
printArgs:
CMP RCX , 1
JE finished
printLn foundMsg
DEC RCX
JMP printArgs
noArgs:
printLn noMsg
JMP finished
finished:
exit
the part where i check whether there are no arguments works , but when there is at least one argument passed it goes in an unlimited loop, and i don't really know why, it decrements the counter and checks whether it is 1.
"exit" & "printLn" are macros defined in FUNCTIONS.asm .
Im working on linux kubuntu and i use NASM for assembly.