I'm trying to open, read, and output a text file to the screen. It works, and I can read the file onscreen, but numerous symbols follow. I think it has to do with the top part of my code, but I'm not sure. Could someone please look it over? I welcome any suggestions. I'll paste the top part of my code first, then the output to the screen. Thanks. P.S. If you need more info, just let me know.
(Top part of code)
;directive to define byte data
;string data definition
;20 unassigned bytes and prints out buffer when done
TITLE1 DB 'Hello world',13,10,'$' ;pg. 82
FILENAME BYTE 'D:DATA.TXT',0 ;(0 terminates string)
INHANDLE WORD ?
BYTESREAD WORD ?
BUFFER BYTE ? ;buffer size indicated in other part of code
STACK SEGMENT STACK
;generates a repeated storage allocation, using constant expression as counter
DB 32 DUP ('STACK ') ;pg. 83
(output to screen)
Hey Paul, do you understand how we did this?
Yo Kira, how does this look now? (end of file)
STACK STACK STACK STACK STACK STACK STACK STACK STACK STACK
STACK STACK STACK STACK STACK STACK STACK STACK STACK P
? + ? ? ?? n?^?V ??2 ?-?+n?+?+ ??-? -!+lq+ ? +? -!r3
? ??? + ? -!r ? ?+ ??-? ? -!r
>?? -!r + L-!NNB08`? CV?
? ? ? ? ?Tenth10.obj6 ? ?? /Microsoft (R) Macro
Assembler Version 6.15.8803?6-??-?? K?
M?? O?+h??+F+?-x?% =? ?s?x?
j?? ?p??t??h???P+p%+L+?+dJ-!X?+ ?+ ? [?+O?- +-?, ?+t??
3+?+!++ ?+!3-6+!?+ ?+!=u?T = tKVP=? u86+!;t.:? t)< t:?l?u?FV?:
? t :?+ d?ZZT??ZZT( X^-F-?Fdnd>!?!u?du>!?!u?d>!Press any key to
continue . . .